Can I combined stacked line/area graphs with non-stacked ones?

Martynas Majeris -

Yes, absolutely.

To prevent the line graph from stacking with another graphs on a stacked line/area chart, just set its "stackable" property to false. I.e.:

graph.stackable = false;

The above works for both regular JavaScript Charts and JavaScript Stock Charts

Have more questions? Submit a request

Comments

  • Avatar
    MIka

    Is really "stackable" property working for JavaScript Stock Charts?

    It is not working in my source.May I have any mistakes?


    // PANELS ///////////////////////////////////////////

    var stockPanel = new AmCharts.StockPanel();

    stockPanel.recalculateToPercents = "never";

    stockPanel.fontSize = 10;

    var valueAxis = new AmCharts.ValueAxis();

    valueAxis.stackType = "regular";

    stockPanel.addValueAxis(valueAxis);

    var graph = new AmCharts.StockGraph();

    graph.valueField = "value";

    graph.comparable = true;

    graph.compareField = "value";

    graph.fillAlphas = 1;

    graph.compareGraphFillAlphas = 1;

    graph.connect = false;

    stockPanel.addStockGraph(graph);

    var thregraph = new AmCharts.StockGraph();

    thregraph.valueField = "value11";

    thregraph.visibleInLegend = false;

    thregraph.stackable = false;

    thregraph.comparable = true;

    thregraph.compareField = "value11";

    thregraph.connect = false;

    stockPanel.addStockGraph(thregraph);


Powered by Zendesk