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
}};
我想在标题后添加新行,有人可以帮我怎么做吗? 我在这里设置选项,
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
}};