11

I draw a multibarChart using nvd3 library and it 's working very well but it gives me two radio buttons to choose wether i want stacked bars or grouped bars.

Can i disable this and make it only show grouped bars?

This is the javascript code :

nv.addGraph(function() {
    var chart = nv.models.multiBarChart();

    chart.xAxis.tickFormat(d3.format(',f'));

    chart.yAxis.tickFormat(d3.format(',.1f'));
    var x = data();
    d3.select('#chart svg').datum(data()).transition().duration(500).call(chart);

    nv.utils.windowResize(chart.update);

    return chart;
});
shabeer90
  • 5,161
  • 4
  • 47
  • 65
Amr Kamel
  • 432
  • 6
  • 16

1 Answers1

29

The code below will show you bars in a Grouped manner while hiding the controls to the flip between Stacked/Grouped

var chart = nv.models.multiBarChart().stacked(false).showControls(false);

Hope it helps.

shabeer90
  • 5,161
  • 4
  • 47
  • 65