【问题标题】:Maximal values of axes in a GraphViewGraphView 中轴的最大值
【发布时间】:2018-12-04 15:25:34
【问题描述】:

我有以下代码:

LineGraphSeries<DataPoint> series = new LineGraphSeries<>(arr);
                graphView.addSeries(series);
                graphView.getViewport().setMaxX(31);
                graphView.getViewport().setMaxY(150);
                graphView.getViewport().setMinX(1);
                graphView.getViewport().setMinY(0);

我需要通过这段代码设置轴的最大值和最小值,但是当我运行程序时,我有这个值:

怎么了?

【问题讨论】:

    标签: java android graph android-graphview


    【解决方案1】:

    来自javadoc

    确保通过 setYAxisBoundsManual(boolean) 将 y 边界设置为手动

    所以你还必须添加

    graphView.getViewport().setYAxisBoundsManual(true);
    graphView.getViewport().setXAxisBoundsManual(true);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-16
      • 1970-01-01
      • 1970-01-01
      • 2023-01-27
      相关资源
      最近更新 更多