Hi,
I'm wondering if it's possible to show the actual data values in place of the marker icons. Or to show data labels next to the bars in a bar chart, I guess.
Something like the attached image.
Thanks!
Placing the axis labels directly on top of the plotted point not currently a feature. There are several different location enumerations for axis labels, which can be set using the labelsLocation which is found on the axis. Below are the available enumerations:
Ok. That's what I figured, but was hoping maybe I just missed something.
Thanks
I actually just solved this problem, which leads to a different issue:
But if you want to place markers beside the bar at the end of it, you could do so with this:
- (UIView *)chartView:(IGChartView *)chartView viewForMarkerInSeries:(IGSeries *)series withItem:(NSObject *)item index:(NSInteger)index originalSourceItem:(NSObject *)originalSourceItem displayOptions:(IGMarkerDisplayOptions *)options{ IGCategoryPoint* p = (IGCategoryPoint*)item; if (p.value == 0) return nil; UILabel* v = [[UILabel alloc] initWithFrame:CGRectZero]; [v setBackgroundColor:[UIColor clearColor]]; [v setText:[NSString stringWithFormat:@"%.0f",p.value]]; [v setTextAlignment:NSTextAlignmentRight]; [v sizeToFit];
CGRect f = [v frame]; f.size.width = (f.size.width * 2) + 10; [v setFrame:f]; return v; } } return nil;}
I essentially make a UILabel thats twice as wide as I need it, and place that. Since it naturally wants to place the label on the border of the bar, this makes sure that it will always be beside it.
My problem now, the highest value's marker tends to get clipped.