Search code examples
ios-charts

iOS Charts Cubic Graph Demo - Outside Labels Not working


In the demo project, CubicLineChartViewController

If you change

yAxis.labelPosition = YAxisLabelPositionInsideChart;

to

yAxis.labelPosition = YAxisLabelPositionOutsideChart;

The labels don't show. I have compared notes with the other demos but I can't see what is different that makes this not work.

no labels


Solution

  • I am facing same issue and by changing view port you can find your label is there and visible now.

    Please remove below line from Demo app

    it will work as expected.

    [_chartView setViewPortOffsetsWithLeft:0.f top:20.f right:0.f bottom:0.f];
    

    some how due to this line its moved chart view port so its hiding your labels from charts.

    Hope this will helps to get your Yaxis label back.