javascript - 谷歌折线图 : dashed section

标签 javascript charts google-visualization

是否可以仅将 Google 折线图的一部分设置为虚线?像这样:

enter image description here

有一个 certainty Angular 色可以实现这一点,但至少有两个段,因为“两个数据点之间的段是确定的,当且仅当两个数据点都是确定的”(见 https://developers.google.com/chart/interactive/docs/roles#what-roles-are-available )

最佳答案

有一种方法,但不仅仅是官方解决方案,here是一个例子:

 data.addColumn({type:'boolean',role:'certainty'}); // certainty col.

      data.addRows([
        [1,  41.8, true],
        [2,  32.4, true],//duplicate this
        [2,  32.4, false],
        [3,  25.7, true],
        [4,  10.5, true],
        [5,  10.4, true],
        [6,  7.7, true],
        [7,  9.6, true],
        [8,  10.6, true],
        [9,  14.8, true],
        [10, 11.6, true],
        [11, 4.7, true],
        [12, 5.2, true],
        [13, 3.6, true],
        [14, 3.4, true]
      ]);

enter image description here

关于javascript - 谷歌折线图 : dashed section,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36793014/

相关文章:

javascript - 在单独的文件中使用 Sequelize 创建模型并在您的项目中使用它们

javascript - for 循环后解析数组后未定义

ios - 无法让图表对象在自定义 UIView 中工作

silverlight - 谁能告诉我 "dataviz"是什么?

javascript - Google 图表在页面刷新时加载

javascript - 如何从 "Google Chart"arrayToDataTable 上的 html 标签添加数据?使用javascript

api - 如何在 Google API Linechart 中格式化数字?

javascript - 使用javascript重定向到当前域之外

javascript - jquery追加到未知的 parent

c# - 滚动时图表宽度移动