How to Increase size of Radar Chart MPAndoid Chart?

独自空忆成欢 提交于 2020-01-14 12:59:00

问题


I want to increase size of MPAndroid Radar Chart. I observed that the size increases gradually when i increase size of the chart itself, but I want the area to be same just Chart size should be increased.

After adding following code:

mChart.setScaleY(1.2f);
mChart.setScaleX(1.2f);

it is getting displaced


回答1:


I think we can use a little hack to do that.I never worked on radar chart but if it supports zoom then we may zoom it when we create it to fit to our requirements. Again you have to test it I am not sure if it will work. Its just an idea. If you did that in my purposed way please do let me know.

Zooming (programmatically)

zoomIn(): Zooms in by 1.4f, into the charts center.

zoomOut(): Zooms out by 0.7f, from the charts center.

zoom(float scaleX, float scaleY, float x, float y): Zooms in or out by the given scale factor. x and y are the coordinates (in pixels) of the zoom center. Remember that a scale of 1f = no zoom.

zoom(float scaleX, float scaleY, float xValue, float yValue, AxisDependency axis): Zooms in or out by the given scale factor. xValue and yValue are the actual data values (not pixels) of the zoom center. Remember that a scale of 1f = no zoom.



来源:https://stackoverflow.com/questions/47090070/how-to-increase-size-of-radar-chart-mpandoid-chart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!