I have the following horizontal stacked bar chart. However, I am trying to add pink scatter dots onto the chart (based on the right y axis numbers), but they aren’t showing up. Can anyone advise what I am doing wrong please? It seems if i change the chart to normal bar, and not horizontal, the dots show up, however I
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
Remove redundant legends on the chart using generateLabels with ChartJS v3
I have a chart as follows, I only need one pair of legends (data 1 and data 2) to show on the chart. In ChartJS v2, I can use generateLabels like this but it doesn’t seem to work the same way in v3 that I’m using. Is there an easy way to achieve this in v3 using generateLabels or do
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
vanilla js error “cannot set property of undefined” on the chrome console
Hey I’m new to chartjs and js in general and keep getting the error “”cannot set property of undefined” on the chrome console then in a timed loop I’m calling this and getting the error “cannot set property of undefined” when trying to do the below operation (I’m not setting the value in html and it is only set when