图表。如何在标题上加上宽度?

时间:2018-10-31 10:01:58

标签: echarts

我需要按照documentation的规定限制echarts标题的宽度。 我设置了丰富的textStyle,因为必须应用宽度但不能正常工作。

在此示例中,我使用了经过修改的echarts演示。尽管宽度设置为20%,但图例的标题仍会重叠。

option = {
    title: {
    text: "{aaa|Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}",
        textStyle: {
            width: '20%',
              rich: {
          aaa: {
            backgroundColor: 'red',
            color: 'blue'
          }
            }
        }
    },
    legend: {
        data:['邮件营销','联盟广告']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            data : ['周一','周二']
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            name:'邮件营销',
            type:'line',
            data:[120, 132, 101, 134, 90, 230, 210]
        },
        {
            name:'联盟广告',
            type:'line',
            data:[220, 182, 191, 234, 290, 330, 310]
        }
    ]
};

谢谢。

可能是一个错误,所以我创建了一个Github Issue

0 个答案:

没有答案