How to create non-stacked subbars chart using core-plot? - ios

I need to display bar-chart diagram.
The main issue I've not found yet is how to display bars with sub-bars.
So the first bar consists of green bar (with 5 points for y) at bottom and yellow bar (with 3 points for y).
And the second bar consists of pink bar at bottom (with 3 points for y)
So my bars are not stacked. - I can have even no bars for next x, but I can have 3 sub-bars in one bar in different order.
Generally the following image shows what bars do I need.
Generally the following image shows what bars do I need.

Use a different bar plot for each fill pattern. Set barBasesVary to YES on each plot so you can control the ends of bars individually. The plot will query the datasource for three values for each bar: the location (the horizontal position for vertical bars), the tip (the top) value, and the base (the bottom) value. The "Vertical Bar Chart" demo in the Plot Gallery example app shows a simple example of this technique.

Related

Horizontal axis for bar chart

According to a pdf, which was shared in a previous post about tooltips, on page 70, it mentions the possibility to draw bar charts. However, a picture mentions "work in progress" and indeed, Rascal does not seem to support this.
Is there already a possibility to draw a horizontal axis, representing a bar chart, where the text of the categories can be written?
Pdf: Towards Visual Software Analytics
You can use hcat and vcat to put labels under the respective boxes. For example you could draw a bar and its label wrapped in a vcat and then hcat all bars next to eachother, aligned at the bottom using something like hcat([b1, b2, b3],std(bottom())).
references:
http://tutor.rascal-mpl.org/Rascal/Rascal.html#/Rascal/Libraries/Vis/Figure/Figures/vcat/vcat.html
http://tutor.rascal-mpl.org/Rascal/Rascal.html#/Rascal/Libraries/Vis/Figure/Figures/hcat/hcat.html

Core Plot horizontal bar chart on negative y-axis

I have a requirement to draw Core Plot horizontal bar chart with everything on the negative y-axis. I.e. the first index should appear at -1, like below:
I have figured out how to draw horizontal Bar Chart. But figuring out how to draw them in an "inverted" manner (to let user scroll downward with the tallest bar on top). My thought:
1) Convert the Y-index to negative
2) offset the Y-axis to the top of the graph instead of bottom
Is there any better way to do it?
I have found a historical article that's similar to my request (core-plot iOS reversed Y axis).
I have got what I needed after using this:
CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-yMax-1) length:CPTDecimalFromFloat(yMax)
P.S. you need to add the -1 to the Location parameter (-yMax-1) otherwise the horizontal bar at index 0 will not be shown clearly.

AChartengine barchart: width of single bar element

Can the width of a bar element be set so it fills up a certain ratio of the x-axis, e.g. 80% ?
In the general case (multiple bar elements), using renderer.setBarSpacing(0.5f) gives a nice distribution of the axis, but it does not work for the special case when there is only one bar.

How to make color bar above navigator in Highstock?

I have chart showing time data. I have two points back in time which I need to "mark" in the chart.
I currently indicate these two by plotlines, but would like to show bar, with let's say green and blue bars showing the timespans (for example -13days from now with blue and -90days -> -13days with red).
I would use plotBands, but I can't specify their height and do not want to have them all over the chart.
Is there some way? I saw something about translating pixels and drawing rectangle, but wasn't able to make it work. Also - I zoom a lot in this chart.
You can use Renderer and add custom shape. In other cases, please attach mockup of your goal.
http://api.highcharts.com/highstock#Renderer

How to plot rectangular slices in a barchart ? coreplot

How to plot rectangular slices in a barchart ? The slice can be plotted anywhere. It should not start from xAxis.
This slice is actually pointing to a corresponding x and y value.The width of the slice remains same as the bars plotted in the barchart.The height is set a very small value to see it as a slice.
The Blue colored is bar chart's bar and brown colored is the slice.
Set barBasesVary to YES on the bar plot. This will cause the plot to query the datasource for an additional field called CPTBarPlotFieldBarBase. The base value defines one end of the bar and the tip value defines the other end. The location determines the horizontal placement (for vertical bars) as always.

Resources