将第二个折线图添加到FLOT图表

I loading value from mysql database, 64000005E5CBCD28 it is value of temperature from sensor

$dataset1[] = [(1000*strtotime($row['DATETIME'])),$row['64000005E5CBCD28']];

thereafter

var dataset1 = <?php echo json_encode($dataset1); ?>;

and this command make chart, for one line, my code works well.

$.plot($("#placeholder"), [ dataset1 ], options);

So, how to add next line chart, like a dataset2-second sensor? My try, multiply everything not work.

$dataset2[] = [(1000*strtotime($row['DATETIME'])),$row['57852725725779']];
var dataset2 = <?php echo json_encode($dataset2); ?>;
$.plot($("#placeholder"), [ dataset2 ], options);
dragonfly9527
dragonfly9527 谢谢,它有效!
4 年多之前 回复
doushao8399
doushao8399 默认值为$.plot($(“#placeholder”),[dataset1,dataset2],options);如果不这样做,请提供完整的代码和数据格式。
4 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问