Stripe colors toggling while scrolling on Android (and while zooming)


#1

Using stripes on the yAxis. However, when scrolling, I’m noticing that the stripes are toggling colors. Not sure how to explain this best…Let’s say all my content has 10 stripes and 5 of them are visible on the screen: dark, light, dark, light, and so on.

When scrolling the chart, the first stripe becomes light, second dark, etc, and then after scrolling some more they change again.

This dynamic stripe behavior also shows when zooming which is very distracting.

I think stripe “reallocation” should only happen when the zoom is finished, and stripes should stay in place when just scrolling.

Is this a bug or is this meant to be the correct behavior?

Thanks,

Radu


#2

Hello Radu,

The behaviour which you have described is actually the intended behaviour of axis grid stripes. When the chart is scrolled, the data and tick marks move, and as the grid stripes have an association with tick marks, they move too. The same principle applies to zooming. As one zooms into a chart, the pixel distance between each tick mark increases. As the grid stripes are associated with the tick marks, the distance between each stripe boundary will also increase. 

It is possible to modify the colors of axis grid stripes and alternate axis grid stripes. This can be achieved using the setStripeColor(int stripeColor) and setAlternateStripeColor(int alternateStripeColor) methods. These methods can be accessed by retrieving the GridStripeStyle object from the AxisStyle object. An an example of setting a grid stripe colour is : 

axis.getStyle().getGridStripeStyle().setStripeColor(Color.RED);

Using this functionality you may be able to reduce the visual impact of this toggling effect, but at the same time you may lose some of the visual benefit of the grid stripes.

Thanks,

Kai.


#3

I did already set the stripe color and the alternate stripe color. I’m not sure you understood the issue. 

Here’s a couple of screenshots to illustrate the issue:

http://imgur.com/SeygUPd,Zr9yPE2#0

http://imgur.com/SeygUPd,Zr9yPE2#1

Please notice the interval from 2:08:40 to 2:23:40 - in the first screenshot, it’s a light shade of brown. I scroll the char up just a bit, and its background changes in the second screenshot to the alternate stripe color.

I would expect the stripe color to remain the same during scrolling, as that’s the way it happens anywhere else I’ve seen striped content. In other words, I would expect the stripes to “stick” to the tick marks/labels. From your reply, I think that’s your expectation as well.

I hope this makes my problem clearer. 


#4

Hello Radu,

Thank you for posting the screen shots - I can now understand the issue which you are experiencing. After some investigation, I have been able to reproduce this issue which I will investigate further. If it becomes necessary to include a fix within an upcoming release, I will inform you of it’s release date.

We are sorry for any inconvenience that this may have caused you.

Kind regards,

Kai.


#5

Hello Radu,

I would like to let you know that the latest release of ShinobiCharts for Android is now available. Included in this release is a fix for the issue which you describe above.

Thanks,

Kai.