2

I'm trying to create a stacked graphs with Dygraphs using "stackedGraph: true". When I have hard copied data to html file, everything works great: exp:

    var gStacked = new Dygraph(
        document.getElementById("Stacked"),
    "X,Y,Z\n"+ 
      "1,3,5\n"+ 
      "2,5,4\n"+ 
      "3,2,7\n",
        {
            title: "Stacked",
            xlabel: 'Date/Time',
            ylabel: 'Messages',
            stackedGraph: true,
            drawCallback: function(g, is_initial) {
                if (!is_initial) return;
                        showHideSeries(9);
             },
        });

when I try to read data from csv file, stackedGraph doesn't work exp:

    var gStacked = new Dygraph(
        document.getElementById("Stacked"),
    "Read.csv", // path to CSV file 
        {
            title: "Stacked",
            xlabel: 'Date/Time',
            ylabel: 'Messages',
            stackedGraph: true,
            drawCallback: function(g, is_initial) {
                if (!is_initial) return;
                        showHideSeries(9);
             },
        });

Any idea? Thanks in advance

mpromonet
  • 11,326
  • 43
  • 62
  • 91
evlahos
  • 41
  • 3

1 Answers1

2

The problem was a var with commonOptions that had stackedGraphs as false. when I commented out this, everything worked great.

evlahos
  • 41
  • 3