Hello,
I am now faced with a problem. No method, except moveViewTo, allows to move on the X axis to go to the last element not centered on the view.
I want to show the last element like this:
|. ------------- . . o|
Where o is the last element.
How I can do this?
Thanks.
seems duplicated to more generic feature moveViewToX, take a look at #450 and #468, and perhaps you can use ChartTransformer, discussed in #226, though it discusses zoom and scale, but there is some useful APIs to manipulate the matrix so you can display I think.
So, For the next people with this problem, you can resolve this issue like this:
NSInteger count = [self.lineChartView.data.dataSets[0].yVals count];
ChartDataEntry *entry = self.lineChartView.data.dataSets[0].yVals[count-1];
[self.lineChartView centerViewToXIndex:count-1 yValue:entry.value axis:AxisDependencyLeft];
This worked for me.
I think it should be a feature...
Did you write centerViewToXIndex? I don't see it right now. It will be great if you could create a PR for this if you think it's helpful to others.
No, centerViewToXIndex is an instance method of BarLineChartViewBase
I'll will se for the PR.
It does not exists, so you actually write it. You could file a PR if you like to!