Skip to main content

ECharts Instance

echartsInstance is the created instance (container) of the Apache ECharts. It allows to

  • Get the width and height of the ECharts container.
  • Get the DOM (Document Object Model) to add additional elements.
  • Resize.
  • Handle Events.
  • Update options, etc.

To learn more about echartsInstance take a look at the official documentation.

Scale when resizing

To scale the content when the panel is resized using the instance methods to retrieve the width and height of the panel.

  graphic: {
type: "image",
style: {
image: `data:image/svg+xml;utf8,${SVG}`,
width: echartsInstance.getWidth(),
height: echartsInstance.getHeight(),
},
},

Create DOM elements

It's possible to add elements (button, checkbox, select, etc.) to the DOM (Document Object Model) using the instance.

Add a button to add Events on the Apache ECharts container.
Add a button to add Events on the Apache ECharts container.

For example, you can add a button with an event handler.

docs/volkovlabs-echarts-panel/dom.js
loading...