fix(chart): align ECharts components with theme tokens and load the full ECharts ESM bundle
This commit is contained in:
@@ -8,7 +8,7 @@ import { DeesChartEchartsBase } from '../dees-chart-echarts-base.js';
|
||||
import { demoFunc } from './demo.js';
|
||||
import { gaugeStyles } from './styles.js';
|
||||
import { renderChartGauge } from './template.js';
|
||||
import { getEchartsSeriesColors } from '../dees-chart-echarts-theme.js';
|
||||
import { getEchartsSeriesColors, getThemeColors } from '../dees-chart-echarts-theme.js';
|
||||
|
||||
export interface IGaugeThreshold {
|
||||
value: number;
|
||||
@@ -66,7 +66,7 @@ export class DeesChartGauge extends DeesChartEchartsBase {
|
||||
}
|
||||
|
||||
protected buildOption(): Record<string, any> {
|
||||
const isDark = !this.goBright;
|
||||
const colors = getThemeColors(this.goBright);
|
||||
const seriesColors = getEchartsSeriesColors(this.goBright);
|
||||
const primaryColor = seriesColors[0];
|
||||
|
||||
@@ -119,7 +119,7 @@ export class DeesChartGauge extends DeesChartEchartsBase {
|
||||
distance: -20,
|
||||
length: 6,
|
||||
lineStyle: {
|
||||
color: isDark ? 'hsl(0 0% 30%)' : 'hsl(0 0% 75%)',
|
||||
color: colors.borderStrong,
|
||||
width: 1,
|
||||
},
|
||||
},
|
||||
@@ -128,14 +128,14 @@ export class DeesChartGauge extends DeesChartEchartsBase {
|
||||
distance: -24,
|
||||
length: 10,
|
||||
lineStyle: {
|
||||
color: isDark ? 'hsl(0 0% 40%)' : 'hsl(0 0% 60%)',
|
||||
color: colors.textMuted,
|
||||
width: 2,
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
show: this.showTicks,
|
||||
distance: 30,
|
||||
color: isDark ? 'hsl(0 0% 50%)' : 'hsl(0 0% 45%)',
|
||||
color: colors.textMuted,
|
||||
fontSize: 11,
|
||||
},
|
||||
detail: {
|
||||
@@ -143,7 +143,7 @@ export class DeesChartGauge extends DeesChartEchartsBase {
|
||||
fontSize: 28,
|
||||
fontWeight: 600,
|
||||
offsetCenter: [0, '65%'],
|
||||
color: isDark ? 'hsl(0 0% 90%)' : 'hsl(0 0% 15%)',
|
||||
color: colors.textPrimary,
|
||||
formatter: `{value}${this.unit}`,
|
||||
},
|
||||
title: {
|
||||
|
||||
Reference in New Issue
Block a user