echarts
echarts copied to clipboard
雷达图 radar rich 无效
One-line summary [问题简述]
雷达图 radar rich 无效
使用svg渲染情况下无效,canvas是正常的
var myChart = echarts.init(document.querySelector('#main'), null, {renderer: 'svg'});
Version & Environment [版本及环境]
- ECharts version [4.x、3.8.5都不行]:
- Browser version [Chrome v69]:
- OS Version [操作系统类型和版本]:
Expected behaviour [期望结果]
ECharts option [ECharts配置项]
let option = {
backgroundColor: "#FFF",
radar: {
center: ['50%', '58%'],
nameGap: 6, // 指示器名称和指示器轴的距离。
name: {
textStyle: {
color: '#999',
},
formatter: function(name, indicator) {
return [
'{title|' + name + '}',
'{value|' + indicator.value + indicator.label + '}',
].join('\n')
},
rich: {
title: {
color: '#9b9da4',
align: 'center',
fontSize: '12',
},
value: {
color: '#6082f2',
fontSize: '12',
padding: [0, 0, 5, 0],
textAlign: 'center',
align: 'center',
fontWeight: 'bolder',
},
}
},
splitArea: {
areaStyle: {
color: ['#fff', '#fff', '#fff', '#fff'],
shadowColor: 'rgba(0, 100, 0, 0.3)'
}
},
axisLine: {
lineStyle: {
color: '#d9dadc'
}
},
splitLine: {
lineStyle: {
color: '#d9dadc',
}
},
indicator: indicator_data || [
{ name: this.$t('基本面'), max: 6500, value: 500 },
{ name: 'B', max: 6500, value: 3400 },
{ name: 'C', max: 3800, value: 2800 },
{ name: 'D', max: 3800, value: 3100 },
{ name: 'E', max: 5200, value: 4200 }
]
},
series: [{
type: 'radar',
data: [{
value: series_value,
name: 'DATA',
itemStyle: {
normal: {
color: '#729ff0'
}
},
lineStyle: {
normal: {
width: '1.3'
}
},
areaStyle: {
normal: {
color: 'rgba(114, 159, 240, 0.5)'
}
}
}]
}]
}
Other comments [其他信息]
我也遇到了。希望能尽快修复
我在最新版本上(4.2.*)试能够画出来了。
我在最新版本上(4.2.*)试能够画出来了。
用svg渲染也可以?
@kang558 Sorry, it does not work on SVG Rendering.
@kang558 Sorry, it does not work on SVG Rendering.
最近有合适的方案吗??
遇到个需求是拉伸整个图片,svg可以显示一个原有的图片,canvas就是没有拖拉背景,因此svg比较合适,但是需要用到rich就炸了
官方参考文档( rich 富文本标签进行绘制 ):
-
https://echarts.baidu.com/option.html#title.textStyle.rich
-
https://www.echartsjs.com/gallery/editor.html?c=doc-example/title-block
参考这个官方案例, 我看完这个, 绘制出来了
效果和主要代码如下:
导入图片样式的做法:
遇到个需求是拉伸整个图片,svg可以显示一个原有的图片,canvas就是没有拖拉背景,因此svg比较合适,但是需要用到rich就炸了
是啊,没找到方案,暂时放弃富文本了
@von-mo 你没看懂我的意思,要用svg渲染图表
@kang558 svg 暂时还不知道如何处理,这块官网也没有具体的说明. 刚才那一块, 放在这给其他需要的下伙伴做个参考吧. 有可能会遇到这个问题, 谢谢 ~
@kang558 svg 暂时还不知道如何处理,这块官网也没有具体的说明. 刚才那一块, 放在这给其他需要的下伙伴做个参考吧. 有可能会遇到这个问题, 谢谢 ~
嗯嗯呐
sankey 图+1,svg 下 rich依然不生效
This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.
--(这是来自QQ邮箱的自动回复邮件。) 您好,已接收到您的邮件,会及时回复。 谅解! (愿:天天开心,时时好心情。)
This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.
--(这是来自QQ邮箱的自动回复邮件。) 您好,已接收到您的邮件,会及时回复。 谅解! (愿:天天开心,时时好心情。)