Devank
Devank

Reputation: 159

Google column chart hide annotation for data which has value zero

enter image description here

Below is my data and the series which I am sending to angular google wrapper : https://github.com/angular-google-chart/angular-google-chart

Data : [["Total",48,48,30,30,14,14]] 

Series : ["Event","Registered",{"role":"annotation"},"Participated",{"role":"annotation"},"Offered",{"role":"annotation"}]

Upvotes: 3

Views: 3381

Answers (1)

WhiteHat
WhiteHat

Reputation: 61222

you will need to adjust the data accordingly

based on the Series definition...

Series: [
  "Event",
  "Registered",
  {"role":"annotation"},
  "Participated",
  {"role":"annotation"},
  "Offered",
  {"role":"annotation"}
]

a typical row may look like this...

Row: [
  "Test",  // Event
  40,      // Registered
  "40",    // Registered annotation
  30,      // Participated
  "30",    // Participated annotation
  0,       // Offered
  null     // Offered annotation
]

use null for the annotation when the column value is zero

Upvotes: 4

Related Questions