fix: 去除vchart标签描边

This commit is contained in:
skie1997 2025-06-17 11:08:43 +08:00
parent 076c174cb7
commit 4439a48f45
3 changed files with 5522 additions and 4507 deletions

9969
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
import { cloneDeep } from "lodash" import { cloneDeep } from 'lodash'
export default (chartProps: any) => { export default (chartProps: any) => {
const spec = cloneDeep(chartProps) const spec = cloneDeep(chartProps)
@ -18,17 +18,28 @@ export default (chartProps: any) => {
// axis // axis
const { name: xAxisName, ...restXAxisProps } = chartProps.xAxis const { name: xAxisName, ...restXAxisProps } = chartProps.xAxis
const { name: yAxisName, ...restYAxisProps } = chartProps.yAxis const { name: yAxisName, ...restYAxisProps } = chartProps.yAxis
spec.axes = [{ spec.axes = [
orient: 'bottom', {
...restXAxisProps, orient: 'bottom',
// paddingInner: 0.5 ...restXAxisProps
}, { // paddingInner: 0.5
orient: 'left', },
...restYAxisProps {
}] orient: 'left',
...restYAxisProps
}
]
delete spec.xAxis delete spec.xAxis
delete spec.yAxis delete spec.yAxis
spec.label = {
...spec.label,
style: {
...spec.label?.style,
lineWidth: 0
}
}
// console.log('spec-bar-transform', spec) // console.log('spec-bar-transform', spec)
return spec return spec
} }

View File

@ -1,4 +1,4 @@
import { cloneDeep } from "lodash" import { cloneDeep } from 'lodash'
export default (chartProps: any) => { export default (chartProps: any) => {
const spec = cloneDeep(chartProps) const spec = cloneDeep(chartProps)
@ -18,15 +18,26 @@ export default (chartProps: any) => {
// axis // axis
const { name: xAxisName, ...restXAxisProps } = chartProps.xAxis const { name: xAxisName, ...restXAxisProps } = chartProps.xAxis
const { name: yAxisName, ...restYAxisProps } = chartProps.yAxis const { name: yAxisName, ...restYAxisProps } = chartProps.yAxis
spec.axes = [{ spec.axes = [
orient: 'bottom', {
...restXAxisProps orient: 'bottom',
}, { ...restXAxisProps
orient: 'left', },
...restYAxisProps {
}] orient: 'left',
...restYAxisProps
}
]
delete spec.xAxis delete spec.xAxis
delete spec.yAxis delete spec.yAxis
spec.label = {
...spec.label,
style: {
...spec.label?.style,
lineWidth: 0
}
}
// console.log('spec-line-transform', spec) // console.log('spec-line-transform', spec)
return spec return spec
} }