-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I am using the following code to generate a bar chart whose negative values are black:
$(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:
If we change the threshold to 2, this becomed much more apparent:
Metadata
Metadata
Assignees
Labels
No labels