开发者

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

开发者 https://www.devze.com 2023-02-19 10:44 出处:网络
I\'m beginner with the Core Plot framework. Right now, I am able to render bar charts on the screen.

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?


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];
0

精彩评论

暂无评论...
验证码 换一张
取 消