diff --git a/core/frontend/src/views/chart/chart/bar/bar_antv.js b/core/frontend/src/views/chart/chart/bar/bar_antv.js index 809d81e0f4..d9010fc981 100644 --- a/core/frontend/src/views/chart/chart/bar/bar_antv.js +++ b/core/frontend/src/views/chart/chart/bar/bar_antv.js @@ -608,11 +608,13 @@ export function stockLineOptionAntV(container, chart, action) { const theme = getTheme(chart) const legend = getLegend(chart) const basicStyle = JSON.parse(chart.customAttr).color - const colors = [] + let colors = [] const alpha = basicStyle.alpha basicStyle.colors.forEach(ele => { colors.push(hexColorToRGBA(ele, alpha)) }) + // custom color + colors = antVCustomColor(chart) const data = cloneDeep(chart.data?.tableRow ?? []) // 时间字段 diff --git a/core/frontend/src/views/chart/chart/util.js b/core/frontend/src/views/chart/chart/util.js index 340459a379..c14c5b5306 100644 --- a/core/frontend/src/views/chart/chart/util.js +++ b/core/frontend/src/views/chart/chart/util.js @@ -3761,6 +3761,15 @@ export function getColors(chart, colors, reset) { }) } } + } else if (equalsAny(chart.type, 'stock-line')) { + const averages = ['MA5', 'MA10', 'MA20', 'MA60', 'MA120', 'MA180'] + for (let i = 0; i < averages.length; i++) { + seriesColors.push({ + name: averages[i], + color: colors[i % colors.length], + isCustom: false + }) + } } else { if (chart.data) { const data = chart.data.data