echarts 树图属性设置

树图属性自定义
myChart.showLoading();
$.get('data/asset/data/flare.json', function (data) {
    myChart.hideLoading();
 
    echarts.util.each(data.children, function (datum, index) {
        index % 2 === 0 && (datum.collapsed = true);
    });
 
    data.children[0].itemStyle = {
        color : '#0000ff',
        borderColor:'#0000ff'
    };
    data.children[0].lineStyle = {
        color : '#0000ff',
        borderColor:'#0000ff'
    }
 
    myChart.setOption(option = {
        tooltip: {
            trigger: 'item',
            triggerOn: 'mousemove'
        },
        series: [
            {
                type: 'tree',
 
                data: [data],
 
                top: '1%',
                left: '7%',
                bottom: '1%',
                right: '20%',
 
     

猜你喜欢

转载自blog.csdn.net/qq_40295815/article/details/104789323
今日推荐