LineSeries with alternating/dynamic line color


#1

I’m trying to reproduce a chart like this: http://i.imgur.com/DPSAwwY.png. I have a line series that depending on another value will be either red or green. I looked around through the documentation (currently trying this on android but eventually on ios as well) but couldn’t find anything.

Best I could think of is to have many many small line series for each contiguous chunk of data with the same color. Any better ideas on how I could implement this?

Thanks!


#2

Hi Radu,

Your suggested implementation is our recommended way on both iOS and Android to achieve this type of effect.

Kind regards,

Patrick


#3

Actually it turns out it’s more of a BarSeries so I went that route instead. Can’t control the width of the bar “stick” (ideally I’d like to completely hide it), but it’s good for now. This way I only have two bar series (a red one and a green one).


#4

Hi Radu,

Good stuff! In terms of controlling the bar width, you can’t change it for individual bars but you can change it for all bars by setting the interSeriesPadding and the interSeriesSetPadding values on the axis’ style object.

Hope that helps,

Patrick


#5

I tried those two calls, but it doesn’t seem to help. Here’s a screenshot on how the bars look at two different levels of zoom: 

http://imgur.com/mJ1pfuI

I would like the bars to be the same height (say 2dp) regardless of the level of zoom. 


#6

Hi Radu,

Just to let you know I added a suggestion to your other forum post about this - http://www.shinobicontrols.com/forum/shinobicontrols/2014/5/barseries-with-no-fill-(gone-not-invisible).

Kind regards,

Patrick