123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781 |
- // 配置版本号
- const version = '2023091901'
- // 标题
- const title = '3D基础柱状图'
- // 用于标识,唯一,和文件夹名称一致
- const name = '3D基础柱状图'
- // 右侧配置项
- const setting = [
- {
- label: '维度',
- type: 'select', // 设置组件类型
- field: 'xField', // 字段
- optionField: 'xField', // 对应options中的字段
- // 是否多选
- multiple: false,
- value: '',
- tabName: 'data'
- },
- {
- label: '指标',
- type: 'select', // 设置组件类型
- field: 'yField', // 字段
- optionField: 'yField', // 对应options中的字段
- // 是否多选
- multiple: false,
- value: '',
- tabName: 'data'
- },
- // 样式配置
- {
- label: '柱子宽度',
- type: 'inputNumber', // 设置组件类型
- field: 'seriesCustom_barWidth', // 字段
- optionField: 'seriesCustom.barWidth', // 对应options中的字段
- value: 30,
- tabName: 'custom',
- groupName: 'graph'
- },
- {
- label: '柱子顶部颜色',
- type: 'colorPicker', // 设置组件类型
- field: 'seriesCustom_barTopColor', // 字段
- optionField: 'seriesCustom.barTopColor', // 对应options中的字段
- value: '#2DB1EF',
- tabName: 'custom',
- groupName: 'graph'
- },
- {
- label: '柱子颜色',
- type: 'colorPicker', // 设置组件类型
- field: 'seriesCustom_barColor', // 字段
- optionField: 'seriesCustom.barColor', // 对应options中的字段
- value: '#115ba6',
- tabName: 'custom',
- groupName: 'graph'
- },
- {
- label: '柱子底部颜色',
- type: 'colorPicker', // 设置组件类型
- field: 'seriesCustom_barBottomColor', // 字段
- optionField: 'seriesCustom.barBottomColor', // 对应options中的字段
- value: '#187dcb',
- tabName: 'custom',
- groupName: 'graph'
- },
- {
- label: '阴影柱子颜色',
- type: 'colorPicker', // 设置组件类型
- field: 'seriesCustom_shadowColor', // 字段
- optionField: 'seriesCustom.shadowColor', // 对应options中的字段
- value: '#041133',
- tabName: 'custom',
- groupName: 'graph'
- },
- {
- label: '阴影柱子顶部颜色',
- type: 'colorPicker', // 设置组件类型
- field: 'seriesCustom_shadowTopColor', // 字段
- optionField: 'seriesCustom.shadowTopColor', // 对应options中的字段
- value: '#142f5a',
- tabName: 'custom',
- groupName: 'graph'
- },
- {
- label: '底部阴影颜色',
- // 设置组件类型
- type: 'colorPicker',
- // 字段
- field: 'graphic_children_style_fill',
- // 对应options中的字段
- optionField: 'graphic.children.style.fill',
- value: '#3f4867',
- tabName: 'custom',
- groupName: 'graph'
- },
- {
- label: '数据标签',
- type: 'switch', // 设置组件类型
- field: 'series_barColor_label_show', // 字段
- optionField: 'series.barColor.label.show', // 对应options中的字段
- value: 1,
- active: 1,
- inactive: 0,
- tabName: 'custom',
- groupName: 'graph'
- },
- {
- label: '数据标签位置',
- type: 'select', // 设置组件类型
- field: 'series_barColor_label_position', // 字段
- optionField: 'series.barColor.label.position', // 对应options中的字段
- // 是否多选
- multiple: false,
- value: 'inside',
- tabName: 'custom',
- options: [
- {
- label: '顶部',
- value: 'top'
- },
- {
- label: '居中',
- value: 'inside'
- },
- {
- label: '底部',
- value: 'bottom'
- }
- ],
- groupName: 'graph'
- },
- {
- label: '数据标签颜色',
- type: 'colorPicker', // 设置组件类型
- field: 'series_barColor_label_color', // 字段
- optionField: 'series.barColor.label.color', // 对应options中的字段
- value: '#ffffff',
- tabName: 'custom',
- groupName: 'graph'
- },
- {
- label: '数据标签大小',
- // 设置组件类型
- type: 'inputNumber',
- // 字段
- field: 'series_barColor_label_fontSize',
- // 对应options中的字段
- optionField: 'series.barColor.label.fontSize',
- value: 12,
- tabName: 'custom',
- groupName: 'graph'
- },
- // 网格线
- {
- label: '分隔线',
- type: 'switch',
- field: 'yAxis_splitLine_show',
- optionField: 'yAxis.splitLine.show',
- value: 0,
- active: 1,
- inactive: 0,
- tabName: 'custom',
- groupName: 'grid'
- },
- {
- label: '宽度',
- type: 'inputNumber',
- field: 'yAxis_splitLine_lineStyle_width',
- optionField: 'yAxis.splitLine.lineStyle.width',
- value: 2,
- tabName: 'custom',
- groupName: 'grid'
- },
- {
- label: '颜色',
- type: 'colorPicker',
- field: 'yAxis_splitLine_lineStyle_color',
- optionField: 'yAxis.splitLine.lineStyle.color',
- value: '#fff',
- tabName: 'custom',
- groupName: 'grid'
- },
- // x轴 xAxis
- {
- label: '显示',
- type: 'switch',
- field: 'xAxis_show',
- optionField: 'xAxis.show',
- value: 0,
- active: 1,
- inactive: 0,
- tabName: 'custom',
- groupName: 'xAxis'
- },
- {
- label: '标题',
- type: 'input',
- field: 'xAxis_name',
- optionField: 'xAxis.name',
- value: '',
- tabName: 'custom',
- groupName: 'xAxis'
- },
- {
- label: '标题位置',
- type: 'select',
- field: 'xAxis_nameLocation',
- optionField: 'xAxis.nameLocation',
- value: 'start',
- tabName: 'custom',
- options: [
- {
- label: '左',
- value: 'start'
- },
- {
- label: '中',
- value: 'center'
- },
- {
- label: '右',
- value: 'end'
- }],
- groupName: 'xAxis'
- },
- {
- label: '标题到轴线距离',
- type: 'inputNumber',
- field: 'xAxis_nameGap',
- optionField: 'xAxis.nameGap',
- value: 10,
- tabName: 'custom',
- groupName: 'xAxis'
- },
- {
- label: '标题字体大小',
- type: 'inputNumber',
- field: 'xAxis_nameTextStyle_fontSize',
- optionField: 'xAxis.nameTextStyle.fontSize',
- value: 12,
- tabName: 'custom',
- groupName: 'xAxis'
- },
- {
- label: '标题颜色',
- type: 'colorPicker',
- field: 'xAxis_nameTextStyle_color',
- optionField: 'xAxis.nameTextStyle.color',
- // 是否多选
- multiple: false,
- value: '#8C8C8C',
- tabName: 'custom',
- groupName: 'xAxis'
- },
- {
- label: '轴线显示',
- type: 'switch',
- field: 'xAxis_axisLine_show',
- optionField: 'xAxis.axisLine.show',
- value: 0,
- active: 1,
- inactive: 0,
- tabName: 'custom',
- groupName: 'xAxis'
- },
- {
- label: '轴线颜色',
- type: 'colorPicker',
- field: 'xAxis_axisLine_lineStyle_color',
- optionField: 'xAxis.axisLine.lineStyle.color',
- // 是否多选
- multiple: false,
- value: '#333',
- tabName: 'custom',
- groupName: 'xAxis'
- },
- {
- label: '轴线宽度',
- type: 'inputNumber',
- field: 'xAxis_axisLine_lineStyle_width',
- optionField: 'xAxis.axisLine.lineStyle.width',
- value: 1,
- tabName: 'custom',
- groupName: 'xAxis'
- },
- {
- label: '标签显示',
- type: 'switch',
- field: 'xAxis_axisLabel_show',
- optionField: 'xAxis.axisLabel.show',
- value: 1,
- active: 1,
- inactive: 0,
- tabName: 'custom',
- groupName: 'xAxis'
- },
- {
- label: '标签颜色',
- type: 'colorPicker',
- field: 'xAxis_axisLabel_textStyle_color',
- optionField: 'xAxis.axisLabel.textStyle.color',
- // 是否多选
- multiple: false,
- value: '#8C8C8C',
- tabName: 'custom',
- groupName: 'xAxis'
- },
- {
- label: '标签大小',
- type: 'inputNumber',
- field: 'xAxis_axisLabel_textStyle_fontSize',
- optionField: 'xAxis.axisLabel.textStyle.fontSize',
- value: 14,
- tabName: 'custom',
- groupName: 'xAxis'
- },
- {
- label: '标签距离',
- type: 'inputNumber',
- field: 'xAxis_axisLabel_margin',
- optionField: 'xAxis.axisLabel.margin',
- value: 30,
- tabName: 'custom',
- groupName: 'xAxis'
- },
- // Y轴 yAxis
- {
- label: '显示',
- type: 'switch',
- field: 'yAxis_show',
- optionField: 'yAxis.show',
- value: 1,
- active: 1,
- inactive: 0,
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '标题',
- type: 'input',
- field: 'yAxis_name',
- optionField: 'yAxis.name',
- value: '',
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '标题位置',
- type: 'select',
- field: 'yAxis_nameLocation',
- optionField: 'yAxis.nameLocation',
- value: 'end',
- tabName: 'custom',
- options: [
- {
- label: '下',
- value: 'start'
- },
- {
- label: '中',
- value: 'center'
- },
- {
- label: '上',
- value: 'end'
- }],
- groupName: 'yAxis'
- },
- {
- label: '标题到轴线距离',
- type: 'inputNumber',
- field: 'yAxis_nameGap',
- optionField: 'yAxis.nameGap',
- value: 10,
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '标题字体大小',
- type: 'inputNumber',
- field: 'yAxis_nameTextStyle_fontSize',
- optionField: 'yAxis.nameTextStyle.fontSize',
- value: 12,
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '标题颜色',
- type: 'colorPicker',
- field: 'yAxis_nameTextStyle_color',
- optionField: 'yAxis.nameTextStyle.color',
- // 是否多选
- multiple: false,
- value: '#8C8C8C',
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '轴线显示',
- type: 'switch',
- field: 'yAxis_axisLine_show',
- optionField: 'yAxis.axisLine.show',
- value: 1,
- active: 1,
- inactive: 0,
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '轴线颜色',
- type: 'colorPicker',
- field: 'yAxis_axisLine_lineStyle_color',
- optionField: 'yAxis.axisLine.lineStyle.color',
- // 是否多选
- multiple: false,
- value: '#333',
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '轴线宽度',
- type: 'inputNumber',
- field: 'yAxis_axisLine_lineStyle_width',
- optionField: 'yAxis.axisLine.lineStyle.width',
- value: 1,
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '标签显示',
- type: 'switch',
- field: 'yAxis_axisLabel_show',
- optionField: 'yAxis.axisLabel.show',
- value: 1,
- active: 1,
- inactive: 0,
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '标签颜色',
- type: 'colorPicker',
- field: 'yAxis_axisLabel_textStyle_color',
- optionField: 'yAxis.axisLabel.textStyle.color',
- // 是否多选
- multiple: false,
- value: '#8C8C8C',
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '标签大小',
- type: 'inputNumber',
- field: 'yAxis_axisLabel_textStyle_fontSize',
- optionField: 'yAxis.axisLabel.textStyle.fontSize',
- value: 14,
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '标签距离',
- type: 'inputNumber',
- field: 'yAxis_axisLabel_margin',
- optionField: 'yAxis.axisLabel.margin',
- value: 10,
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '刻度显示',
- type: 'switch',
- field: 'yAxis_axisTick_show',
- optionField: 'yAxis.axisTick.show',
- value: 1,
- active: 1,
- inactive: 0,
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '刻度颜色',
- type: 'colorPicker',
- field: 'yAxis_axisTick_lineStyle_color',
- optionField: 'yAxis.axisTick.lineStyle.color',
- // 是否多选
- multiple: false,
- value: '#fff',
- tabName: 'custom',
- groupName: 'yAxis'
- },
- {
- label: '刻度宽度',
- type: 'inputNumber',
- field: 'yAxis_axisTick_length',
- optionField: 'yAxis.axisTick.length',
- // 是否多选
- multiple: false,
- value: 1,
- tabName: 'custom',
- groupName: 'yAxis'
- }
- ]
- // 配置处理脚本
- const optionHandler = ''
- // 数据处理脚本
- const dataHandler = ''
- // 图表配置 new Line('domName', option)
- const xData = ['本年话务总量', '本年人工话务量', '每万客户呼入量', '本年话务总量']
- const yData = [300, 1230, 425, 300]
- const maxData = [1500, 1500, 1500, 1500]
- const option = {
- animation: false,
- tooltip: {
- show: true
- },
- grid: {
- left: '12%',
- right: '8%',
- bottom: '20%',
- z: 100,
- containLabel: false,
- show: false
- },
- graphic: {
- type: 'group',
- bottom: '10%',
- left: '7%',
- z: 100,
- children: [
- {
- type: 'rect',
- left: 0,
- bottom: 0,
- shape: {
- width: 418 * 0.9,
- height: 10
- },
- style: {
- fill: '#3f4867'
- }
- },
- {
- type: 'polygon',
- left: 0,
- bottom: 10,
- shape: {
- // 左上、右上、右下、左下
- points: [[418 / 10, -320 / 6], [418 - 418 / 6, -320 / 6], [418 * 0.9, 0], [0, 0]]
- },
- style: {
- fill: '#303256'
- }
- }
- ]
- },
- xAxis: [
- {
- show: false,
- name: '',
- nameGap: 30,
- type: 'category',
- data: xData,
- nameTextStyle: {
- color: '',
- fontSize: 12
- },
- nameLocation: '',
- // 坐标轴刻度设置
- axisTick: {
- show: false,
- alignWithLabel: true,
- lineStyle: {
- width: 1,
- color: '#333'
- }
- },
- // 是否显示坐标轴的轴线
- axisLine: {
- show: false,
- lineStyle: {
- color: '#333',
- width: 1
- }
- },
- // 坐标轴刻度标签
- axisLabel: {
- show: false,
- textStyle: {
- fontSize: 10,
- color: 'rgb(40, 129, 170)'
- },
- margin: 30
- }
- },
- {
- show: false,
- type: 'category',
- axisLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- axisLabel: {
- show: false
- },
- splitArea: {
- show: false
- },
- splitLine: {
- show: false
- },
- data: xData
- }
- ],
- yAxis: {
- name: '',
- nameGap: 10,
- nameTextStyle: {
- color: '',
- fontSize: 12
- },
- nameLocation: 'end',
- show: true,
- type: 'value',
- axisLabel: {
- show: true,
- textStyle: {
- color: '#333',
- fontSize: 12
- },
- margin: 10
- },
- axisTick: {
- show: true,
- length: 1,
- lineStyle: {
- color: '#fff',
- width: 1
- }
- },
- // 分隔线
- splitLine: {
- show: true, // yAxis.show配置为true时,该配置才有效
- lineStyle: {
- color: '#fff',
- width: 2
- }
- },
- // y轴轴线是否显示
- axisLine: {
- show: true,
- lineStyle: {
- color: '#333',
- width: 1
- }
- }
- },
- seriesCustom: {
- barWidth: 30,
- // 顶部菱形颜色
- barTopColor: '#2DB1EF',
- // 底部菱形颜色
- barBottomColor: '#187dcb',
- // 柱子颜色
- barColor: '#1db0dd',
- // 阴影柱子颜色
- shadowColor: '#041133',
- // 阴影柱子顶部颜色
- shadowTopColor: '#142f5a'
- },
- series: [
- // 顶部
- {
- id: 'barTopColor', // 用于区分是图表的什么部分
- type: 'pictorialBar', // 象形柱图
- symbol: 'diamond',
- symbolOffset: [0, '-50%'], // 上部菱形
- symbolSize: [30, 15],
- // symbolOffset: [0, -6], // 上部椭圆
- symbolPosition: 'end',
- z: 12,
- label: {
- show: false
- },
- color: '#2DB1EF',
- tooltip: {
- show: false
- },
- data: yData
- },
- // 底部
- {
- id: 'barBottomColor', // 用于区分是图表的什么部分
- type: 'pictorialBar',
- symbol: 'diamond',
- symbolSize: [30, 15],
- symbolOffset: ['0%', '50%'], // 下部菱形
- // symbolOffset: [0, 7], // 下部椭圆
- z: 12,
- color: '#187dcb',
- tooltip: {
- show: false
- },
- label: {
- show: false
- },
- data: yData
- },
- // 柱子
- {
- id: 'barColor', // 用于区分是图表的什么部分
- type: 'bar',
- barWidth: 30,
- z: 10,
- color: '#115ba6',
- label: {
- show: true,
- position: 'inside',
- color: '#fff',
- fontSize: 12
- },
- data: yData
- },
- // 阴影柱子
- {
- id: 'shadowColor', // 用于区分是图表的什么部分
- type: 'bar',
- barWidth: 30,
- barGap: '-100%',
- itemStyle: {
- normal: {
- opacity: 0.8,
- shadowColor: 'rgba(0, 0, 0, 0.5)', // 阴影颜色
- shadowBlur: 0 // 阴影模糊值
- }
- },
- label: {
- show: false
- },
- color: '#041133',
- tooltip: {
- show: false
- },
- data: maxData
- },
- // 阴影顶部
- {
- id: 'shadowTopColor', // 用于区分是图表的什么部分
- type: 'pictorialBar', // 象形柱图
- symbol: 'diamond',
- symbolOffset: [0, '-50%'], // 上部菱形
- symbolSize: [30, 15],
- // symbolOffset: [0, -6], // 上部椭圆
- symbolPosition: 'end',
- z: 12,
- label: {
- show: false
- },
- color: '#142f5a',
- tooltip: {
- show: false
- },
- data: maxData
- }
- ]
- }
- export default {
- version,
- title,
- name,
- option,
- setting,
- optionHandler,
- dataHandler
- }
|