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
- HTML5 chart stacked bars with repeated colors
- Chartjs Customize Scale Numbers
- ChartJS using AJAX call to retrieve data isn't rendering visualization
- Show values on top of bars in chart.js
- Sorting arrays and comparing array values php
- Doughnut chart adjusting problem in chart.js
- Moving HTML with jQuery makes chart.js charts dissapear, no errors, unknown reason How can I redraw it?
- Mouse-over function behaving weird in Chart.js
- How to fix a stacked logarithmic bar chart values to fit the grid
- Chart.js: How can a line series (out of many) change line color and thickness upon mouse hover?
- How to add images to chart labels with vue-chartjs?
- Cannot access a variable declared outside a For loop (Javascript)
- ngx-charts-advanced-pie-chart is reading my rest api response as null
- How to rename properties in objects that are in an array. What is the right way to solve the task?
- Chart.js - Same min and max value of two charts
- Chart.js version 2.2.1 wont show chart
- Changing line color below specific value in Chart.js
- Erro Nova ChartJs SQL Generator when using PostgreSQL
- Chartjs : data labels getting overlapped in smaller datasets using chartjs-plugin-datalabels
- Chartjs-2(React), Lines do not appear
- Bar Chart not displaying when using chart.js
- Histogram like chart with intensity colored columns and per bin opacity to show intensity
- Chart.js Label Issue
- Laravel Vue error when trying to use chart.js with Laravel-charts package
- ChartJS Annotation Hide /Show
- Font size will not change Chart.js version 3.2.1
- How to use chartjs-plugin-trendline with react-chartjs-2
- How to use set the color for each bar in a bar chart using chartjs?
- PhantomJS renders blurry Chart.js canvas
- How to scrape an interactive charts with scrapy?