Search code examples
iosobjective-cchartsbar-chartios-charts

How to display value over the bar while tap on bar in Bar chart using ios charts?


I am trying to display selected bar value in bubble like this while tap on Bar. I have implemented chartView.drawMarkers = true; as suggested but still while i tap on particular bar its not shows value in bubble as shown in the image.

Please help me i stuck here. My coding language is objective-c not swift


Solution

  • Have you implemented the chart marker and assign it to chart view? Check out ChartsDemo's line chart view controller:

    BalloonMarker *marker = [[BalloonMarker alloc] initWithColor:[UIColor colorWithWhite:180/255. alpha:1.0] font:[UIFont systemFontOfSize:12.0] insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)];
    marker.minimumSize = CGSizeMake(80.f, 40.f);
    _chartView.marker = marker;