may i know how to generate a bar chart with each labels contains its own bar of data eg : ``` data = { labels: ["apple", "orange", "pear"], datasets: **this is the part where i stucked** } ``` i want to have 3 bars displaying : apples -> a bar (10 apples), orange -> a bar (6 oranges), pear -> a bar (4 pears)
Activity
nicholasess commentedon Apr 18, 2020
@jacky-ew if you want to show labels without hover, you can use this lib
https://www.npmjs.com/package/chartjs-plugin-datalabels
Arantiryo commentedon May 13, 2022
Hi @jacky-ew 👋
If I understand your problem correctly, you can just set up
datasetslike so:to achieve desired result.
dangreen commentedon Nov 30, 2026
Closing: this is a usage question rather than a bug report or a feature request. The docs of the wrapper are at https://react-chartjs-2.js.org and the chart options are described in the Chart.js docs: https://www.chartjs.org/docs/latest/