1
我已經解決了這個問題。我應該更仔細地閱讀API文檔。在所有生產線上強制使用相同的顏色
我有15個不同的等值線繪製線條,它們都必須#FF0000
/紅色。他們都有紅色,但他們有一個稍微更暗,更輕的變體。
選項對象:
var options = {
series: {
points: {
show: true,
radius: 5,
symbol: "circle",
fill: true,
color: ('#00FF00')
},
lines: {
editable: false,
hoverable: false,
clickable: false,
color: ("#FF0000")
}
},
yaxes: [ {
position: "left",
min: 0, max: 60,
tickSize: 4,
//color: 'transparent'
} ],
xaxes: [ {
position: "bottom",
min: 7.00, max: 7.80,
//color: 'transparent'
} ],
grid: {
backgroundColor: "white",
editable: true,
hoverable: false,
clickable: false
},
legend: {
position: "nw"
},
colors: ['#FF0000'],
};
數據對象:
var data = [
{ data: line10, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line15, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line20, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line25, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line30, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line35, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line40, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line50, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line60, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line70, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line80, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line90, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line100, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line110, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: line120, lines: { show: true, lineWidth: 2 }, points: { show: false }, editable: false, clickable: false, hoverable: false },
{ data: startPoint, lines: { show: true }, points: { show: true }, editable: true, editMode: 'xy', color: '#00FF00' },
];
的Flot.js
API文檔指出以下:
如果有更多的數據序列比色,海軍報將嘗試通過增亮和減淡主題中的顏色來產生額外的顏色。
是否可以將此選項設置爲false或強制設置顏色?