How to add a dataset to the stacked bar in chart.js - chart.js

When I try to add a new data set to the stacked bar in chart.js, the data set can't be showed correctly (the red square should be filled in green).
Can someone help me? Thanks
Have a look on the image:
Following is my program:
https://codepen.io/stigersmile/pen/YRaebg

Related

Chartjs: customise legend based on background color

I am creating a bar chart using charts. The current work is below:
The colour represents continents. Notice that the default legend is blue showing undefined. I want to have the legends showing each colour and its represented continent. That is, to be able to display legends of the bar's background and customise their label.
How can I achieve that?
Really appreciate your help! Thanks
Instead of putting all your data in a single dataset you will need to make a different dataset for each continent and then set the label of that dataset to the continent

Why do Bar Pie Chart values not line up?

I'm working on a Bar Pie Chart but my values are not lining up. For example, Red data is clearly larger then blue, but blue value is higher.
The data is correct, chart.js doesnt show the area as more, it uses the angle of the circle , which normally would also divede the area normally. And as you can see the angles are correct so to fix your issue you will have to write a custom controller that draws your chart. https://www.chartjs.org/docs/latest/developers/charts.html

Chart.js Bar Chart coloring Technique

Hi Everyone i just want to ask question about bar chart in this application http://www.chartjs.org/
is it possible to create a bar with 2 colors?
for example i have a target 1000 and reach 500
so the full length of bar is color blue(target) then the 50% length of the bar is color red(reach)?
sorry for my question if it is confusing thanks
I think that a posible solution could be use some kind of Stacked Bar.
But chart.js doesn't support that out of the box, It looks like that you need the a fork of chart.js called chartnew.js that allow stacked bar which could give you this two colors in the same bar and many other options. Take a look at the github page of the project
https://github.com/FVANCOP/ChartNew.js/
I hope it helps

Vertically stacked Google Bar Charts

I'm trying to produce a vertically stacked bar chart using the Google Charts API and I thought I had found the solution when I found the option:
isStacked: true
However, This seems to add the stacking horizontally (see link below) and I cant seem to find a way to do it. Anyone come across this before or can help me?
See: http://jsfiddle.net/tmA55/1/
Thanks
Do you mean a vertically stacked ColumnChart?
Just change the chart from BarChart to ColumnChart:
new google.visualization.ColumnChart(document.getElementById('chart'))
http://jsfiddle.net/asgallant/tmA55/2/

line label pie chart graphael

I'm creating a html5 web for mobile device and I'm using graphael to create a pie chart.
The chart is render perfectly but I have two problems that I don't found the solution.
I want that the first portion of the chart start at 12 oclock.
https://dl.dropbox.com/u/23287638/piechart.png
And my second problem its' that I want to have a line label for each portion of the chart like this:
https://dl.dropbox.com/u/23287638/chart2.png
Any suggestion to how to do this two things?
Thanks