276 lines
6.4 KiB
JSON
276 lines
6.4 KiB
JSON
{
|
|
"order": 0,
|
|
"key": "bar-chart",
|
|
"type": "bar-chart",
|
|
"name": "柱状图",
|
|
"description": "按类目对比数值大小,适合月度、地区、产品等分类数据的对比",
|
|
"tags": [
|
|
"charts",
|
|
"柱状图",
|
|
"bar-chart"
|
|
],
|
|
"renderer": "echarts",
|
|
"group": "charts",
|
|
"icon": "solar:chart-2-bold",
|
|
"sample_data": true,
|
|
"usage_notes": [
|
|
"默认图表数据仅用于演示,不是真实业务数据",
|
|
"通过顶层 dataId 关联已有数据源,当前后端尚未实现绑定操作"
|
|
],
|
|
"field_groups": [
|
|
"node-base",
|
|
"chart-title",
|
|
"chart-legend",
|
|
"chart-grid",
|
|
"chart-axis",
|
|
{
|
|
"key": "bar-series",
|
|
"label": "柱形",
|
|
"description": "柱子的颜色、宽度、圆角、系列名称和数值标签",
|
|
"fields": [
|
|
{
|
|
"path": "props.option.series.0.itemStyle.color",
|
|
"label": "柱颜色",
|
|
"description": "柱子的填充颜色",
|
|
"value_type": "color",
|
|
"aliases": [
|
|
"颜色",
|
|
"柱子颜色",
|
|
"主色"
|
|
]
|
|
},
|
|
{
|
|
"path": "props.option.series.0.name",
|
|
"label": "系列名称",
|
|
"description": "这组柱子的名称,显示在图例和鼠标悬停提示中;不是图表标题",
|
|
"value_type": "string",
|
|
"aliases": [
|
|
"图例名称",
|
|
"系列名",
|
|
"数据名称"
|
|
],
|
|
"panel": false
|
|
},
|
|
{
|
|
"path": "props.option.series.0.barWidth",
|
|
"label": "柱宽",
|
|
"description": "柱子宽度,百分比表示占每个类目宽度的比例,例如 45%",
|
|
"value_type": "string",
|
|
"aliases": [
|
|
"柱子宽度",
|
|
"柱子粗细"
|
|
],
|
|
"panel": false
|
|
},
|
|
{
|
|
"path": "props.option.series.0.itemStyle.borderRadius",
|
|
"label": "柱圆角",
|
|
"description": "柱子四个角的圆角半径,顺序为左上、右上、右下、左下",
|
|
"value_type": "array",
|
|
"item_type": "number",
|
|
"unit": "px",
|
|
"aliases": [
|
|
"圆角"
|
|
],
|
|
"panel": false
|
|
},
|
|
{
|
|
"path": "props.option.series.0.label.show",
|
|
"label": "数值标签",
|
|
"description": "是否在每根柱子上显示数值",
|
|
"value_type": "boolean",
|
|
"default": false,
|
|
"aliases": [
|
|
"显示数值",
|
|
"数据标签",
|
|
"标签"
|
|
],
|
|
"panel": false
|
|
},
|
|
{
|
|
"path": "props.option.series.0.label.position",
|
|
"label": "标签位置",
|
|
"description": "数值标签相对柱子的位置,开启数值标签后生效",
|
|
"value_type": "enum",
|
|
"default": "inside",
|
|
"options": [
|
|
{
|
|
"value": "top",
|
|
"label": "柱顶上方"
|
|
},
|
|
{
|
|
"value": "inside",
|
|
"label": "柱内居中"
|
|
},
|
|
{
|
|
"value": "insideTop",
|
|
"label": "柱内顶端"
|
|
},
|
|
{
|
|
"value": "insideBottom",
|
|
"label": "柱内底端"
|
|
}
|
|
],
|
|
"aliases": [
|
|
"数值位置"
|
|
],
|
|
"panel": false
|
|
}
|
|
]
|
|
},
|
|
"chart-dataset",
|
|
"chart-encode-xy"
|
|
],
|
|
"eventOptions": [
|
|
{
|
|
"label": "点击事件",
|
|
"value": "click"
|
|
},
|
|
{
|
|
"label": "双击事件",
|
|
"value": "dblclick"
|
|
},
|
|
{
|
|
"label": "鼠标进入事件",
|
|
"value": "mouseenter"
|
|
},
|
|
{
|
|
"label": "鼠标离开事件",
|
|
"value": "mouseleave"
|
|
},
|
|
{
|
|
"label": "鼠标按下事件",
|
|
"value": "mousedown"
|
|
},
|
|
{
|
|
"label": "鼠标抬起事件",
|
|
"value": "mouseup"
|
|
},
|
|
{
|
|
"label": "鼠标移动事件",
|
|
"value": "mousemove"
|
|
},
|
|
{
|
|
"label": "鼠标滚轮事件",
|
|
"value": "mousewheel"
|
|
},
|
|
{
|
|
"label": "生命周期事件",
|
|
"value": "vnodeMounted"
|
|
}
|
|
],
|
|
"schema": {
|
|
"type": "bar-chart",
|
|
"name": "柱状图",
|
|
"layout": {
|
|
"x": 0,
|
|
"y": 0,
|
|
"width": 400,
|
|
"height": 260
|
|
},
|
|
"props": {
|
|
"option": {
|
|
"legend": {
|
|
"top": 38,
|
|
"left": "center",
|
|
"itemWidth": 12,
|
|
"itemHeight": 8,
|
|
"show": true,
|
|
"textStyle": {
|
|
"color": "#cfd3dc"
|
|
}
|
|
},
|
|
"title": {
|
|
"text": "月度销售额",
|
|
"top": 8,
|
|
"left": "center",
|
|
"textStyle": {
|
|
"color": "#e5eaf3",
|
|
"fontSize": 16
|
|
}
|
|
},
|
|
"tooltip": {},
|
|
"dataset": {
|
|
"source": [
|
|
{
|
|
"month": "一月",
|
|
"sales": 120
|
|
},
|
|
{
|
|
"month": "二月",
|
|
"sales": 200
|
|
},
|
|
{
|
|
"month": "三月",
|
|
"sales": 150
|
|
},
|
|
{
|
|
"month": "四月",
|
|
"sales": 80
|
|
},
|
|
{
|
|
"month": "五月",
|
|
"sales": 170
|
|
},
|
|
{
|
|
"month": "六月",
|
|
"sales": 240
|
|
}
|
|
]
|
|
},
|
|
"grid": {
|
|
"top": 86,
|
|
"right": 24,
|
|
"bottom": 32,
|
|
"left": 48,
|
|
"containLabel": true
|
|
},
|
|
"xAxis": {
|
|
"type": "category",
|
|
"axisLine": {
|
|
"lineStyle": {
|
|
"color": "#4c4d4f"
|
|
}
|
|
},
|
|
"axisLabel": {
|
|
"color": "#cfd3dc"
|
|
}
|
|
},
|
|
"yAxis": {
|
|
"type": "value",
|
|
"axisLabel": {
|
|
"color": "#cfd3dc"
|
|
},
|
|
"splitLine": {
|
|
"lineStyle": {
|
|
"color": "rgba(255, 255, 255, 0.08)"
|
|
}
|
|
}
|
|
},
|
|
"series": [
|
|
{
|
|
"name": "销售额",
|
|
"type": "bar",
|
|
"barWidth": "45%",
|
|
"encode": {
|
|
"x": "month",
|
|
"y": "sales"
|
|
},
|
|
"itemStyle": {
|
|
"color": "#409eff",
|
|
"borderRadius": [
|
|
4,
|
|
4,
|
|
0,
|
|
0
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"style": null,
|
|
"events": []
|
|
}
|
|
}
|