Jquery flot scores 200%, believes that the value is 100%

I use the fleet library to draw a chart. this is my code:

function LoadService2() { $.getJSON('http://localhost:4025/vmp_webservice.asmx/LoadService2', { fromDate: "2014-01-01", toDate: "2014-04-01" }) .done(function (result) { var data = $.map(result, function (arr, key) { return { label: key, data: arr }; }); chartOptions = { xaxis: { min: (new Date(2014, 01, 1)).getTime(), max: (new Date(2014, 04, 2)).getTime(), mode: "time", tickSize: [1, "month"], monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], tickLength: 0 }, yaxis: { }, series: { stack: true, lines: { show: true, fill: true, lineWidth: 3 }, points: { show: false, radius: 4.5, fill: true, fillColor: "#ffffff", lineWidth: 2.75 } }, grid: { hoverable: true, clickable: false, borderWidth: 0 }, legend: { show: true }, tooltip: true, tooltipOpts: { content: '%s: %y' }, colors: App.chartColors }; var holder = $('#stacked-area-chart'); if (holder.length) { $.plot(holder, data, chartOptions); } }) } 

and this is the input:

 { "default": [ [ 1390608000000.0, 0.0 ], [ 1390780800000.0, 0.0 ], [ 1391040000000.0, 0.0 ], [ 1391558400000.0, 0.0 ], [ 1392249600000.0, 0.0 ], [ 1392595200000.0, 0.0 ], [ 1392681600000.0, 0.0 ], [ 1392854400000.0, 0.0 ], [ 1393286400000.0, 0.0 ], [ 1393891200000.0, 0.0 ], [ 1394064000000.0, 0.0 ], [ 1394236800000.0, 0.0 ], [ 1394323200000.0, 0.0 ], [ 1394841600000.0, 0.0 ], [ 1394928000000.0, 0.0 ], [ 1395014400000.0, 0.0 ], [ 1395100800000.0, 0.0 ], [ 1395273600000.0, 0.0 ], [ 1395446400000.0, 0.0 ], [ 1395619200000.0, 0.0 ], [ 1395705600000.0, 0.0 ], [ 1395878400000.0, 0.0 ], [ 1396137600000.0, 0.0 ] ], "direct": [ [ 1390608000000.0, 0.0 ], [ 1390780800000.0, 0.0 ], [ 1391040000000.0, 0.0 ], [ 1391558400000.0, 0.0 ], [ 1392249600000.0, 0.0 ], [ 1392595200000.0, 0.0 ], [ 1392681600000.0, 0.0 ], [ 1392854400000.0, 0.0 ], [ 1393286400000.0, 100.0 ], [ 1393891200000.0, 0.0 ], [ 1394064000000.0, 0.0 ], [ 1394236800000.0, 0.0 ], [ 1394323200000.0, 0.0 ], [ 1394841600000.0, 0.0 ], [ 1394928000000.0, 0.0 ], [ 1395014400000.0, 0.0 ], [ 1395100800000.0, 0.0 ], [ 1395273600000.0, 0.0 ], [ 1395446400000.0, 0.0 ], [ 1395619200000.0, 0.0 ], [ 1395705600000.0, 0.0 ], [ 1395878400000.0, 0.0 ], [ 1396137600000.0, 0.0 ] ], "Sales": [ [ 1390608000000.0, 100.0 ], [ 1390780800000.0, 100.0 ], [ 1391040000000.0, 100.0 ], [ 1391558400000.0, 100.0 ], [ 1392249600000.0, 100.0 ], [ 1392595200000.0, 0.0 ], [ 1392681600000.0, 75.0 ], [ 1392854400000.0, 100.0 ], [ 1393286400000.0, 100.0 ], [ 1393891200000.0, 100.0 ], [ 1394064000000.0, 0.0 ], [ 1394236800000.0, 100.0 ], [ 1394323200000.0, 0.0 ], [ 1394841600000.0, 100.0 ], [ 1394928000000.0, 66.666666 ], [ 1395014400000.0, 0.0 ], [ 1395100800000.0, 100.0 ], [ 1395273600000.0, 0.0 ], [ 1395446400000.0, 0.0 ], [ 1395619200000.0, 0.0 ], [ 1395705600000.0, 0.0 ], [ 1395878400000.0, 100.0 ], [ 1396137600000.0, 100.0 ] ] } 

I got this result:

enter image description here

there are 200% of the values, although the input does not have this value

more strange

when I was pointing at the diagrams at this point, the graph told me that the value is 100%, although it draws it as 200%.

help me please

when I delete the dates of the yellow bar, the graphs become correct

How to solve it please?

+1
javascript jquery flot
source share
1 answer

You stack your charts

 ... series: { stack: true, ... 

Try setting the stack to false:

 ... series: { stack: false, ... 

It’s a little difficult to say, since the documentation from the fleet about their options is not ideal, but it can help.

+3
source share

All Articles