2015-04-04 59 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

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