2015-04-04 32 views
3

非常简单的问题,只要我使用setseries数据的可见性我的饼图不再可见。我已经检查了阴谋对象并且系列被正确地更新了,但是因为我没有在阴谋对象中的任何地方发现可见性属性,所以我不知所措。 没有zingcharts文档和适当的例子也没有帮助。我相当肯定这是一个简单的方案来解决,但我一直无法这样做。zingchart setseriesdata能见度问题

zingchart.exec('organismplot', 'setseriesdata', { 
     "data": [ 
      { 
       "values":data_update.organisms, 
       "text":"active", 
       "background-color":"#2d4962", 
       "border-width":"1px", 
       "shadow":0, 
       "visible":1 
      }, 
      { 
        "values":(data_update.totalorganism-data_update.organisms), 
        "text":"passive", 
        "background-color":"#2d4962", 
        "border-width":"1px", 
        "shadow":0, 
        "visible":0 
     }] 

回答

3

我是ZingChart团队的成员,我很乐意帮助您!

什么是data_update.organisms和data_update.totalorganism-data_update.organisms的类型?确保传递单个元素数组,或者如果这些数组只是单个值,请将括号中的变量包装为“values”属性创建单个值数组。例如: -

"data": [ 
     { 
      "values":[data_update.organisms], // If data_update.organisms is a single value. 
      "text":"active", 
      "background-color":"#2d4962", 
      "border-width":"1px", 
      "shadow":0, 
      "visible":1 
     }, 
     { 
       "values":[data_update.totalorganism-data_update.organisms], // Again, single value array. 
       "text":"passive", 
       "background-color":"#2d4962", 
       "border-width":"1px", 
       "shadow":0, 
       "visible":0 
     } 
] 

我创建使用您的具体方法调用演示,但我已经改变了“值”属性使用单个值阵列,这是需要的饼图。看看演示here

我希望有帮助。让我知道你是否需要更多帮助!