fix(StockCompareModal): 修复对比图表图例颜色模糊问题
- chartOptions.ts: 完善 getCompareBarChartOption 黑金主题配置 - 添加 legend.textStyle.color 使图例文字清晰可见 - 添加 tooltip、axisLine、splitLine 等主题颜色配置 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -308,7 +308,7 @@ export const getMainBusinessPieOption = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成对比柱状图配置
|
* 生成对比柱状图配置 - 黑金主题
|
||||||
* @param title 标题
|
* @param title 标题
|
||||||
* @param stockName1 股票1名称
|
* @param stockName1 股票1名称
|
||||||
* @param stockName2 股票2名称
|
* @param stockName2 股票2名称
|
||||||
@@ -326,13 +326,50 @@ export const getCompareBarChartOption = (
|
|||||||
data2: (number | undefined)[]
|
data2: (number | undefined)[]
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
tooltip: { trigger: 'axis' },
|
backgroundColor: 'transparent',
|
||||||
legend: { data: [stockName1, stockName2] },
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
backgroundColor: chartTheme.tooltip.bg,
|
||||||
|
borderColor: chartTheme.tooltip.border,
|
||||||
|
textStyle: {
|
||||||
|
color: '#E2E8F0',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: [stockName1, stockName2],
|
||||||
|
textStyle: {
|
||||||
|
color: '#E2E8F0',
|
||||||
|
},
|
||||||
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: categories,
|
data: categories,
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: chartTheme.axisLine,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: '#A0AEC0',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
axisLabel: {
|
||||||
|
formatter: '{value}%',
|
||||||
|
color: '#A0AEC0',
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: chartTheme.axisLine,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
color: chartTheme.splitLine,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
yAxis: { type: 'value', axisLabel: { formatter: '{value}%' } },
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: stockName1,
|
name: stockName1,
|
||||||
|
|||||||
Reference in New Issue
Block a user