SChartAnnotation ShinobiCharts2.5


#1

Hello,

while i was using the shinobicharts-premium-2.3.0 i was using this code in order to put labels on top of earch bar (In a ColumnChart)

but now since  shinobicharts-premium-2.5.0 the code puts all the labels on the same spot in the first bar of the ColumnChart.

Can you guys give me a help ? 

Thx in advance for any help :slight_smile:

for (int i = 0; i < barChart.series.count; i++) {
                SChartSeries *myBarSeries = [chart.series objectAtIndex:i];
                for (SChartDataPoint *dp in myBarSeries.dataSeries.dataPoints) {
                    
                    SChartAnnotation *a = [SChartAnnotation annotationWithText:[NSString stringWithFormat:@"%d",[dp.yValue intValue]]
                                                                       andFont:[UIFont fontWithName:@"Gotham-Book" size:12.0]
                                                                     withXAxis:chart.xAxis
                                                                      andYAxis:chart.yAxis
                                                                   atXPosition:[self getSeriesTitleFromIndex:[dp.xValue integerValue]]
                                                                  andYPosition:dp.yValue
                                                                 withTextColor:CHART_FONT_COLOR
                                                           withBackgroundColor:[UIColor clearColor]];
                    
                    [chart addAnnotation:a];
                    CGRect f = a.label.frame;
                    f.origin.y -= f.size.height/2.f;
                    a.label.frame = f;
                }
            }

#2

No one having problems with the SChartAnnotations on version 2.5 ?


#3

I filled another question earllier today.

Not sure it’s related or even if it’s a bug or a feature.

L