首页 新闻 会员 周边 捐助

echarts 矩形树图 ajax、 json

0
悬赏园豆:50 [已关闭问题] 关闭于 2016-10-14 09:48

   {
                    name: '',
                    value: ,
                    itemStyle: {
                        normal: {
                            label: {
                                show: true,
                                formatter : "{b}最多",
                                x: 60,
                                y: 65,
                                textStyle: {
                                    color: '#ccc',
                                    fontSize: 16
                                }
                            },
                            color: '#ccff99',
                            borderWidth: 1
                        },
                        emphasis: {
                            label: {
                                show: true,
                                formatter : "{b}-{c}",
                                x: 80,
                                y: 85,
                                textStyle: {
                                    color: 'red',
                                    fontSize: 18
                                }
                            },
                            color: '#cc9999',
                            borderWidth: 3,
                            borderColor: '#999999'
                        }
                    },
                   
                            children: [
                                {
                                    name: '',
                                    value: 
                                },
                                {
                                    name: '',
                                    value: 
                                },
                                {
                                    name: '',
                                    value: 
                                }
                            ]
                        }
                      
                        
                    ]
                }

需要给上面的 name    value   赋值    

求大神指教   

 

绝世武神的主页 绝世武神 | 初学一级 | 园豆:6
提问于:2016-10-13 16:10
< >
分享
所有回答(2)
0

json数组数据,多个name value 都赋值??

~扎克伯格 | 园豆:1923 (小虾三级) | 2016-10-13 16:21

是的  !我不知道后台封装数据时  拼个字符串   还是 直接把数据传过去

支持(0) 反对(0) 绝世武神 | 园豆:6 (初学一级) | 2016-10-13 16:24
0

后台只要序列化 children 这个对应的值就好了 前台的写死 。

children 类的设计 

public class ChildrenItem
{
    /// <summary>
    /// 
    /// </summary>
    public int name { get; set; }
    /// <summary>
    /// 
    /// </summary>
    public int value { get; set; }
}

public class Root
{
    /// <summary>
    /// 
    /// </summary>
    public List <ChildrenItem > children { get; set; }
}

序列化 返回或者js在js里面手动构建

s_p | 园豆:140 (初学一级) | 2016-10-13 17:05
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册