您可以使用 更改点的颜色pointFillColors。
以及带 的点周围圆圈的颜色pointStrokeColors。
例如:
pointFillColors: ['grey', 'red'],
pointStrokeColors: ['black', 'blue'],
Run Code Online (Sandbox Code Playgroud)
如果要更改特定点,则必须修改 Morris。
您还可以设置goals为特定值绘制一条线。
我扩展了 Morris 并添加了以下参数:checkYValues, yValueCheck, yValueCheckColor.
用法:
checkYValues: "eq" // Possible values: eq (equal), gt (greater than), lt (lower than)
yValueCheck: 3 // A value to check
yValueCheckColor: "pink" // A color to draw the point
Run Code Online (Sandbox Code Playgroud)
pointFillColors: ['grey', 'red'],
pointStrokeColors: ['black', 'blue'],
Run Code Online (Sandbox Code Playgroud)
checkYValues: "eq" // Possible values: eq (equal), gt (greater than), lt (lower than)
yValueCheck: 3 // A value to check
yValueCheckColor: "pink" // A color to draw the point
Run Code Online (Sandbox Code Playgroud)