import * as echarts from 'echarts';
import {mount} from './lab.js';
// 本章独立配置和实际运行共用;数值均为自有虚构数据。
const specification = {
"key": "echarts-tutorial",
"title": "ECharts:数据、渲染器与真实交互",
"cases": [
{
"id": "first-canvas",
"title": "第一个柱形图:Canvas",
"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
]
}
]
}
},
{
"id": "first-svg",
"title": "同数据:SVG",
"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
]
}
]
},
"renderer": "svg"
}
]
};
export default async function run(){await mount(echarts,specification);}
本例需在 ECharts6.1.0 / Edge156.0.4314.58 / 自有同源数据与本地HTTP服务;实际程序化指针和动作 中运行,请复制源码、保存文件或下载工程包后在本地执行验证。
运行说明与环境独立工程
运行环境:ECharts6.1.0 / Edge156.0.4314.58 / 自有同源数据与本地HTTP服务;实际程序化指针和动作
入口文件:projects/echarts-lab/src/echarts-tutorial.js
预期结果与验证条件观察提示
- 对应变体真实运行;其数据、图元、事件或状态独立记录
请结合实际环境逐项观察。
附件与关联工程包下载
课程关联工程包(登记关联12章) · 含当前章节或实例 · mbskycom202611a498.zip