HanSolo / medusa

A JavaFX library for Gauges
Apache License 2.0
687 stars 129 forks source link

BarSkin and BulletChartSkin draw incorrectly when min value is not zero #173

Closed adrianromero closed 9 months ago

adrianromero commented 5 years ago

Bar skin always draws does not set the origin of the arc bar in the min value but in the zero value. The problem is in the following code line:

https://github.com/HanSolo/Medusa/blob/master/src/main/java/eu/hansolo/medusa/skins/BarSkin.java#L265

The following code line fixes the issue:

double angle = (gauge.getCurrentValue() - gauge.getMinValue()) * angleStep;

adrianromero commented 5 years ago

The same issue with BulletChartSkin. Here the code line with the issue:

https://github.com/HanSolo/Medusa/blob/master/src/main/java/eu/hansolo/medusa/skins/BulletChartSkin.java#L331

And here one possible way to fix it:

double currentValue = gauge.getCurrentValue() - gauge.getMinValue();