SwiftChart icon indicating copy to clipboard operation
SwiftChart copied to clipboard

Specify the color above or below other than zero

Open ghost opened this issue 8 years ago • 6 comments

Is it possible to specify a color above or below other than zero ?

ghost avatar Oct 12 '16 01:10 ghost

Sure, use the ChartSeries.colors option. E.g.

let series = ChartSeries([0, 6, 2, 8, 4, 7, 3, 10, 8])
series.colors = (above: ChartsColors.redColor(), below: ChartsColors.blueColor())

gpbl avatar Oct 12 '16 05:10 gpbl

Sorry my question was not correct. Is it possible above and below 100 and not zero ?

ghost avatar Oct 12 '16 09:10 ghost

I misread the title :) I believe changing the 0 in this line should do it! I can't try it now but if you want to send a PR it would be greatly appreciated. I think it should be provided as an option of ChartSeries. How could we call it ?

gpbl avatar Oct 12 '16 14:10 gpbl

Changing the zero ? For the name ... It's your baby ;) but why not ChartColorsLimit, ChartColorsLine. Sorry, I don't know what is a PR and how to post it, I don't use Github except for download a project :o/

ghost avatar Oct 12 '16 15:10 ghost

@Cyphontin sounds like the best time to contribute something back 👍

gpbl avatar Oct 12 '16 16:10 gpbl

Thank you for your time @gpbl

ghost avatar Oct 14 '16 21:10 ghost