gmmoraesbr / flot

Automatically exported from code.google.com/p/flot
0 stars 0 forks source link

Threshold corrupts bar charts #348

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If I apply a threshold to a dataset with bars: {show:true} the data
displays incorrectly - bars extend to the top of the chart, and if lines
are set to show, they extend from the left side of the chart. Appears data
is being corrupted by the application of a threshold to a bar chart.

If I change bars: {show:false} everything appears correctly.

Code that's producing this:

function plotWithOptions(t) {
    $.plot($("#placeholder"), [
        { label: "Variance",
            data:variance,
            color: "rgb(240,240,240)",
            yaxis:2,
            bars: { show: true, fill:true, lineWidth:10 },
            lines: {show:false},
            points: {show:false},
            threshold: { below: 0, color: "rgb(200, 20, 30)" }

        },
        { label: "data1", data: data1},
        { label: "data2", data:data2}
        ],
           {series: {lines: { show: true },points: { show: true }},
        grid: { hoverable: true, clickable: true },
        xaxis: { mode: "time"},
        yaxis: {min:0},
        y2axis: {}
           }
    );
    }
plotWithOptions(0);

Original issue reported on code.google.com by graemeh%naturalpower.com@gtempaccount.com on 12 May 2010 at 9:12

GoogleCodeExporter commented 8 years ago
The  attached file should fix the threshold with barcharts. I did not get the 
normal threshold to work, so I tried this one. This one did work, but created 
threshold datapoints, which I wanted removed if the dataseries is of type bars.

I did not create this patch, but I fixed it for my barcharts. I was posted here 
on some other issue/enhancement.

Original comment by gerbert....@gmail.com on 10 Oct 2010 at 8:38

Attachments:

GoogleCodeExporter commented 8 years ago
I suspect the issue described is the same that I've come across. It seems that 
when using the threshold plugin it corrupts the datapoint set by not respecting 
the datapoint format.

I managed to hunt down the issue to two little lines and have provided a diff. 
This fixed it for me when using stepped lines with fills and bar charts.

Original comment by kaarlenk...@gmail.com on 30 Mar 2011 at 10:54

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the patch. I changed it to start from m = 2, and it seems to be 
working fine.

Original comment by olau%iol...@gtempaccount.com on 4 Apr 2011 at 11:34