Comments (16)
有错误截图或者异常的错误信息吗?
from echarts-for-react.
没有警告或者错误信息,我换了个调用方法,用dispose销毁实例就可以了,
this.refs['mapoption'] && this.refs['mapoption'].getEchartsInstance().dispose()
from echarts-for-react.
其实不用 clear 的吧?
from echarts-for-react.
地图的那个titile是动态取得,我本来也是以为变化了之后重新setState就可以,但是数据发了变化但是鼠标滑到点上显示的名称都没有变化,需要clear之后才变化。
mapoption.series[0].name = title;
mapoption.series[0].data = showDataList;
mapoption.visualMap.min = min;
mapoption.visualMap.max = max;
mapoption.series[1].data = top5Data;
mapoption.series[1].name = 'Top5' + title;
from echarts-for-react.
这个感觉可能是 echarts 的一个 bug,重新 setOption 之后,title 没有重新渲染。
from echarts-for-react.
但是在他们给的例子上随便改titile名称是变化的,不知道咋搞得。。。
from echarts-for-react.
你使用的地图是这样类型的图表吗?
from echarts-for-react.
http://echarts.baidu.com/demo.html#effectScatter-map跟这个一样的
from echarts-for-react.
我测试了一下,确定是 echarts map 的 bug,我到 echarts 下面提一下 issue 试一下。
from echarts-for-react.
好,感谢~
from echarts-for-react.
没事,先关闭了,可以关注我在 echarts 上提的 issue。
from echarts-for-react.
应该是你自己代码的问题,这个 demo 实现了修改 title。不是这个项目的 bug,也不是 echarts 的 bug。
http://git.hust.cc/echarts-for-react/#/echarts/map?_k=fs754i
from echarts-for-react.
抱歉之前问题没描述清楚,修改的不是标题title,而是鼠标到点上之后tooltip显示名称,具体为series里面的name设置,该问题不止是地图里面,在pie,bar等里面改变series里面的name重新设置option都不生效,
图表的设置如下。
//option基础配置
var option = {
backgroundColor: '#404a59',
tooltip : {
trigger: 'item',
formatter: function (params) {
return '<p>'+params.seriesName+'</p>' + params.name + ' : ' + params.value[2];
}
},
legend: {
orient: 'vertical',
y: 'bottom',
x:'right',
textStyle: {
color: '#fff'
}
},
grid:{
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
visualMap: {
show: false,
min: 0,
max: 0,
inRange: {
symbolSize: [4, 35]
}
},
geo: {
map: 'china',
label: {
emphasis: {
show: false
}
},
roam: true,
itemStyle: {
normal: {
areaColor: '#323c48',
borderColor: '#111'
},
emphasis: {
areaColor: '#2a333d'
}
}
},
series : [
{
name: '下单量',
type: 'scatter',
coordinateSystem: 'geo',
data: [],
symbolSize: function (val) {
return val[2];
},
label: {
normal: {
formatter: '{b}',
show: false
},
emphasis: {
show: true
}
},
itemStyle: {
normal: {
color: '#6495ED'
}
}
},
{
name: 'Top5下单量',
type: 'effectScatter',
coordinateSystem: 'geo',
data: [],
symbolSize: function (val) {
return val[2];
},
showEffectOn: 'render',
rippleEffect: {
brushType: 'stroke'
},
// hoverAnimation: true,
label: {
normal: {
formatter: '{b}',
position: 'right',
show: false
}
},
itemStyle: {
normal: {
color: '#6495ED',
shadowBlur: 10,
}
},
}
]
};
export const mapdata = {
geomapoption: option,
}
//title动态设置,默认下单量
mapoption.series[0].name = title;
mapoption.series[1].name = 'Top5' + title;
//赋值完成重置option
this.setState({
mapoption: mapoption,
})
from echarts-for-react.
修改 demo 了,都是可以支持的,demo 地址还是刚才上面发的那个链接。
from echarts-for-react.
谢谢了~我也试了下在提供的例子上是好使的,放到我本地配置的环境就会出问题,可能跟我react版本或者先关环境有关系吧( "react": "^0.14.3")
from echarts-for-react.
echarts的版本问题
https://github.com/ecomfe/echarts/issues/4033
from echarts-for-react.
Related Issues (20)
- DOMException: Failed to execute 'drawImage' 'CanvasRenderingContext2D: The 1mage argument is canvas element with a width or height of 0.
- percentage `name (undefined%)` when series data is empty `series.data:[ ]` HOT 1
- Allow setting `id` and `data-testid` HOT 1
- Feature Request: RTL support
- Project status HOT 3
- Not support @typescript-eslint/parser 6.x
- 主题theme似乎不生效?
- react 5.1 增加了resize动画的功能,echarts-for-react v3.0.2 应该如何调用? HOT 1
- Typing does not support charts v5.4.3
- How to override the readonly style for position relative?
- I can not append Data while Zooming
- Table Component
- 动态切换主题
- How to connect several charts on chart load? HOT 2
- How to update datasets on zoom event? HOT 2
- [bug] : Inconsistent Zoom Functionality with ECharts: Seeking Guidance on Mouse Scroll and Button Control Integration
- Tree branch once opened does not retract back on closing it HOT 1
- How to rewrite this example with echarts-for-react
- add type to EChartsOption
- Update Required type Opts ( and add support for SSR) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from echarts-for-react.