Skip to content

Commit

Permalink
🐛 Fix horizontal grid lines in LineChart for series with negative val…
Browse files Browse the repository at this point in the history
…ues.
  • Loading branch information
hexawyz committed Apr 24, 2024
1 parent 2109f8e commit ebe9f26
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Exo.Settings.Ui/Controls/LineChart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,9 @@ private static (PathGeometry Stroke, PathGeometry Fill, PathGeometry HorizontalG
var horizontalGridLines = new PathGeometry();
var verticalGridLines = new PathGeometry();

double lineY = scaleMin;
for (int i = 0; i < tickCount; i++, lineY += tickSpacingY)
for (int i = 0; i < tickCount; i++)
{
double y = outputAmplitudeY - lineY * outputAmplitudeY / scaleAmplitudeY;
double y = i * tickSpacingY * outputAmplitudeY / scaleAmplitudeY;
var figure = new PathFigure
{
StartPoint = new(0, y),
Expand Down

0 comments on commit ebe9f26

Please sign in to comment.