gpt4 book ai didi

visibility - zingchart setseries数据可见性问题

转载 作者:行者123 更新时间:2023-12-01 23:45:34 25 4
gpt4 key购买 nike

非常直接的问题,一旦我使用 setseries 数据,我的饼图的可见性就不再可见。我已经检查了绘图对象并且该系列已正确更新,但是由于我在绘图对象的任何地方都找不到可见性属性,所以我不知所措。缺少 zingcharts 文档和适当的示例也无济于事。我相当确定这是一个需要解决的简单场景,但我一直做不到。

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
}]

最佳答案

我是 ZingChart 团队的一员,很乐意为您提供帮助!

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

"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 .

希望对您有所帮助。如果您需要更多帮助,请告诉我!

关于visibility - zingchart setseries数据可见性问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29449690/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com