objective-cgraphcore-plotpressure

How to make Pressure Gauge bar graph (use Core Plot 2.2?)


I have looked all over the web and can't come up with anything that satisfies what I'm trying to write.

I have a syringe that causes this silicon tubing to either have no pressure or the max-capacity pressure. I represent this pressure in volts, the value of which I send to my iPhone in order for me to display a line graph of this fluctuating voltage (using Core Plot 2.2).

However, I also want to implement one of those horizontal pressure bar graphs, where (initially with 0 pressure), the bar is empty, but when I apply pressure to the syringe, the bar begins to fill up with a horizontally-flexible blue rectangle, depending on the pressure. How do I do this? Is there a process that Core Plot adopts? Or another framework? Or do I just have to improvise and learn CoreAnimation beyond my current knowledge so that I can just draw this bar graph up?

I'm using Objective-C, Xcode 7.3.1, and deploying to iOS 8.3.


Solution

  • Core Plot can draw bar plots, too. It can be part of the same graph with the scatter plot or in a separate graph, depending on the desired layout.

    Different plot types use different names for the data fields but otherwise the datasource works the same way for all of them.