多个条形图位于另一个上方且有偏移
您好,我正在尝试呈现一个包含多个条形的条形图。每个条由多个(但每个条的数量相同)小节组成。所以我想显示一个条形图,它有下部(例如绿色)、中间部分(例如黄色)和顶部红色部分。我考虑过创建三个独立的图,但这会带来一些开销,因为我猜订单图没有修复 (调用各个数据源的时间未知,较小的条可能会被较大的条覆盖)。
所以我正在考虑给每个条形一个偏移量以连接较低的条形。 但是如何动态地将 y 偏移添加到条形位置呢?
感谢您的帮助!
Hi there i´m trying to present a bar plot with multiple bars. Each bar consists of multiple (but same amount for every bar) subsections. So i want to show a bar which has a lower part (e.g. green) a middle part (e.g. yellow) and the top red part. I thought about creating three independent plot but this would bring some overhead since the order drawing isn´t fix i guess
(the time when respective datasource will be called is unknown and the smalles bar could be covered by a bigger one).
So i was thinking about giving each bar an offset to affiliate the lower bar.
But how do i dynamically add an y-offset to a bar location?
Thanks for help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将绘图上的
barBasesVary
属性设置为 YES。然后,Core Plot 将为每个数据点查询您的数据源,以获得名为 CPBarPlotFieldBarBase 的附加字段。这意味着您将为每个柱提供三个数据值——位置、基础值和小费值。Set the
barBasesVary
property on your plots to YES. Core Plot will then query your datasource for an additional field calledCPBarPlotFieldBarBase
for each data point. This means you will provide three data values for each bar--location, base value, and tip value.