Skip to content
Advertisement

Tag: chart.js

How to remove Label from charts.js

I am using charts.js to create a charts for my website. I am unable the remove the legend from the chart. I did not found the solution. This is the first time I am using charts.js library. code: }); Thanks in advance. Answer Here is the documentation https://www.chartjs.org/docs/latest/configuration/legend.html you can simply set legend.display to false. You can try it here

Json file data to Chart.JS

I’m trying to add multiple datasets from a json file to a linechart in chart.JS. Here’s my JS code: Here’s my HTML: All other neccessary HTML code is added to make the file valid. There is something wrong with this code i just can’t figure out, I’m able to use the charts to input manual data but when it comes

Chart.js- Dates not displaying correctly on chart and axis labels not showing

I’m trying to label my axes on my chart. I’m using chart.js v3.9.1 and I believe I’ve followed the documentation, however the labels aren’t showing up (see below): health_hub_tracker.html: views.py: You will also see that on my x axis- the dates are coming through as a sum. The data I have are: [‘2022-10-09’, ‘2022-10-09’, ‘2022-10-05’, ‘2022-10-05’, ‘2022-10-05’] so it is

charts.js displays only first x and y value from a json api response

I am trying to render a chart with charts.js with a json api but the rendered chart displays only the first x and y values from the json the json is fetched using xmlhttp json api link https://syed1ahmed.github.io/stage-gear/api.json Answer It seems that Chart.js does not recognize the thousands separators (,) in your values. You can get around your problem by

Chart.js timeline [Group for single bar]

I would like to create a time line like this: [1]: https://i.stack.imgur.com/RQ819.png But I don’t understand how to put green into the top bar and yellow into the bottom bar. This is what I got so far but I don’t find anything how to make group only for one bar. Answer You need to define a separate datasets for each

Passing Response data to chartjs

I want to pass this json response data to a chartjs horizontal bar using angular this is the response : I tried this using x axes and z axes of the horizontal bar of chart js using this code But it seems it doesont work because i alwyas have duplication with different colors like this: i want to regroupe each

How can I highlight a bar in ChartJS when selected in the legend?

I need to change background color of bar when selected it in the legend. When I updated chart with ci.update() color is reset. Answer When the chart.update() is invoked, the chart is re-configuring itself starting from chart.data.datasets and all element options (changed in the meanwhile) are lost. The chart.data.datasets must be changed. The original backgroundColors must be stored because otherwise

Advertisement