|
@@ -45,7 +45,7 @@ const setting = [
|
|
|
/** 样式配置 **/
|
|
|
// 图表 graph
|
|
|
{
|
|
|
- label: '曲线平滑',
|
|
|
+ label: '折线平滑',
|
|
|
type: 'switch', // 设置组件类型
|
|
|
field: 'smooth', // 字段
|
|
|
optionField: 'smooth', // 对应options中的字段
|
|
@@ -63,7 +63,7 @@ const setting = [
|
|
|
groupName: 'graph'
|
|
|
},
|
|
|
{
|
|
|
- label: '线条颜色',
|
|
|
+ label: '折线颜色',
|
|
|
type: 'gradual', // 设置组件类型
|
|
|
field: 'line_color', // 字段
|
|
|
optionField: 'line.color', // 对应options中的字段
|
|
@@ -71,6 +71,15 @@ const setting = [
|
|
|
tabName: 'custom',
|
|
|
groupName: 'graph'
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '折线宽度',
|
|
|
+ type: 'inputNumber', // 设置组件类型
|
|
|
+ field: 'line_size', // 字段
|
|
|
+ optionField: 'line.size', // 对应options中的字段
|
|
|
+ value: 1,
|
|
|
+ tabName: 'custom',
|
|
|
+ groupName: 'graph'
|
|
|
+ },
|
|
|
{
|
|
|
label: '面积颜色',
|
|
|
type: 'gradual', // 设置组件类型
|
|
@@ -81,16 +90,7 @@ const setting = [
|
|
|
groupName: 'graph'
|
|
|
},
|
|
|
{
|
|
|
- label: '线条宽度',
|
|
|
- type: 'inputNumber', // 设置组件类型
|
|
|
- field: 'line_size', // 字段
|
|
|
- optionField: 'line.size', // 对应options中的字段
|
|
|
- value: 1,
|
|
|
- tabName: 'custom',
|
|
|
- groupName: 'graph'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '数据点颜色',
|
|
|
+ label: '折线点颜色',
|
|
|
type: 'colorPicker', // 设置组件类型
|
|
|
field: 'point_color', // 字段
|
|
|
optionField: 'point.color', // 对应options中的字段
|
|
@@ -98,12 +98,71 @@ const setting = [
|
|
|
tabName: 'custom',
|
|
|
groupName: 'graph'
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '折线点样式',
|
|
|
+ type: 'select', // 设置组件类型
|
|
|
+ field: 'point_shape', // 字段
|
|
|
+ optionField: 'point.shape', // 对应options中的字段
|
|
|
+ value: 'hollow-circle',
|
|
|
+ tabName: 'custom',
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ label: '无',
|
|
|
+ value: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '空心圆',
|
|
|
+ value: 'hollow-circle'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '圆形',
|
|
|
+ value: 'circle'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '正方形',
|
|
|
+ value: 'square'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '菱形',
|
|
|
+ value: 'diamond'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '三角形',
|
|
|
+ value: 'triangle'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '六边形',
|
|
|
+ value: 'hexagon'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '菱形交叉',
|
|
|
+ value: 'bowtie'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '十字形',
|
|
|
+ value: 'cross'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'I形',
|
|
|
+ value: 'tick'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '加号',
|
|
|
+ value: 'plus'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '连字号',
|
|
|
+ value: 'hyphen'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ groupName: 'graph'
|
|
|
+ },
|
|
|
{
|
|
|
label: '数据标签字体大小',
|
|
|
type: 'inputNumber',
|
|
|
field: 'label_style_fontSize',
|
|
|
optionField: 'label.style.fontSize',
|
|
|
- value: 12,
|
|
|
+ value: 0,
|
|
|
tabName: 'custom',
|
|
|
groupName: 'graph'
|
|
|
},
|
|
@@ -112,11 +171,22 @@ const setting = [
|
|
|
type: 'colorPicker',
|
|
|
field: 'label_style_fill',
|
|
|
optionField: 'label.style.fill',
|
|
|
- value: 'rgba(255,255,255,0)',
|
|
|
+ value: 'rgba(255,255,255,1)',
|
|
|
tabName: 'custom',
|
|
|
groupName: 'graph'
|
|
|
},
|
|
|
// 网格线 grid
|
|
|
+ {
|
|
|
+ label: '虚线',
|
|
|
+ type: 'switchCustom',
|
|
|
+ field: 'yAxis_grid_line_style_lineDash',
|
|
|
+ optionField: 'yAxis.grid.line.style.lineDash',
|
|
|
+ value: 0,
|
|
|
+ active: 5,
|
|
|
+ inactive: 0,
|
|
|
+ tabName: 'custom',
|
|
|
+ groupName: 'grid'
|
|
|
+ },
|
|
|
{
|
|
|
label: '宽度',
|
|
|
type: 'inputNumber',
|
|
@@ -294,16 +364,16 @@ const setting = [
|
|
|
tabName: 'custom',
|
|
|
options: [
|
|
|
{
|
|
|
- label: '下',
|
|
|
- value: 'start'
|
|
|
+ label: '上',
|
|
|
+ value: 'end'
|
|
|
},
|
|
|
{
|
|
|
label: '中',
|
|
|
value: 'center'
|
|
|
},
|
|
|
{
|
|
|
- label: '上',
|
|
|
- value: 'end'
|
|
|
+ label: '下',
|
|
|
+ value: 'start'
|
|
|
}],
|
|
|
groupName: 'yAxis'
|
|
|
},
|
|
@@ -361,7 +431,7 @@ const setting = [
|
|
|
type: 'inputNumber',
|
|
|
field: 'yAxis_line_lineWidth',
|
|
|
optionField: 'yAxis.line.style.lineWidth',
|
|
|
- value: 1,
|
|
|
+ value: 0,
|
|
|
tabName: 'custom',
|
|
|
groupName: 'yAxis'
|
|
|
},
|
|
@@ -372,17 +442,17 @@ const setting = [
|
|
|
optionField: 'yAxis.line.style.stroke',
|
|
|
// 是否多选
|
|
|
multiple: false,
|
|
|
- value: 'rgba(255,255,255,0)',
|
|
|
+ value: '#d0d0d0',
|
|
|
tabName: 'custom',
|
|
|
groupName: 'yAxis'
|
|
|
},
|
|
|
// 边距 padding
|
|
|
- {
|
|
|
+ {
|
|
|
label: '图表边距',
|
|
|
type: 'padding',
|
|
|
field: 'appendPadding',
|
|
|
optionField: 'appendPadding',
|
|
|
- value: [20, 20, 20, 20],
|
|
|
+ value: [16, 16, 16, 16],
|
|
|
tabName: 'custom',
|
|
|
groupName: 'padding'
|
|
|
}
|
|
@@ -402,6 +472,17 @@ const data = [
|
|
|
{ Date: '2010-10', scales: 2140 }
|
|
|
]
|
|
|
|
|
|
+// 配置处理脚本
|
|
|
+const optionHandler = ' let pointEnable = setting.find(settingItem=>settingItem.field === \'point_shape\').value\n' +
|
|
|
+ ' if (pointEnable === false) {\n' +
|
|
|
+ ' option.point = false\n' +
|
|
|
+ ' } else {\n' +
|
|
|
+ ' option.point = {shape: pointEnable}\n' +
|
|
|
+ ' let pointColor = setting.find(settingItem=>settingItem.field === \'point_color\').value\n' +
|
|
|
+ ' option.point.color = pointColor\n' +
|
|
|
+ ' };' +
|
|
|
+ 'option.yAxis.grid.line.style.lineDash = [4,setting.find(settingItem=>settingItem.field === \'yAxis_grid_line_style_lineDash\').value]'
|
|
|
+
|
|
|
// 数据处理脚本
|
|
|
const dataHandler = ''
|
|
|
|
|
@@ -410,7 +491,7 @@ const option = {
|
|
|
// 数据将要放入到哪个字段中
|
|
|
dataKey: 'data',
|
|
|
data,
|
|
|
- appendPadding: [20, 20, 20, 20], // 设置图标的边距
|
|
|
+ appendPadding: [16, 16, 16, 16], // 设置图标的边距
|
|
|
xField: 'Date',
|
|
|
yField: 'scales',
|
|
|
smooth: false,
|
|
@@ -420,8 +501,8 @@ const option = {
|
|
|
},
|
|
|
label: {
|
|
|
style: {
|
|
|
- fill: 'rgba(255,255,255,0)',
|
|
|
- fontSize: 12
|
|
|
+ fill: 'rgba(255,255,255,1)',
|
|
|
+ fontSize: 0
|
|
|
}
|
|
|
},
|
|
|
line: {
|
|
@@ -429,8 +510,8 @@ const option = {
|
|
|
size: 1
|
|
|
},
|
|
|
point: {
|
|
|
- color: ''
|
|
|
-
|
|
|
+ color: '',
|
|
|
+ shape: 'hollow-circle',
|
|
|
},
|
|
|
xAxis: {
|
|
|
title: {
|
|
@@ -479,6 +560,7 @@ const option = {
|
|
|
style: {
|
|
|
stroke: '#d0d0d0',
|
|
|
lineWidth: 1,
|
|
|
+ lineDash: [4, 5],
|
|
|
strokeOpacity: 0.7
|
|
|
}
|
|
|
}
|
|
@@ -492,13 +574,11 @@ const option = {
|
|
|
},
|
|
|
line: {
|
|
|
style: {
|
|
|
- stroke: 'rgba(255,255,255,0)',
|
|
|
- lineWidth: 1
|
|
|
- },
|
|
|
- stroke: 'rgba(255,255,255,0)',
|
|
|
- lineWidth: 1
|
|
|
+ stroke: '#d0d0d0',
|
|
|
+ lineWidth: 0
|
|
|
+ }
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
export default {
|
|
|
category,
|
|
@@ -507,5 +587,6 @@ export default {
|
|
|
name,
|
|
|
option,
|
|
|
setting,
|
|
|
- dataHandler
|
|
|
+ dataHandler,
|
|
|
+ optionHandler
|
|
|
}
|