Google柱形图隐藏了值为零

时间:2016-05-04 12:56:39

标签: javascript angularjs charts google-visualization

enter image description here

以下是我的数据以及我发送给有角度的google包装器的系列:  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"}]

1 个答案:

答案 0 :(得分:2)

您需要相应地调整数据

基于Series定义...

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

典型的行可能看起来像这样......

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

当列值为零时使用null作为注释