new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Apache ECharts · all subjects

echarts-instance/lifecycle

11 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

clear method

clear() removes all components and series from current instance.

dispose method

dispose() disposes the instance. Once disposed, the instance cannot be used again.

ECharts instance definition and role

An echarts instance is a container that holds multiple diagrams, coordinate systems, and other components. Each echarts instance is created based on a single DOM element and uses that DOM element exclusively as its container. Multiple echarts instances can be created on a single webpage.

Creating echarts instance and using setOption

To create an echarts instance: get a DOM element, call echarts.init(dom) to initialize, then call chart.setOption(option) with the option object. The echarts instance processes the data and renders the charts.

v5 removes default export, requires named exports

ECharts v5 no longer supports default exports. Code like 'import echarts from echarts' will throw an error. Instead, use named exports: 'import * as echarts from echarts' or 'import * as echarts from echarts/lib/echarts'.

Tree-shaking API in v5.0.1+

ECharts v5.0.1 introduced a tree-shaking API for minimal bundle sizes. Import core and specific components separately: import * as echarts from 'echarts/core'; import { BarChart } from 'echarts/charts'; import { GridComponent } from 'echarts/components'; import { CanvasRenderer } from 'echarts/renderers'; Then register with echarts.use([BarChart, GridComponent, CanvasRenderer]). Canvas renderer is no longer included by default and must be imported explicitly, or import SVGRenderer for SVG rendering.

No longer support importing from echarts/src in v5

Source code in v5 has been rewritten in TypeScript. Importing from 'echarts/src' is no longer supported. Import from 'echarts/lib' instead.

Grid component no longer imported by default with bar and line charts

In v5 with tree-shaking API, the grid component is no longer introduced by default when using bar and line charts. It must be imported separately: require('echarts/lib/component/grid') or import { GridComponent } from 'echarts/components'; echarts.use(GridComponent);

IE8 no longer supported in v5

ECharts v5 no longer supports Internet Explorer 8. The VML renderer for IE8 compatibility is no longer maintained. Starting with v5.0.1, standalone renderers can be registered if needed.

Extensions requiring upgrade for v5 compatibility

These extensions need to be upgraded to new versions to support ECharts v5: echarts-gl, echarts-wordcloud, and echarts-liquidfill.

Dynamic language switching with registerLocale

Starting with Apache ECharts 5, dynamic language is separated from the main code. To switch languages, you only need to load the corresponding language, use the registerLocale function to mount the language object in a similar way to mounting a theme, and then reinitialize the chart. Example: echarts.registerLocale('DE', lang); echarts.init(DomElement, null, { locale: 'DE' });

Give your agent this brain