We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fc5b29 commit 52461fdCopy full SHA for 52461fd
src/components/Echarts/renderChart.js
@@ -7,5 +7,18 @@ export default function renderChart(props) {
7
document.getElementById('main').style.height = "${height}px";
8
var myChart = echarts.init(document.getElementById('main'));
9
myChart.setOption(${toString(props.option)});
10
+ myChart.on('click', function(params) {
11
+ var seen = [];
12
+ var paramsString = JSON.stringify(params, function(key, val) {
13
+ if (val != null && typeof val == "object") {
14
+ if (seen.indexOf(val) >= 0) {
15
+ return;
16
+ }
17
+ seen.push(val);
18
19
+ return val;
20
+ });
21
+ window.postMessage(JSON.stringify(paramsString));
22
23
`
24
}
0 commit comments