110 lines
2.3 KiB
TypeScript
110 lines
2.3 KiB
TypeScript
/*
|
||
* This file is part of the kernelstudio package.
|
||
*
|
||
* (c) 2014-2026 zlin <admin@kernelstudio.com>
|
||
*
|
||
* For the full copyright and license information, please view the LICENSE file
|
||
* that was distributed with this source code.
|
||
*/
|
||
|
||
export const commonAxisConfig = {
|
||
axisLabel: {
|
||
color: '#eee',
|
||
fontSize: 12
|
||
},
|
||
axisLine: {
|
||
lineStyle: {
|
||
color: '#1e3150'
|
||
}
|
||
},
|
||
axisTick: {
|
||
lineStyle: {
|
||
color: '#1e3150'
|
||
}
|
||
},
|
||
splitLine: {
|
||
lineStyle: {
|
||
color: 'rgba(255, 255, 255, 0.1)'
|
||
}
|
||
}
|
||
};
|
||
|
||
export const getRadialGradient = (colorStart: string, colorEnd: string) => {
|
||
return {
|
||
type: 'radial', // 径向渐变(饼图首选)
|
||
x: 0.5, // 渐变中心x坐标(0-1,0.5为饼图中心)
|
||
y: 0.5, // 渐变中心y坐标
|
||
r: 0.5, // 渐变半径(0-1,0.5适配饼图内半径到外半径)
|
||
colorStops: [
|
||
{ offset: 0, color: colorStart }, // 中心颜色(深)
|
||
{ offset: 1, color: colorEnd } // 边缘颜色(浅)
|
||
],
|
||
global: false // 局部渐变(仅作用于当前扇区)
|
||
};
|
||
};
|
||
|
||
export const getVerticalGradient = (colorStart: string, colorEnd: string) => {
|
||
return {
|
||
type: 'linear',
|
||
x: 0,
|
||
y: 0,
|
||
x2: 0,
|
||
y2: 1,
|
||
colorStops: [
|
||
{ offset: 0, color: colorStart }, // 顶部颜色(深)
|
||
{ offset: 1, color: colorEnd } // 底部颜色(浅)
|
||
]
|
||
};
|
||
};
|
||
|
||
export const xAxisConfig = {
|
||
splitLine: {
|
||
show: true,
|
||
lineStyle: {
|
||
color: 'rgba(255, 255, 255, 0.1)' // 网格线颜色(半透明白色)
|
||
}
|
||
},
|
||
axisLabel: {
|
||
color: '#eee',
|
||
textStyle: {
|
||
color: '#EEE', // 标题字体颜色
|
||
fontSize: 14
|
||
}
|
||
},
|
||
axisLine: {
|
||
show: true,
|
||
lineStyle: {
|
||
color: '#1e3150' // X轴线颜色(可选)
|
||
},
|
||
textStyle: {
|
||
color: '#EEE', // 标题字体颜色
|
||
fontSize: 14
|
||
}
|
||
},
|
||
}
|
||
|
||
export const yAxisConfig = {
|
||
splitLine: {
|
||
show: true,
|
||
lineStyle: {
|
||
color: 'rgba(255, 255, 255, 0.1)' // 网格线颜色(半透明白色)
|
||
}
|
||
},
|
||
axisLabel: {
|
||
color: '#eee',
|
||
textStyle: {
|
||
color: '#EEE', // 标题字体颜色
|
||
fontSize: 14
|
||
}
|
||
},
|
||
axisLine: {
|
||
show: true,
|
||
lineStyle: {
|
||
color: '#1e3150' // X轴线颜色(可选)
|
||
},
|
||
textStyle: {
|
||
color: '#EEE', // 标题字体颜色
|
||
fontSize: 14
|
||
}
|
||
},
|
||
} |