Arnaud
Arnaud

Reputation: 5112

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)

Upvotes: 5

Views: 476

Answers (1)

Thomas Karachristos
Thomas Karachristos

Reputation: 3307

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

Upvotes: 3

Related Questions