I have a dimple graph with th ecode
var svg = dimple.newSvg("#chartContainer", 800, 600);
var myChart = new dimple.chart(svg, data);
myChart.setBounds(120, 30, 750, 550);
var x = myChart.addCategoryAxis("x", "time");
x.showGridlines = true;
x.addOrderRule("time");
var y = myChart.addMeasureAxis("y", "height", null);
//.overrideMax=(max);
y.overrideMin = 0;
y.overrideMax = 1000;
y.tickFormat = "d";
var s = myChart.addSeries("row", dimple.plot.line);
s.lineWeight = 1;
s.lineMarkers = true;
s.addOrderRule(function(n){
console.log('n:', n);
return n.row;
});
myChart.addLegend(0, 0, 900, 100, "left", s);
myChart.draw();
and the legend order is wonky.
the data is in the form
[
},
{
"row": "1",
"height": -1,
"time": 607
},
{
"row": "1",
"height": -11,
"time": 709
},
{
"row": "1",
"height": -22,
"time": 809
},
{
"row": "1",
"height": -32,
"time": 910
},
{
"row": "1",
"height": -42,
"time": 1011
},
{
"row": "1",
"height": -52,
"time": 1113...
].
I'd like the row series to be in order in the legend.
Thanks.