nvd3.js - Avoid jumps between non consecutive x axis values with NVD3 and AngularJS (MultiChart) -
i'm trying display multichart (bars , lines in case) using nvd3 , angularjs. x axis have array of numbers represent year , week number (example:201712). problem here that, when graphic displayed, there jumps between different values in x axis. example: there wide jump between last week of 2017 (201753) , first week of 2018 (201800).
to ilustrate problem have replaced original array new 1 contains random values 1 30.
as can see, there jumps between: 2 , 4, 11 , 13, 17 , 23. seems correspond numbers between 1 , 30 not included in array.
i able delete jumps , apply original problem array containing year , week number.
-graphic code:
vm.options = { chart: { type: 'multichart', height: 550, margin: { top: 20, right: 20, bottom: 80, left: 65 }, //color: d3.scale.category10().range(), clipedge: true, duration: 500, stacked: true, xaxis: { axislabel: 'periodo', showmaxmin: false, rotatelabels: 90, axislabeldistance: -20, tickvalues: function (values) { return periodos.map(function (d) { return d }); }, tickformat: function (d) { return d; }, orient: "bottom" }, yaxis1: { tickformat: function (d) { return d3.format(',.1f')(d); } }, reducexticks: false, bars1: { stacked: true }, } };
Comments
Post a Comment