Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I draw horizontal bars in a chart using Core Plot?

I'm beginner with the Core Plot framework. Right now, I am able to render bar charts on the screen.

However, I need to draw a horizontal bar chart that has the bars extending from the Y axis, like so:

 ^
y|
 |****
 |*******
 |**********
 |******
 |---------------> x

How would I implement such a horizontal bar chart in Core Plot?

like image 301
ravoorinandan Avatar asked Dec 28 '22 23:12

ravoorinandan


1 Answers

you said you are using core-plot, there are sample codes with the framework, in which barChart has been implemented. You can have a look at it.

EDIT:

Sorry I saw you update now, and I got you need horizontal bars. Use following code.

CPBarPlot * barPlot = [CPBarPlot ...];
[barPlot setBarsAreHorizontal:YES];
like image 65
Vaibhav Tekam Avatar answered Jan 19 '23 01:01

Vaibhav Tekam