draw only grouped multibar chars using nvd3
Asked Answered
L

1

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;
});
Lustful answered 5/8, 2013 at 13:26 Comment(1)
Did the answer work ?Shady
S
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.

Shady answered 5/8, 2013 at 13:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.