mirror of https://github.com/veops/cmdb.git
parent
59d9f2c79a
commit
f9ee895f58
|
@ -24,7 +24,7 @@ export const category_1_bar_options = (data, options) => {
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
|
|
||||||
color: options.chartColor.split(','),
|
color: (options?.chartColor ?? '#6592FD,#6EE3EB,#44C2FD,#5F59F7,#1A348F,#7D8FCF,#A6D1E5,#8E56DD').split(','),
|
||||||
grid: {
|
grid: {
|
||||||
top: 15,
|
top: 15,
|
||||||
left: 'left',
|
left: 'left',
|
||||||
|
@ -83,7 +83,7 @@ export const category_1_bar_options = (data, options) => {
|
||||||
export const category_1_line_options = (data, options) => {
|
export const category_1_line_options = (data, options) => {
|
||||||
const xData = Object.keys(data)
|
const xData = Object.keys(data)
|
||||||
return {
|
return {
|
||||||
color: options.chartColor.split(','),
|
color: (options?.chartColor ?? '#6592FD,#6EE3EB,#44C2FD,#5F59F7,#1A348F,#7D8FCF,#A6D1E5,#8E56DD').split(','),
|
||||||
grid: {
|
grid: {
|
||||||
top: 15,
|
top: 15,
|
||||||
left: 'left',
|
left: 'left',
|
||||||
|
@ -117,7 +117,7 @@ export const category_1_line_options = (data, options) => {
|
||||||
x2: 0,
|
x2: 0,
|
||||||
y2: 1,
|
y2: 1,
|
||||||
colorStops: [{
|
colorStops: [{
|
||||||
offset: 0, color: options.chartColor.split(',')[0] // 0% 处的颜色
|
offset: 0, color: (options?.chartColor ?? '#6592FD,#6EE3EB,#44C2FD,#5F59F7,#1A348F,#7D8FCF,#A6D1E5,#8E56DD').split(',')[0] // 0% 处的颜色
|
||||||
}, {
|
}, {
|
||||||
offset: 1, color: '#ffffff' // 100% 处的颜色
|
offset: 1, color: '#ffffff' // 100% 处的颜色
|
||||||
}],
|
}],
|
||||||
|
@ -131,7 +131,7 @@ export const category_1_line_options = (data, options) => {
|
||||||
|
|
||||||
export const category_1_pie_options = (data, options) => {
|
export const category_1_pie_options = (data, options) => {
|
||||||
return {
|
return {
|
||||||
color: options.chartColor.split(','),
|
color: (options?.chartColor ?? '#6592FD,#6EE3EB,#44C2FD,#5F59F7,#1A348F,#7D8FCF,#A6D1E5,#8E56DD').split(','),
|
||||||
grid: {
|
grid: {
|
||||||
top: 10,
|
top: 10,
|
||||||
left: 'left',
|
left: 'left',
|
||||||
|
@ -181,7 +181,7 @@ export const category_2_bar_options = (data, options, chartType) => {
|
||||||
})
|
})
|
||||||
const legend = [...new Set(_legend)]
|
const legend = [...new Set(_legend)]
|
||||||
return {
|
return {
|
||||||
color: options.chartColor.split(','),
|
color: (options?.chartColor ?? '#6592FD,#6EE3EB,#44C2FD,#5F59F7,#1A348F,#7D8FCF,#A6D1E5,#8E56DD').split(','),
|
||||||
grid: {
|
grid: {
|
||||||
top: 15,
|
top: 15,
|
||||||
left: 'left',
|
left: 'left',
|
||||||
|
@ -249,7 +249,7 @@ export const category_2_bar_options = (data, options, chartType) => {
|
||||||
x2: 0,
|
x2: 0,
|
||||||
y2: 1,
|
y2: 1,
|
||||||
colorStops: [{
|
colorStops: [{
|
||||||
offset: 0, color: options.chartColor.split(',')[index % 8] // 0% 处的颜色
|
offset: 0, color: (options?.chartColor ?? '#6592FD,#6EE3EB,#44C2FD,#5F59F7,#1A348F,#7D8FCF,#A6D1E5,#8E56DD').split(',')[index % 8] // 0% 处的颜色
|
||||||
}, {
|
}, {
|
||||||
offset: 1, color: '#ffffff' // 100% 处的颜色
|
offset: 1, color: '#ffffff' // 100% 处的颜色
|
||||||
}],
|
}],
|
||||||
|
@ -269,7 +269,7 @@ export const category_2_pie_options = (data, options) => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
color: options.chartColor.split(','),
|
color: (options?.chartColor ?? '#6592FD,#6EE3EB,#44C2FD,#5F59F7,#1A348F,#7D8FCF,#A6D1E5,#8E56DD').split(','),
|
||||||
grid: {
|
grid: {
|
||||||
top: 15,
|
top: 15,
|
||||||
left: 'left',
|
left: 'left',
|
||||||
|
|
Loading…
Reference in New Issue