当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - FlotCharts how to show values in the series line?

问题描述:

I am studing FlotCharts and I have this chalenge... "to make the value apears near of the points, in the line graphics!"

for example, with "jquery.flot.symbol.js" we can mark that points, I need to put there values too! And always visible!

Like litle labels near the dots!

Is it possible? I did not find info in documentation ou in the examples...

here is how I generate my line, it is fixed to 100, as an example:

// FLAG Line

function seriesData3Flag() {

if (data3.length > 0)

data3 = data3.slice(1);

while (data3.length < totalPoints) {

if (flagGo==1){

instantFlag=200;

flagGo=2

}

else{

instantFlag=1000;

}

instantShowFlag = instantFlag;

data3.push(instantShowFlag);

}

// Zip the generated y values with the x values

var res = [];

for (var i = 0; i < data3.length; ++i) {

res.push([i, data3[i],])

}

return res;

}

and here is how I show the data:

var plot = $.plot("#placeholder", [{data: seriesData1GridLines()}, {data: seriesData2HeartBet()}, {data: seriesData3Flag()}], {

series: {

shadowSize: 0 // Drawing is faster without shadows

},

yaxis: {

min: -50,

max: 250,

color: "#EDC240",

borderColor: "#EDC240"

},

xaxis: {

show: false,

},

grid: {

hoverable: true,

mouseActiveRadius: 30,

}

});

function update() {

plot.setData([{data: seriesData1GridLines()}, {data: seriesData2HeartBet()}, {data: seriesData3Flag()}]);

plot.draw();

setTimeout(update, updateInterval);

}

update();

分享给朋友:
您可能感兴趣的文章:
随机阅读: