I have a list of 12 items, but at the start I only want to see the last 6 items on the chart (stacked column chart). I want to be able to scroll / drag to reveal the first part of the list. I use the index of the list for the x-axis, so the list has indexes with range from [0, 11]
I’m having some weird behaviour implementing this.
When the data is loaded, i see the complete bars:
but when I start to scroll, i’m never able to reveal the complete bars anymore:
![Screenshot 2020-09-18 at 11.04.40.png]
![Screenshot 2020-09-18 at 11.04.59.png]
When i start scrolling to the end (although the chart is already at the end), the UI jumps and only shows half a bar. Also when i scroll to the beginning, it only shows half a bar.
How can I make sure I always see the complete bars?
This is the code, specific to the x axis & the scrolling:
val xAxis = sciChartBuilder.newNumericAxis() .withDrawMajorBands(false) .withDrawMajorGridLines(false) .withDrawMinorGridLines(false) .withDrawMinorTicks(false) .withMajorDelta(1.0) .withMinorDelta(0.2) .withAutoTicks(false) .withVisibleRange(5.5, 11.5) .build()
using half values for the range seems to be the only way I can see the full bars. Once I start scrolling I only see half bars at the start & end
val surfaceChartModifiers: ChartModifierCollection = chart.chartModifiers val dragModifier = XAxisDragModifier() dragModifier.dragMode = AxisDragModifierBase.AxisDragMode.Pan surfaceChartModifiers.add(dragModifier) val zoomPanModifier = ZoomPanModifier() zoomPanModifier.clipModeX = ClipMode.ClipAtExtents zoomPanModifier.direction = Direction2D.XDirection zoomPanModifier.zoomExtentsY = false surfaceChartModifiers.add(zoomPanModifier)
Thanks for your feedback! I’ve solved the issue by using GrowBy, now it’s scrolling smooth & correct and I can see the full bars with the following settings:
withGrowBy(1.0 / 24, 1.0 / 24)