1

我有 X 轴的这些标签:

1..2..3..4..5..6..等

但我需要自定义订单:

3..2..5..1..6..4..等

即使我以这种自定义顺序将数组提供给 d3,它也会像第一个示例一样自动对其进行排序。

我正在使用nv.models.lineChart().

我的价值观的确切转储:

[{"values":[{"label":18,"value":12},{"label":19,"value":412},{"label":20,"value":441},{"label":21,"value":920},{"label":22,"value":944},{"label":23,"value":144},{"label":0,"value":0},{"label":1,"value":18},{"label":2,"value":0},{"label":3,"value":7},{"label":4,"value":4},{"label":5,"value":12},{"label":6,"value":0},{"label":7,"value":0},{"label":8,"value":0},{"label":9,"value":9},{"label":10,"value":9},{"label":11,"value":32},{"label":12,"value":27},{"label":13,"value":31},{"label":14,"value":0},{"label":15,"value":30},{"label":16,"value":3},{"label":17,"value":844}],"key":"Buyings count hourly","color":"#53d488"}]

4

0 回答 0