Comments (11)
function (){
const chart = this.ecModel.scheduler.ecInstance;
const series = [];
for (const s of chart.getOption().series) {
if (s.type === 'custom') {
if (s.data.length === 0) {
series.push({data: chart.getModel().getSeriesByName(s.name).filter((s) => s.subType === 'line')[0].option.data})
} else {
series.push({data: []});
}
} else {
series.push({});
}
}
chart.setOption({series: series});
}
It is a bit ugly because there is no simple way to toggle a series (apache/echarts#15585), but it works. You can get chart
instance from this.ecModel.scheduler.ecInstance
. There are also other parameters passed as arguments to the click handler.
from go-echarts.
Hi @mitar , We mainly support the configurable common useful opts of the toolbox (the same as other options), not a flexible
structure. I don't think it is a lib thing that we provide just interface{}
and you do the rest.
I have to say go-echarts is part of the echarts implementations and it still needs more features and adaptions.
- Charts type.
- Charts Options.
- Charts (
echarts
) instance operation. - Charts dynamic data/render.
- ...
If there is miss something, glad to hear your voice.
And I would appreciate that If you could do some contributions is a big plus.
from go-echarts.
OK, so if I understand, comment is currently wrong and this is not yet possible? But you are not opposed to adding such a feature and allow user defined tools?
from go-echarts.
OK, so if I understand, comment is currently wrong and this is not yet possible?
Yep, the comment sounds not align to current support options.
But you are not opposed to adding such a feature and allow user defined tools?
Everyone knows the ideal things is If it can do in echarts, it should do in go-echarts as well
.
The point is we need find a good way to implement it and make it easy to use. There needs lot of time to design and make it work, not just straightforward and crude change it to just make it work.
But we don't have a Aladdin's magic lamp
to say I want it, then I have it.
I don't have that much time to follow everyone's requirements and include the whole echarts' options/functions/features... asap.
So, I do wanna more contributors who use go-echarts can share ideas and contribute something like the allow user defined tools
, and benefit to others also.
from go-echarts.
I am not sure what are you saying here. So I am willing to make a PR with this feature and propose an approach how to do it. I am not asking for you to do it for me. Is that OK?
The approach I would take is to have extra map field on ToolBoxFeature
for user-defined tools. Where you can then define those extra tools. And custom json marshal to merge those together.
from go-echarts.
I am not sure what are you saying here. So I am willing to make a PR with this feature and propose an approach how to do it. I am not asking for you to do it for me. Is that OK?
The approach I would take is to have extra map field on
ToolBoxFeature
for user-defined tools. Where you can then define those extra tools. And custom json marshal to merge those together.
Thx for your understanding and helping here.
TBH, I don't think implement it (add an extra option) is that hard. The point is how do we implement it.
I assume that you may need a JSFunc string for onclick
event, which means may need more of the JS context beyond go-echarts, even more ES modules...etc. The alert
example in echarts is meaningless.
So, what the scope is and how much things we support by the customized feature
?
from go-echarts.
which means may need more of the JS context beyond go-echarts, even more ES modules...etc. The alert example in echarts is meaningless.
I do not think that is really necessary. In my case it is for example just to toggle some series to be shown or not. That is few lines of JavaScript.
from go-echarts.
which means may need more of the JS context beyond go-echarts, even more ES modules...etc. The alert example in echarts is meaningless.
I do not think that is really necessary. In my case it is for example just to toggle some series to be shown or not. That is few lines of JavaScript.
So, if we provide this features in the way of my assumption. It seems so much limitation to use it, and hard to use.
Or, you have any other thoughts on it?
from go-echarts.
I made #327. It works great for me. Allows me to add a simple tool to toggle series on and off in a batch.
from go-echarts.
Allows me to add a simple tool to toggle series on and off in a batch.
What does it look like?
from go-echarts.
It is a bit ugly because there is no simple way to toggle a series (apache/echarts#15585), but it works. You can get chart instance from this.ecModel.scheduler.ecInstance. There are also other parameters passed as arguments to the click handler.
Thats cool.
from go-echarts.
Related Issues (20)
- Questino regarding histograms HOT 1
- [CI] Integration test for gp-echarts.
- 请问一下支持echarts针对大规模数据集的参数large:true的设置么?比如scatter的绘制,没找到这个参数 HOT 3
- how to modify MarkLine color HOT 1
- [proposal] can we add links in pie-chart graphs in the legend section HOT 1
- [Bug] XAxis WithXAxisOpts show设置为false时候,line.JSON返回的数据里面没有show属性,设置为true的时候会带上 HOT 1
- [Bug] 数据量较大时Scatter3D组件的标签显示乱码 HOT 3
- [Bug] Empty xaxis/yaxis dictionary, bar.SetXAxis() is broken HOT 7
- [proposal] provide export api for echarts options. HOT 1
- charts.Map 问题询问 HOT 1
- YAxis has no minInterval HOT 1
- Add support to Geo charts HOT 1
- Polar plots failing with `undefined findAxisModel` HOT 3
- Add data filtering component HOT 1
- [Bug] RenderContent() not found HOT 1
- [Question] How does adding customized css work? HOT 1
- Using go-echart...focus on responsiveness HOT 15
- Tooltip and Y axis label HOT 7
- Overlapping labels in xAxis with type="time" HOT 3
- Format go-echart tooltip value
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 go-echarts.