score:0
the reason you are not seeing the tooltip label is because you used the incorrect label config option. the option is called label
not labels
and only accepts a single string (not an array of strings). if you pass in an array of strings to label
then chart.js simply assembles a comma separated string for each index in the array for the label.
with that said, i can see what you are attempting to do, but unfortunately, there is no way to do this using chart.js. a dataset always represents a data value per each category label. in other words, each index in a dataset's data
array maps to the same index in the labels
array (which is defined outside of the dataset).
here is a codepen to show what i mean.
as you can see, each dataset spans across all categories (labels). you cannot have 3 datasets for 'car', 3 datasets for 'recharge', etc. the best you could hope to do is set a value of 0 for the categories that the dataset does not belong to, but it makes the graph appear quite confusing.
here is an example showing that.
Source: stackoverflow.com
Related Query
- Grouped bar charts each group different level in chart.js
- Grouped bar chart having each group with different data using chart.js
- Different color for each column in angular-chartjs bar chart
- How do I get a different label for each bar in a bar chart in ChartJS?
- ChartJS/High Charts Radar chart - Different radial axis labels for each category that appear on hover
- Chart.js manipulate each bar in chart with different labels
- How to set different colors in each stacked bar chart cell?
- how to create bar chart with group and sam color for each group using chart.js?
- Different color for each bar in a bar chart; ChartJS
- ChartJS add tooltip to a grouped bar chart
- Chart.js Mixed Bar and Line chart with different scales
- chart.js Line chart with different background colors for each section
- Hide empty bars in Grouped Stacked Bar Chart - chart.js
- ChartJS bar chart with legend which corresponds to each bar
- Chart.js - Line charts with different colors for each border lines
- Can I specify a different font size for each row of text in Chart Title?
- chart js - Apply different color for each x-axes label
- How to set single color on each bar in angular chart js
- chart js data-point between bar charts
- Specify varying thickness of each bar in Chart.js bar chart
- Customize different tooltips of bar chart
- Vue ChartKick - different colours for bar chart
- How to show gradient vertically on chart js grouped bar chart?
- Grouped Bar Chart from mySQL database using ChartJS and PHP
- How to show different product name for every bar in chart js
- How to retain spacing between bars for two different bar charts in Chart.js 2
- ChartJS horizontal chart display legend on each bar
- angular-chart.js : how to show numbers in each bar of stacked bar chart
- Grouped Bar Chart ChartJS
- Equal distance grouped bar chart irrespective of scale - chart.js
More Query from same tag
- How to change number to $ with commas? Chart.js
- Foreground chart by mouse
- Colors not showing up on charts in ionic 3
- How do you create an extension to Chart.js?
- ChartJS using multiple Y axes
- onClick : handleClick
- chartjs create scrolling on the x axis
- Create data structure in c# for multiple series charts
- How to draw a hover effect behind a bar chart?
- Chartjs Bar Chart Y Axis set base starting value to not be 0
- Charts.Js with Asp.Net Webforms Does Not Work
- Chartjs Timestamp to Datetime labels
- How to customize border style on Chart.js
- Moving vertical line when hovering over the chart using chart.js in v2.9.4
- interactive Button doesn't hide the chart as I intended
- Highlight background on a single hour with chart.js and annotations
- How to get a dynamic number into a chart.js chart?
- Adding caret/arrow to a Chart.js custom html tooltip
- Changing labels with logo images
- ChartJS : How to leave just points without lines
- Is there any way I can customize my chartjs
- Multipe doughnut charts on one page with text in center using Chart.js
- Adding a Label to Chart js Pie Graph
- Run the function on load
- React - render Chart.js chart based on user selection, after Ajax returns JSON
- ChartJS: Change the positions of the tooltips
- Chart.js Types of property 'type' are incompatible. Type 'string' is not assignable to type '"line" | "bar" | "scatter"
- Single Point Curve Chart.js
- Trying to update data in chart.js chart
- Overlap chart datasets with different view types in Chart.js