hellocharts-android
hellocharts-android copied to clipboard
hello chart 使用 linechart 中 只有一个坐标点如何显示 ????? please Thank you
给LIneChatView设置以下属性:
//set chart data to initialize viewport, otherwise it will be[0,0;0,0]
//get initialized viewport and change if ranges according to your needs.
final Viewport v = new Viewport(chart.getMaximumViewport());
v.left =100;
v.right = 200;
v.top =20;
v.bottom = 0;
chart.setMaximumViewport(v);
chart.setCurrentViewport(v);
//Optional step: disable viewport recalculations, thanks to this animations will not change viewport automatically.
//chart.setViewportCalculationEnabled(false);`
left、right这些都是数值。 如我想要记录体温,就可以写成
v.top =42;
v.bottom = 35;
lecho大神说
chart.setViewportCalculationEnabled(false);
这句视情况而加。我是不加不行。你试一下
我又试了一下,只加
chart.setViewportCalculationEnabled(false);
也可以
我发现一个情况,当只有一个点的时候,如果设 Viewport.right = 0,则这个点显示不出来,要把Viewport.right 设为 1 才可以。
@setsailz 为啥wo'sh我设置的没一点用呢,是顺序问题吗,改了好久还是没用
@dgmltn 为啥没一点效果