[iOS] Setting baseline dynamically in didAlterRangeOn delegate doesn't work in some cases


#1

Hi,

I currently use baseline property of the SChartLineSeries to have the gradient fill effect until the baseline, as previously suggested by you. It works perfectly for the chart that shows all data points at once, but when we need to show only a smaller range of all data at a time by setting the baseline property dynamically in the didAlterRangeOn delegate and doing the redraw, there would be problems. Here’s the normal one:

And here are the two with the problems:

  1. This one seems just ignore the baseline property. In the log I could read the baseline property is 22, but it doesn’t work.

  2. This one shows the strange red color, of which I never set elsewhere in the controller.

Thanks in advance for your help then.
Joseph


#2

Hi Joseph,

I think there are a couple of problems here.

1: This looks like a bug in our 2.9.0 release that meant the gradient was always being drawn to 0 when it should really be drawing to the baseline. This has been fixed and we’re hoping to get an ALPHA build out later today with this fix included. I shall update this post when it’s available.

2: Could you check what the baseline value is in this scenario? It appears that it may be ‘15’ which means the color will be taken from series.style().areaColorBelowBaseline. The default color used for this is red, which is probably why you’re seeing this. I guess you’ll probably want to be setting the baseline to 11 in this case?

I hope that’s of some help.

Sam


#3

Just to follow on from my previous comment, the alpha version should now be available on the customer portal.

Please let me know if you’re still facing the problem after giving that a try.

Sam


#4

Hi, I am sorry to tell you that problem still at here even upgrade to 2.9.3, so I think may be we use the wrong property ?


#5

Hi JohnNie,

It looks like you are setting a baseline value on your series to 5.6 causing the area color below baseline to be drawn.

I’ve just checked our areaColorBelowBaseline property on an SChartLineSeries and it works as expected.

If you wish for this to disappear, can I check you’ve tried setting our areaColorBelowBaseline property to a clear color?

If you could manipulate our Line Series sample to replicate your issue and send it to us, it would really help us identify the source of your issue.

Kind regards,
Andrew Polkinghorn.


#6

Hi Andrew Polkinghorn, you know what, when I set the areaColorBelowBaseLine to clear color, it’s worked and perfect, so this problem is done, thanks a lot.