【问题标题】:stacked graphs with Dygraphs带有 Dygraphs 的堆叠图
【发布时间】:2017-02-17 05:19:37
【问题描述】:

我正在尝试使用“stackedGraph:true”创建带有 Dygraphs 的堆叠图。 当我将数据硬复制到 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);
             },
        });

有什么想法吗? 提前致谢

【问题讨论】:

  • 你的JS控制台有错误吗?这通常表明您的 Web 服务器的配置方式会阻止为 Read.csv 提供服务。
  • 如果问题解决了,请将解决方案作为答案发布
  • 感谢您的回答

标签: dygraphs stacked


【解决方案1】:

问题是带有 commonOptions 的 var 将 stackGraphs 设置为 false。当我评论这一点时,一切都很好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-17
    • 2018-09-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-06
    • 2013-11-04
    相关资源
    最近更新 更多