0
Under review

CategoryAxis: How to programmatically pan with ColumnSeries question

vac 4 ár síðan • updated by Oystein Bjorke 3 ár síðan 1

I have a PlotView (I'm using Xamarin.Forms) and show a ColumnSeries by using a LinearAxis on the left and a CategoryAxis on the bottom.


The ColumnSeries is displayed correctly. Is there a way to pan the column bars to the left programmatically via code behind (c#)?


Currently I have a fixed number of bars (12). When new data comes in I remove the index 0 from the columnSeries items and add the new one to the end of the list. If I Invalidate the plotView it looks like the bars got slided to the left with one new value added. But this looks very rough because the bars get shifted by 1 bar width.


I want to pan the bars to the left before I add the new value to get a smooth shifting look. Is there a way to do this by panning the
categoryAxis somehow in code behind?


Thanks! :-)

Under review

It should be possible to call the Pan method of the axis, then invalidate the PlotModel.

https://github.com/oxyplot/oxyplot/blob/develop/Source/OxyPlot/Axes/Axis.cs#L942

https://github.com/oxyplot/oxyplot/blob/develop/Source/OxyPlot/PlotModel/PlotModel.cs#L804

Note that you need to work in screen coordinates when doing this...