Shinobi Charts: Is it possible, to use an pattern image as color for a series?


#1

Hi there,

one Question: I wan’t to achive such a chart design:

  Wished design

I’ve tried already to use an UIColor with pattern image, but this will not work.  :slight_frown:

UIColor *colorForSeries = [UIColorcolorWithPatternImage:[UIImageimageNamed:@"stripeGreyDiagonalLines"]];
columnSeries.style.areaColor = colorForSeries;
 
 Is it possible in general? If yes, how?
 
 Regards,
 Alex

#2

Hi Alex,

I’m afraid this is not possible at the moment. The charts are rendering using OpenGL, so that we can take advantage of the graphics hardware acceleration. This means that we can only support RGB colors. 

However … I do like the look of your example pie chart. I am sure we could find a way to support patterns.

I’ll put it into our bucket of future ideas!

Regards, Colin E.


#3

Is this still not possible? Will alpha of colors at least be honored? The ideal would be pattern but just being able to do non-full alpha colors would be helpful. Also, would this same restriction be the case for annotations? 

Thanks


#4

Hi Alex,

I’m afraid we haven’t implemented that feature yet. However, it is possible to use donut series with colors containing an alpha of less than 1. If you update the flavourColors property on the donut series style, you can set your colors there.

With regard to annotations, probably the best approach to take will be to subclass SChartAnnotation, and then to add your pattern image as a sub-view of your annotation. They are basically just UIViews, so you have quite a lot of flexibility with what you can do with them.

Hope that helps!

Dan


#5

Any news ref patterns support ?

The proposed feature is really nice, especially combined with the ability to style individual bars: http://www.shinobicontrols.com/blog/posts/2014/07/14/individual-point-styling-discontinuous-line-series-in-shinobicharts-27


#6

Hey,

We haven’t started any development on this feature yet as we’ve been focusing on more popular feature requests. I’ll bump this feature in our backlog to highlight its growing popularity!

Thanks,
Jan