簡體   English   中英

如何在echarts折線圖中的標題后獲取換行符?

[英]How to get newline after the title in echarts line chart?

我想在標題后添加新行,有人可以幫助我該怎么做嗎? 我在這里設置諸如

option ={
title: 'test content regarding the line chart'
}

由於標題很長,因此它是在傳說中嘗試過的,

option ={
title: 'test content regarding the line chart \n'
}

不會鍛煉...

謝謝,

你做對了。 只需使用'\\n'添加另一行,您就可以在線使用eChart編輯器對其進行測試。 更改標題時請注意子文本的位置,在標題末尾插入或刪除新行。

https://ecomfe.github.io/echarts-examples/public/editor.html

您可以使用以下示例:

option = {
title: {
    text: ' Inserting a break on title \n and another break here \n',
    subtext: 'We also have the subtext'
},
tooltip: {
    trigger: 'axis',
    axisPointer: {
        type: 'shadow'
    }
},
legend: {
    data: ['Production']
},
grid: {
    containLabel: true
},
xAxis: {
    type: 'value',
    data: ['abc','xyz'],
    boundaryGap: [0, 0.01]
},
yAxis: {
    type: 'category',
    data: ['Month 1','Month 2']
},
series: {
        name: 'Production',
        type: 'bar',
        data: [70,80],
        isBiggerOrEqual: true
    }};

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM