import * as echarts from 'echarts/core';
import {BarChart} from 'echarts/charts';
import {TitleComponent,TooltipComponent,GridComponent,LegendComponent,AriaComponent} from 'echarts/components';
import {CanvasRenderer} from 'echarts/renderers';
import {mount} from './lab.js';
echarts.use([BarChart,TitleComponent,TooltipComponent,GridComponent,LegendComponent,AriaComponent,CanvasRenderer]);
window.mbskyRegisteredSource='core + BarChart + actual components + CanvasRenderer; full import absent';
mount(echarts,{
"key": "install-modular",
"title": "独立按需注册入口",
"cases": [
{
"id": "install-full",
"title": "固定发布包全量模块",
"option": {
"animation": false,
"title": {
"text": "蓝色天空网 · 虚构学习数据"
},
"tooltip": {
"trigger": "item"
},
"legend": {
"top": 35
},
"grid": {
"top": 90,
"bottom": 65,
"containLabel": true
},
"xAxis": {
"type": "category",
"data": [
"阅读",
"实作",
"复习",
"调试",
"整理",
"回顾"
]
},
"yAxis": {
"type": "value",
"name": "次数"
},
"series": [
{
"id": "study",
"name": "练习次数",
"type": "bar",
"data": [
12,
24,
18,
31,
22,
27
]
}
]
}
}
]
}).catch(e=>window.mbskyError=String(e));
本例需在 ECharts6.1.0 / Edge156.0.4314.58 / 自有同源数据与本地HTTP服务;实际程序化指针和动作 中运行,请复制源码、保存文件或下载工程包后在本地执行验证。
运行说明与环境独立工程
运行环境:ECharts6.1.0 / Edge156.0.4314.58 / 自有同源数据与本地HTTP服务;实际程序化指针和动作
入口文件:projects/echarts-lab/src/modular.js
预期结果与验证条件观察提示
- 独立加载并真实绘图,未借用另一页面预先注册
请结合实际环境逐项观察。
附件与关联工程包下载
课程关联工程包(登记关联12章) · 含当前章节或实例 · mbskycom202611a498.zip