Skip to content
Advertisement

Tag: chart.js

Chart.js (Radar Chart) different scaleLineColor for each scaleLine

I would like to try and create a radar chart using Chart.js which has various colours for each scaleLine, or coloured between the scaleLines. I was wondering if this was possible? From: To: I currently have a working graph, though there doesn’t seem to be a method to change individual scale lines. Kind Regards Leigh Answer You can extend the

How to set ChartJS Y axis title?

I am using Chartjs for showing diagrams and I need to set title of y axis, but there are no information about it in documentation. I need y axis to be set like on picture, or on top of y axis so someone could now what is that parameter I have looked on official website but there was no information

How to display data values on Chart.js

Is it possible using Chart.js to display data values? I want to print the graph. Thanks for any advice.. Answer There is an official plugin for Chart.js 2.7.0+ to do this: Datalabels Otherwise, you can loop through the points / bars onAnimationComplete and display the values Preview HTML Script Fiddle – http://jsfiddle.net/uh9vw0ao/

Chart.js — drawing an arbitrary vertical line

How can I draw an vertical line at a particular point on the x-axis using Chart.js? In particular, I want to draw a line to indicate the current day on a LineChart. Here’s a mockup of the chart: http://i.stack.imgur.com/VQDWR.png Answer Update – this answer is for Chart.js 1.x, if you are looking for a 2.x answer check the comments and

Different color for each bar in a bar chart; ChartJS

I’m using ChartJS in a project I’m working on and I need a different color for each bar in a Bar Chart. Here’s an example of the bar chart data set: Is there any way to paint each bar differently? Answer After looking into the Chart.Bar.js file I’ve managed to find the solution. I’ve used this function to generate a

How to vary the thickness of doughnut chart, using ChartJs.?

How to vary the thickness of doughnut chart, using ChartJs Answer since version 2 the field has been renamed to cutoutPercentage. cutoutPercentage Number 50 – for doughnut, 0 – for pie The percentage of the chart that is cut out of the middle. It can be used like this more details here http://www.chartjs.org/docs/#doughnut-pie-chart-chart-options Update: Since version 3 According to the

How to add text inside the doughnut chart using Chart.js?

How to render Text inside the doughnut chart, I am using ChartJs. Answer You have to modify the code like: in chart.Doughnut.defaults and then in function drawPieSegments ctx.fillText(data[0].value + “%”, width/2 – 20, width/2, 200); See this pull: https://github.com/nnnick/Chart.js/pull/35 here is a fiddle http://jsfiddle.net/mayankcpdixit/6xV78/ implementing the same.

Advertisement