在线显示工具提示

时间:2019-11-04 06:36:19

标签: angular echarts teradata-covalent

我在树图中使用与Teradata共价的apche echarts。我想显示工具提示并在鼠标悬停在树线上时更改线的颜色。

我正在尝试使用树的强调属性,但是它不起作用。强调的属性目前都无法正常工作。请看下面的代码。这是来自Apache Echarts网站的示例,我正在按照此示例创建自己的树。我只是在此处添加了一个强调属性,以查看它是否有效。

myChart.showLoading();
$.get(ROOT_PATH + 'data/asset/data/flare.json', function (data) {
    myChart.hideLoading();

    echarts.util.each(data.children, function (datum, index) {
        index % 2 === 0 && (datum.collapsed = true);
    });

    myChart.setOption(option = {
        tooltip: {
            trigger: 'item',
            triggerOn: 'mousemove'
        },
        series: [
            {
                type: 'tree',

                data: [data],
                emphasis: {
                  lineStyle: {
                      color: 'red'
                  }  
                },

                top: '1%',
                left: '7%',
                bottom: '1%',
                right: '20%',

                symbolSize: 7,

                label: {
                    normal: {
                        position: 'left',
                        verticalAlign: 'middle',
                        align: 'right',
                        fontSize: 9
                    }
                },

                leaves: {
                    label: {
                        normal: {
                            position: 'right',
                            verticalAlign: 'middle',
                            align: 'left'
                        }
                    }
                },

                expandAndCollapse: true,
                animationDuration: 550,
                animationDurationUpdate: 750
            }
        ]
    });
});

0 个答案:

没有答案