我正在尝试使用 Dygraphs 使用“stackedGraph: true”创建堆叠图。 当我将数据硬复制到 html 文件时,一切都很好: 经验:
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); }, });
当我尝试从 csv 文件读取数据时,stackedGraph 不起作用 经验:
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); }, });
有什么想法吗? 提前致谢
最佳答案
问题是 commonOptions 的 var 的 stackedGraphs 为 false。当我注释掉这一点时,一切都很好。
关于dygraphs - 带 Dygraphs 的堆叠图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42157044/