From b91168b09250ffeb879645ab6bfda1898059083c Mon Sep 17 00:00:00 2001 From: Kerry Bisset Date: Sat, 4 Feb 2023 14:22:12 -0600 Subject: [PATCH] fix: Updated the xOffset so that when you change the step size in the X-axis the graph scales correctly. --- plot/src/main/java/com/madrapps/plot/line/LineGraph.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plot/src/main/java/com/madrapps/plot/line/LineGraph.kt b/plot/src/main/java/com/madrapps/plot/line/LineGraph.kt index 16ff880..ae9c046 100644 --- a/plot/src/main/java/com/madrapps/plot/line/LineGraph.kt +++ b/plot/src/main/java/com/madrapps/plot/line/LineGraph.kt @@ -126,7 +126,7 @@ fun LineGraph( onDraw = { val xLeft = columnWidth.value + horizontalGap.toPx() val yBottom = size.height - rowHeight.value - val xOffset = 20.dp.toPx() * xZoom.value + val xOffset = plot.xAxis.stepSize.toPx() * xZoom.value val maxElementInYAxis = getMaxElementInYAxis(yAxisScale, plot.yAxis.steps) val yOffset = ((yBottom - paddingTop.toPx()) / maxElementInYAxis) * globalYScale