Inco Mob
Inco Mob

Reputation: 594

iOS Horizontal Bar Graph in Core Plot showing two values

I have worked with Bar graphs with Core Plot, but i couldn't find a way to get a horizontal bar chart containing bars with multiple values. Is there a way to do it in Core Plot?

Here is an image of what i want to do.

enter image description here

Upvotes: 3

Views: 1552

Answers (2)

Prine
Prine

Reputation: 12528

I know it is a really old post. But I have recently created a library which is creating horizontal bars from given values. It's written in Swift and maybe someone can use this in future projects.

https://github.com/prine/ROStorageBar

Upvotes: 1

Eric Skroch
Eric Skroch

Reputation: 27381

You can do this with stacked bar plots. Make one bar plot for each section and set barBasesVary to YES for each one. This causes the plot to query the datasource for an additional field called CPTBarPlotFieldBarBase for each bar. Use this to set the lower edge of the bar.

The "Vertical Bar Chart" in the Plot Gallery example app demonstrates this technique.

Upvotes: 1

Related Questions