I want to draw Stack Bar Graph in iOS application in the given link
http://peltiertech.com/images/2009-05/StackChart4.png
.I Know to draw Simple Bar Graphs using core plot,but could not find a way to draw Stacked Bar Graphs.Please Can anyone suggest me the way to draw Stacked Bar Graphs using core plot or any other libraries.Please suggest any other libraries available to draw this in iOS application.
Core Plot won't do the stacking calculations for you, but it can draw the bars. You'll need one bar plot for each data series. For example, you could draw one bar from 0 to 2 with one plot. The next plot could have a bar that spans between 2 and 5 and a third plot could go between 5 and 6.
The way to set this up is to set barBasesVary
= YES for all but the bottom plot in the stack. These plots will ask the datasource for an additional plot field called CPTBarPlotFieldBarBase
. Use that to set the starting value for the bar and use CPTBarPlotFieldBarTip
to set the end point as usual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With