MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

Scatter shape size treated as pixels, not dp

Open tgvoskuilen opened this issue 3 years ago • 0 comments

Summary The value passed to setScatterShapeSize on ScatterDataSet is not converted from dp to pixels in the shape renderers (e.g. CircleShapeRenderer) so the value is treated as a size in pixels, not dp. The scatter shape hole size, however, is correctly converted from dp to pixels. This is present in all the scatter shape renderers.

Expected Behavior All sizes are in dp (as indicated in comments and documentation).

Possible Solution Convert value from dp to pixels in the scatter shape renderers. e.g. change

final float shapeSize = dataSet.getScatterShapeSize();

to

final float shapeSize = Utils.convertDpToPixel(dataSet.getScatterShapeSize());

in all the renderers.

Device (please complete the following information):

  • Library Version 3.1.0

Additional Context I will submit a PR for this

tgvoskuilen avatar Jan 03 '23 03:01 tgvoskuilen