Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Line Chart: dashed section

Is it possible to style just one segment of a Google Line Chart as a dashed line? Like this:

enter image description here

There is a certainty role that can achieve that but with at least two segments, because "the segment between two data points is certain if and only if both data points are certain" (See https://developers.google.com/chart/interactive/docs/roles#what-roles-are-available)

like image 903
Arnaud Avatar asked Oct 18 '22 11:10

Arnaud


1 Answers

There is a way but is more than hack that an official solution, here is an example:

 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

like image 140
Thomas Karachristos Avatar answered Oct 27 '22 12:10

Thomas Karachristos