Skip to main content

All Questions

Tagged with
0 votes
0 answers
70 views

Left padding on right positioning legend in react-chartjs-2 line chart

I am using react-chartjs-2 line chart and assign legend position to right side but graph and legend does not containing the space. I want to provide left padding to my legend which create the space ...
user24101712's user avatar
1 vote
0 answers
131 views

How to add space between Legend text and chart in ChartJs v4

I'm using Chart.js version 4.4.1, and I want to increase the space between the legend and the chart. I need a solution for barchart. I'm sharing the code for the bar chart. I've checked several posts, ...
Aishwarya's user avatar
0 votes
1 answer
258 views

ChartJS Customised tooltip and LegendText not displaying after version update

Earlier i was using 2.7.2 version of ChartJS, now im updating to 4.4.1 So in my chart i was creating customized tooltip and customized Legend text but after version update both are not working Here is ...
Aishwarya's user avatar
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
475 views

PrimeNG (chart.js) chart legend to display title and legend in a SINGLE line on top

I have a chart.js based primeNG donut chart derivative and I am trying to display legend better. What I want is the legend title is in the top left corner and rest of the legend in the top right ...
ILIA BROUDNO's user avatar
  • 1,813
0 votes
0 answers
51 views

Default Dot is not showing in tooltip chart.js line type with labels

I have multiple line type charts in charjs. All is good but It is showing dot with label in the tooltip like I have in legends. I have added multiple options in the tooltip object but no one is ...
Jahangir Hussain's user avatar
0 votes
1 answer
61 views

PrimeFaces bar chart: hide color in legend

PrimeFaces bar chart: how to hide color in legend? One data series but each bar has different color. <p:barChart model="#{bean.model}"/>
eastwater's user avatar
  • 5,276
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
1 vote
0 answers
31 views

How to use a static color for Chart.js bar chart's legend, when using an array of background colors [duplicate]

I have a Chart.js bar chart that has its backgroundColor set as an array. Example: { type: 'bar', label: "...", data: [...], borderColor: '...', backgroundColor: ["var_color1&...
Tarek Hammami'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
2 votes
1 answer
773 views

chart.js 3.7.1 where to go with my plugins?

I switched from chart.js 2.9.3 to 3.7.1 and some options do not work anymore. If I see it right the options like "Legend" and also "tooltips" went to plugin under "options&...
mickna's user avatar
  • 53
1 vote
1 answer
2k views

How can i give the full Legend a background color in chart js?

I am working on a project and we are using a chart created with chart js. I want to give the legend a background color (the top part thats drawn in the image). After a lot of searching on the internet ...
Jarno Looij's user avatar
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

15 30 50 per page
1
2 3 4 5