novus / nvd3

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

multiBarHorizontalChart does not show xaxis label #2205

Closed Marco-Sulla closed 5 years ago

Marco-Sulla commented 5 years ago

I have this code and label on x axis is not displayed:

          nv.addGraph(function() {
            chart2 = nv.models.multiBarHorizontalChart()
                .x(function(d) { return d.label})
                .y(function(d) { return d.value})
                .showValues(true)           //Show bar value next to each bar.
                .showControls(false)        //Allow user to switch between "Grouped" and "Stacked" mode.
                .showLegend(false)
                .groupSpacing(0.5)
                .valueFormat(d3.format('d'))
            ;

            chart2.yAxis.tickFormat(d3.format('d'));
            chart2.xAxis
                .axisLabel("{{#i18n}}suppliers_num{{/i18n}}")
                .labelFormat;

            d3.select('#chart2 svg')
                .datum([data])
                .transition().duration(250)
                .call(chart2);

            nv.utils.windowResize(chart2.update);

            return chart2;
          });

I use nvd3 version 1.8.6-dev and d3 version 3.5.17

Marco-Sulla commented 5 years ago

Escuse me, I exchanged axes.