Skip to main content

All Questions

0 votes
0 answers
206 views

Chart js - v 4 How can I change the order of chart legend

The legend was created using the html Legend Plugin, which is displayed differently from the order in which you draw the chart Is there a way to change the legend order to match the data order? I ...
jy p's user avatar
  • 1
0 votes
0 answers
776 views

Chart JS 3.9 - bar chart with multiple legend labels for one dataset

Current results As seen in this picture, I would like additional legends that is matching the colors. Like Apples are shown with the color green, I would also like to show 'Bananas' for orange', '...
Peter Dalby's user avatar
0 votes
1 answer
527 views

Why the labels under chart are not corresponding with labels in legend in Chart.js for bar chart?

I would like to make a chart with labels on xAxes and the same labels in the legend. I was trying different solutions, but the best I got is the snippet below. I don't understand, why all bars are ...
Kida's user avatar
  • 800
0 votes
1 answer
1k views

Legend position is not vertically in middle in Donut chart

In Donut chart Legend position is right but i want to add vertically in middle with corresponding of circle. I am new to chartjs and JavaScript. Below is my code snippet. I am trying to load the pie/...
prerana pandey's user avatar
0 votes
0 answers
587 views

ChartJS: How to force redraw after hiding data items clicking on legend?

I've a ChartJS pie chart, where I draw the labels myself. This works fine - until the legend comes into play. const options = { layout: { ... }, plugins: { ...
Konrad's user avatar
  • 4,637
0 votes
2 answers
453 views

How to convert a bar legend to line legend in chart.js 2.7.2?

I am trying to create a line graph using chart.js v2.7.2 and here is what it looks like: const labels = [ 'January', 'February', 'March', 'April', 'May', 'June', ]; const data = { ...
Shilp Thapak's user avatar
1 vote
1 answer
1k views

Resize Chart Independently From Legend in ChartJS for Canvas Download

Some of the charts created and downloaded by my application have the potential to have very large legends. When this is the case, the idea is to create (ideally via ChartJs - as is the case with the ...
ShDevs's user avatar
  • 53
0 votes
1 answer
4k views

ChartJS custom legend doughnut separate legend from chart area

I'm attempting to separate the Legend from my Chart in a ChartJS chart. When using the 'default' legend, there is no way to control the chart area size and it will get smaller the more items I have in ...
Yafim Simanovsky's user avatar
1 vote
2 answers
438 views

Display legend of grouped data (different colors) in chart

I have a horizontal chart with different colors to group the data. In the code below, the chart layout displays as intended, but the legend shows only a single color (yellow). How can I force the ...
JAT86's user avatar
  • 1,035
0 votes
1 answer
25 views

ChartJs doesn't display the line item legend

Here's the code: And here's the result: As you can see, no legend
ionescho's user avatar
  • 1,390
0 votes
1 answer
252 views

Load Tooltip faster during onHover of Legend Doughnut chart

I currently have an implementation exactly like the answer shown in this answer which I am going to include here for clarity. If you run the code and hover between items in the legend, you will notice ...
cfeltz's user avatar
  • 23
0 votes
1 answer
803 views

How to change legend icon on hover Chartjs

I am trying to customize a chartjs legend so that when you hover over a legend item, the icon/point style will change. See screenshot Screenshot. Is this possible? I am trying different things with ...
Proscrypt's user avatar
0 votes
1 answer
915 views

Chartjs Custom Legend for Doughnut Chart Having Labelled Lines Sticking Out of Each Section

I know how to draw doughnut chart for a data set in Chartjs and its legend customization but I want to have a chart like the one shown in the image below in which lines from each section sticking out ...
M. Ismail's user avatar
  • 371
0 votes
1 answer
1k views

Chart.js remove label from legend for if dataset values

I have a chart with multiple datasets. I want the label of a dataset from the legend to not be visible if all the values in a dataset are null. I've found some solutions but they were only working if ...
Raluca Micu's user avatar
0 votes
1 answer
366 views

Chart.js: Disable Y-Axis, when graph is disabled via Legend

is it possible to hide the Y-Axis for a graph that has been disabled via the legend? Right now it looks pretty messy, as disabled-graph-Y-Axis are just reset to the default range. Picture of the chart ...
GeriX's user avatar
  • 3

15 30 50 per page