3
如何在同一個絮圖中顯示兩個數據系列,當一個系列是一組點時,一個是一條線?在單個地圖上顯示點的數據集和線的數據集?
我已經seen examples of line series like this,但是複雜的因素是我想在同一個圖上顯示數據點和數據線。
這似乎是一個相當常見的用例 - 基本上我想顯示一個散點圖及其最適合的線。
目前我有
var options = {
series: {
lines: {
show: false
},
points: {
show: true
},
lines: {
show: true
}
},
grid: {
hoverable: true,
},
yaxis: {
min: 0,
max: 1100000,
font: 'Georgia'
},
xaxis: {
min: 10,
max: 480,
font: 'Georgia'
}
};
var plot = $.plot($("#placeholder"),
[{
data: scatterdata,
color: 'dodgerblue',
}], options);
var line = $.plot($("#placeholder"),
[{
data: linedata,
color: 'black',
}], options);
但這僅顯示第二組數據,而不是兩個都。