You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
thanks for this perfect chart library.
i have a small problem , in first time render chart labels are very close.
how i can set zoom manually in startup ?
i found this method , but dose not work
chart.zoom(0,0, -20);
The text was updated successfully, but these errors were encountered:
Hi,
you are right, there was a problem with Chart.zoom() method, it didn't work for values below 0 and above 1.
I rewrote that method into new one Chart.setZoomLevel() and it's now in master branch. Let me know if that helps.
/** * Programatically zoom chart to given point(viewport point). Call this method after chart data had been set. * * @param x * x within chart maximum viewport * @param y * y within chart maximum viewport * @param zoomLevel * value from 1 to maxZoom(default 14). 1 means chart has no zoom, 14 means chart has maximum zoom. * @param isAnimated * set true if zoom should be animated. */publicvoidsetZoomLevel(floatx, floaty, floatzoomLevel, booleanisAnimated);
Now you can zoom like that:
//set chart data firstchart.setLineChartData(yourData);
//zoom, in this example without animationchart.setZoomLevel(chart.getMaximumViewport.centerX, chart.getMaximumViewport.centerY, newZoomLevel, false);
So zoom should now work but I'm still not sure if this will solve your problem. Long labels are hard and slow to handle.
If you want to separate labels for X axis use axis.setMaxLabelChars() method.
Btw. you cannot zoom out beyond max viewport with Chart.setZoomLevel() method but you can change max viewport with Chart.setMaximumViewport() method.
Hi
thanks for this perfect chart library.
i have a small problem , in first time render chart labels are very close.
how i can set zoom manually in startup ?
i found this method , but dose not work
The text was updated successfully, but these errors were encountered: