I have a chart.js which displays two different lines, on which will always be positive and one which will always be negative. I want to visualize the area between both lines and a value of 0 on the y axis and therefore want to fill in below the the positive line and above the negative line both ending at 0.
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
ReferenceError: Chart is not defined – chartjs
Is there a bug with Chart.js? Every time I add any of the graphs at Chart.js to my website I get an error, but when I used the graph as stand-alone program it runs smoothly without errors. I am using HTML5. SOLVED: I just decoupled the script from the canvas element (made another file for the script to execute its
JavaScript Chart.js – Custom data formatting to display on tooltip
I have looked at various documentation and similar questions on here, but cannot seem to find the particular solution. Apologies if I have missed anything obvious or have repeated this question! As a bit of background info, I have implemented 4 graphs using the Chart.js plugin and passed in the required data using PHP from a database. This is all
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.