score:9
you can achieve that by using a chart.js plugin called - chart.piecelabel.js.
first.. install it via npm :
npm install chart.piecelabel.js --save
then.. import it in your dashboard component :
import 'chart.piecelabel.js';
and finally.. set the following option in your chart's options config :
piecelabel: {
render: 'label'
}
note: this is the minimum option needs to be set to display the labels, and you can find more options here.
see - working example
score:1
'chartjs-plugin-labels' is the most popular display plugin. i just tried it. it works!
npm install chartjs-plugin-labels --save
in the desired angular 2+ component, add the following:
import 'chartjs-plugin-labels';
no need to import any module.
here is the npm information:
https://www.npmjs.com/package/chartjs-plugin-labels
site:
https://chartjs-plugin-datalabels.netlify.com/
demo:
https://emn178.github.io/chartjs-plugin-labels/samples/demo/
package.json : combination which worked:
"chart.js": "^2.8.0",
"chartjs-plugin-labels": "^1.1.0",
Source: stackoverflow.com
Related Query
- How to display the labels in doughnut chart using ng2 charts?
- How to add text inside the doughnut chart using Chart.js?
- How to add text in centre of the doughnut chart using Chart.js?
- How to draw outer labels for polar chart using ng2-charts and chart.js at fixed positions outside the rings?
- How to add text inside the doughnut chart using Chart.js version 3.2.1
- Chart.JS: How can I only display data labels when the doughnut size is big enough for the text?
- How to add text inside the doughnut chart using Chart.js AngularJS 2.0?
- How to display Labels on Doughnut chart in Chart.js
- How to display the values inside the pie chart of PrimeNG (chart) using JavaScript or Angular
- How to display labels outside the pie chart border?
- How to add image inside the doughnut chart using chart.js?
- How write the labels of the data inside a Doughnut Chart made with Chart.js?
- How do i have a single Chart.vue component instead of different chart components and then display charts from it by changing id of the API
- How to vary the thickness of doughnut chart, using ChartJs.?
- How to save Chart JS charts as image without black background using blobs and filesaver?
- How to display Line Chart dataset point labels with Chart.js?
- How to add images as labels to Canvas Charts using chart.js
- Display a limited number of labels only on X-Axis of Line Chart using Chart.js
- How to display data labels outside in pie chart with lines in ionic
- How to align Chart.JS line chart labels to the center
- How to access labels array using chart plugin (Chart.pluginService.register) in Chartjs 2.x?
- How to create single value Doughnut or Pie chart using Chart.js?
- How to display value labels above graph bars using chart.js
- How can I display the xAxes and yAxes data in the tooltip, Chart JS?
- How can I add some text in the middle of a half doughnut chart in Chart.JS?
- ChartJs - Pie Chart - how to remove labels that are on the pie chart
- Display labels on bar chart using Chart.js
- Vue Chart 3 - Doughnut Charts with Text in the Middle (Trouble registering a plugin)
- how to show labels in laravel charts when the name of the label is on another table?
- How do I customize y-axis labels and randomly pick the value from the data range for x-axis in Chart js
More Query from same tag
- Chart.js timescale: set min and max on xAxes
- Chart js with ng-repeat
- How to make dynamic chart js using JSON in Codeigniter?
- How to create datasets dynamically for chart.js Line chart?
- yAxes not working with min max option
- Is there a way to trigger point hit on an xAxis hover
- ChartJS: Uncaught TypeError: Cannot read property 'call' of undefined
- How can I rotate a pie chart in charts.js?
- Charts in Angular js with JSON Object
- How to convert chart.js library chart to image in pure node.js without using HTML and CSS?
- Line Chart using Chart js with time data
- Getting charts.js to read from Google Sheet JSON data
- charts js have a bar spanning negative/positive on y-axis
- Chart.js How to sum the values in a pie chart and display them in the header
- Chart js vertical line z-index
- Why doesn't parsing option work in chartjs?
- charts.js and timestamp as readable date
- Issue While Passing Dynamic Datas in React Chart Js 2
- Chart.js Show labels on Pie chart
- Vertical line across multiple charts
- How to show slice value inside of slice in pie chart using chart.js
- How can I build a vertical line without going through my dots on my line graph? (charts.js)
- bower degrades chart.js each time installing other packages
- Chart.js color is not getting changed
- ChartJS 2.7.3 stacked bar chart with overlap
- (MVC) Is this an efficient way of displaying chart data by date?
- Chart.js dataset options externally with functionality
- Chartjs time in Xaxes
- Force chart to redraw or update Chart.js
- Add labels to bar chart: chartjs