我需要访问该图表(echarts 5.0.0),该图表上的工具提示显示在tooltip格式化程序函数内部。我如何访问它? let chartOption = {
//... all the other stuff
tooltip: {
//...
formatter: function (params, ticket, callback) {
//how to access chart when formatter function is called?
}
}
使用此代码:
import ReactEChartsCore from 'echarts-for-react/lib/core';
// Import the echarts core module, which provides the necessary interfaces for using echarts.
import * as echarts from 'echarts/core';
// import components, all suffixed with Component
import {
GridComponent,
Toolt
我在地图上画了很多片段,在某个时候我需要使用setOption更新这些片段。我发现,他们建议在变量中保存E图表对象,然后根据以下变量进行更新:
//Create
let echartsObj = echarts.init(document.getElementById("someId"));
...
};
//Update
echartsObj.setOption(option)
但是这并不适用于我,因为我有很多E图表实例,我应该根据它们的id来匹配它们,如下所示:
//It is not updating but I want something like that
我一直在尝试在Echarts.js中复制这个Echarts.js功能,以制作一个全屏的情节:。
请注意,通过单击右上角按钮,您可以选择全屏模式,然后按Esc即可禁用该模式。
我尝试过在Echarts.js中创建一个自定义按钮,就像在高级图表中这样的按钮,但没有成功:
btn.addEventListener('click', function() {
Highcharts.FullScreen = function(container) {
this.init(container.parentNode); // main div of the chart
};