novus / nvd3

A reusable charting library written in d3.js
http://nvd3.org/
Other
7.22k stars 2.14k forks source link

Y axes are weird with different x-axis values #2229

Open kaankilic opened 3 years ago

kaankilic commented 3 years ago
const tickValues = val.series[0].values.map((o,i)=>o.x/1000);  // something like["0.10","0.20"] etc.
            nv.addGraph(() => {
                var height = 300;
                var chart = nv.models.multiChart().legendRightAxisHint("").useInteractiveGuideline(true).showLegend(false).height(height);
                chart.options({
                    hideY2:true
                });
                chart.xAxis.axisLabel('Date').tickValues(tickValues).tickFormat(function(d) {
                    return d3.time.format('%x')(new Date(d))
                });
                chart.yAxis1.axisLabel('Orders').tickFormat(d3.format('.02f'));
                chart.yAxis2.tickFormat(d3.format('.02f'));
                //              chart.yAxis2.tickFormat(d3.format('.02f'));
                this.redraw(chart)
                this.chartRef = chart
            });

MAzWN