subhrajitroy/Flot-plugin — Issue #5: Spurious bars created when used with bar chart
Author: ukch
Created: 2011-12-15 11:31:00+00:00
State: open

I am using the following code to generate a bar chart whose negative values are black:

```javascript
$(function() {
var data = [[0, 1], [1, 3], [4, 2], [3, 6], [2, -3], [5, -7], [6, -2],
[7, 6]];
var ticks = [[0, "a"], [1, "c"], [2, "b"], [3, "e"], [4, "d"],
[5, "g"], [6, "f"], [7, "h"]];
var options = {"colors": ["#1f77b4"], "legend": {"show": true},
"xaxis": {"tickColor": "#DDDDDD", "ticks": ticks,
"tickLength": 0},
"yaxis": {"tickColor": "#DDDDDD"}};

$.plot($("#placeholder"),
[{"bars": {"align": "center", "fill": 1, "barWidth": 0.9,
"show": true},
"constraints": [{threshold: 0, color: "#000000",
evaluate: function(y, threshold) {
return y <= threshold}}],
"data": data}],
options);
});
```

The end result has 2 strange bars added, of size 0, as seen here:
![Screenshot #1](http://i43.tinypic.com/14wqgkx.png)

If we change the threshold to 2, this becomed much more apparent:
![Screenshot #2](http://i39.tinypic.com/jacgpg.png)