减小 Y 轴的步长

Decreasing the stepsize of Y Axis

有没有办法设置图表的YSTEP?

我们正在尝试显示包含以下数据的图表

g = new Dygraph(
    document.getElementById("graph"),
            [
                 [1,10,10],
                 [2,20.11,20],
                 **[3,10.111,10]**,
                 [4,20,20]],
            {labels: [ "x", "A", "B" ]});

但输出四舍五入为 0.01,我们得到

g = new Dygraph(
    document.getElementById("graph"),
            [
                 [1,10,10],
                 [2,20.11,20],
                 **[3,10.11,10]**,
                 [4,20,20]],
            {labels: [ "x", "A", "B" ]});

如何更正?

您想将 digitsAfterDecimal 选项设置为 3(默认为 2):

g = new Dygraph(
    document.getElementById("graph"),
            [
                 [1,10,10],
                 [2,20.11,20],
                 [3,10.111,10],
                 [4,20,20]],
            {
              labels: [ "x", "A", "B" ],
              digitsAfterDecimal: 3
            });