medusa icon indicating copy to clipboard operation
medusa copied to clipboard

BarSkin and BulletChartSkin draw incorrectly when min value is not zero

Open adrianromero opened this issue 5 years ago • 1 comments

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 avatar Jul 10 '19 06:07 adrianromero

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();

adrianromero avatar Jul 11 '19 06:07 adrianromero