如何使用Core Plot在图表中绘制水平条? [英] How do I draw horizontal bars in a chart using Core Plot?

查看:81
本文介绍了如何使用Core Plot在图表中绘制水平条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Core Plot框架的初学者。现在,我可以在屏幕上绘制条形图。

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

但是,我需要绘制水平条形图,其条形从Y轴延伸,就像这样:

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

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

我如何在Core Plot中实现这样的水平条形图?

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

推荐答案

您说您正在使用core-plot,该框架中包含示例代码,其中已实现barChart。您可以看一下。

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.

编辑:

对不起,我看到您现在进行了更新,我得到了您需要单杠。使用以下代码。

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

CPBarPlot * barPlot = [CPBarPlot ...];
[barPlot setBarsAreHorizontal:YES];

这篇关于如何使用Core Plot在图表中绘制水平条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆