Skip to content
Advertisement

Tag: chart.js

Omit 0 value points on chart.js radar

Is there a way to omit 0 value points on a radar chart from chart.js to prevent the border from collapsing in the center while still showing the axis of the 0 value points? Attached is a picture of what I’d like to achieve (left is current chart, right is what I’m looking for). Thank you! Edit: attached is a

Remove padding from chartjs bar chart canvas

I want to create a single stacked bar chart with Chart.js that shows how close someone is to a certain amount of money. To define this amount I put a dotted line on top of the chart. The problem is however that the canvas of this chart has some unwanted padding. So the line spills over outside of the chart.

Chart.js: Why are there two y axes in my line graph?

I’m using chart.js to build a line graph. I can’t figure out why there are two y-axes on my graph. I also tried changing the color of the tick labels to white but it isn’t working either. Thanks for your help! Here’s the preview of my code: https://codepen.io/suminohh/pen/vYROrEx Answer Because you have two axes defined for yAxes. Using proper indentation

How to properly use formatting with chartjs?

I am trying to use formatting in Chart.js. I’ve configured the imports correctly, but it still doesn’t display what I want It doesn’t work on my local pc. I uploaded the same code to codepen and it didn’t work either. You can verify it here Any ideas what am I doing wrong? Thanks Answer As described here, you need to

Why my ChartJs only Coloring one section?

I have created a Bar Chart. It shows data grouped by Year. I have set the color to each datatype, but the ChartJS only shows it on 1 Year ChartJS only Coloring 1 Year Here’s the code: Answer This is happening because you are using V2 of the lib and providing the backgroundColor as an array which means take the

How do i use chartjs in react project properly?

Im trying to use chartjs in my react project but it doesnt work. What am i doing wrong? You can see console logs here: logs Answer The attributes you’re passing to Bar are incorrect. Specifically, your data attribute is missing its own datasets attribute, as can be seen in the error log when Chart.js is attempting to call setDatasets. Suppose

How to hide radar chart index labels (chart.js)

I’m trying to make a radar chart with a dark background. White index labels distract from the chart itself. (my chart) I found a thread that raised a question about customizing index labels, but the code in the answer only works with version 2.1.3 or mb close to it. Is it possible in chart.js@3.5.1? Answer You need to set display

Advertisement