提交 8d1f4f68 authored 作者: junjun's avatar junjun

feat: 仪表盘刻度大小自适应

上级 3e8fec74
...@@ -51,6 +51,25 @@ export function baseGaugeOption(chart_option, chart, scale = 1) { ...@@ -51,6 +51,25 @@ export function baseGaugeOption(chart_option, chart, scale = 1) {
value: chart.data.series[0].data[0] value: chart.data.series[0].data[0]
} }
chart_option.series[0].data.push(y) chart_option.series[0].data.push(y)
chart_option.series[0].axisTick = {
splitNumber: getScaleValue(5, scale), // 刻度间隔数
length: getScaleValue(10, scale), // 子刻度线长度
lineStyle: {
width: getScaleValue(2, scale) // 子刻度线宽度
}
}
chart_option.series[0].splitLine = {
length: getScaleValue(18, scale), // 刻度线长度
lineStyle: {
width: getScaleValue(2, scale) // 刻度线宽度
}
}
chart_option.series[0].axisLabel = {
distance: getScaleValue(20, scale), // 刻度值文字里刻度线距离
fontSize: getScaleValue(20, scale)// 刻度值字体大小
}
// threshold // threshold
if (chart.senior) { if (chart.senior) {
const range = [] const range = []
...@@ -107,42 +126,6 @@ export function baseGaugeOption(chart_option, chart, scale = 1) { ...@@ -107,42 +126,6 @@ export function baseGaugeOption(chart_option, chart, scale = 1) {
distance: getScaleValue(20, scale), // 刻度值文字里刻度线距离 distance: getScaleValue(20, scale), // 刻度值文字里刻度线距离
fontSize: getScaleValue(20, scale)// 刻度值字体大小 fontSize: getScaleValue(20, scale)// 刻度值字体大小
} }
} else {
chart_option.series[0].axisTick = {
splitNumber: getScaleValue(5, scale), // 刻度间隔数
length: getScaleValue(10, scale), // 子刻度线长度
lineStyle: {
width: getScaleValue(2, scale) // 子刻度线宽度
}
}
chart_option.series[0].splitLine = {
length: getScaleValue(18, scale), // 刻度线长度
lineStyle: {
width: getScaleValue(2, scale) // 刻度线宽度
}
}
chart_option.series[0].axisLabel = {
distance: getScaleValue(20, scale), // 刻度值文字里刻度线距离
fontSize: getScaleValue(20, scale)// 刻度值字体大小
}
}
} else {
chart_option.series[0].axisTick = {
splitNumber: getScaleValue(5, scale), // 刻度间隔数
length: getScaleValue(10, scale), // 子刻度线长度
lineStyle: {
width: getScaleValue(2, scale) // 子刻度线宽度
}
}
chart_option.series[0].splitLine = {
length: getScaleValue(18, scale), // 刻度线长度
lineStyle: {
width: getScaleValue(2, scale) // 刻度线宽度
}
}
chart_option.series[0].axisLabel = {
distance: getScaleValue(20, scale), // 刻度值文字里刻度线距离
fontSize: getScaleValue(12, scale)// 刻度值字体大小
} }
} }
} }
......
...@@ -87,7 +87,7 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) { ...@@ -87,7 +87,7 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) {
} }
}, },
subTickLine: { subTickLine: {
count: 4, // TODO 子刻度数 count: 4, // 子刻度数
length: getScaleValue(6, scale) * -1, // 子刻度线长度 length: getScaleValue(6, scale) * -1, // 子刻度线长度
style: { style: {
lineWidth: getScaleValue(1, scale)// 子刻度线宽度 lineWidth: getScaleValue(1, scale)// 子刻度线宽度
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论