Background color of bar area in SChartBarSeries


How do I make a chart like this in swift:

        let bar = SChartBarSeries() = true = false = UIColor.grayColor()


Hi leonara,

This can be done by using a stacked bar chart.

You have a series per coloured bar making sure the stackIndex is set to the same value.

You will then have to calculate each stacked (light grey) bar’s value base on the first (dark grey) bar to make sure the stacked bar all line up to the same value.

For example, if you had an X-Axis range of 100 and the value for “0.0-0.5” = 10 and “0.5-1.0” = 60.
The second series for the value “0.0-0.5” = 90 and “0.5-1.0” = 40.

Let me know if you have any questions.

Kind regards,
Andrew Polkinghorn