You must be logged in to post your query.
Home › Forums › Chart Support › Stack with one List of DataPoints
Tagged: Stacked cplumns
Hi! I have a little problem i don’t know how to stack a list of DataPoints in the same column.
Here is an example of what i want to do…
List<DataPoints> Target = new List<DataPoints>(); List<DataPoints> Real = new List<DataPoints>(); List<DataPoints> Projects = new List<DataPoints>(); Target.Add(new DataPoints("Target", 500)); Real.Add(new DataPoints("Real", 300)); Projects.Add(new DataPoints("Project1", 50)); Projects.Add(new DataPoints("Project2", 50)); Projects.Add(new DataPoints("Project3", 50)); Projects.Add(new DataPoints("Project4", 50)); Projects.Add(new DataPoints("Project5", 100)); ViewBag.Target = JsonConvert.SerializeObject(Target); ViewBag.Real = JsonConvert.SerializeObject(Real); ViewBag.Projects = JsonConvert.SerializeObject(Projects);
And i want to get something like this
600| | 500| +-----+ | | | 400| | | | | | 300| | | +-----+ +-----+ | | | | | | | 200| | | | | +-----+ | | | | | +-----+ 100| | | | | +-----+ | | | | | +-----+ 0|______|_____|_____|_____|_____+-----+_ Target Real Projects
I hope you can understannd my problem
@9dan7,
Stacked Column Charts are plotted when multiple Column Charts with aligned x values are plotted on the same scale. Using Target, Real and Project as the dataPoints of one of the dataSeries(say dataSeries1) and then creating new dataSeries(dataSeries2) for each of the Project(Project1) as its dataPoint and so on should work fine in your case. Kindly refer this gallery page for an example on a stacked column chart.
— Shashi Ranjan Team CanvasJS
You must be logged in to reply to this topic. Login/Register