dygraph 设置 x 轴最大值并更新 dygraph

dygraph set x axis max value and update the dygraph

绘制后尝试设置 dygraph 的 x 轴最大值。 尝试过

axes = g.axes_;
axes.maxxval = maxVal;
g.updateOptions({
 axes
});

您想设置 valueRange property. See this demo

g.axes_ 中的尾随 _ 表示它是私有内部 属性。弄乱它不会有任何好处。