Skip to content

Commit

Permalink
fix: fix transform bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoluoHe committed Aug 13, 2024
1 parent 1709317 commit 65ae8f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function toEChartsAxisPointer(component: ITheme['component'], theme: IThe
const axisPointerTheme = {
type: 'shadow',
trigger: 'axis',
show: true
z: 0
} as any;

const { crosshair } = component;
Expand Down
5 changes: 4 additions & 1 deletion packages/vchart-theme-converter/src/echarts/series/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export function toEChartsLine(lineSeries: ISeriesTheme['line'], theme: ITheme) {

if (point) {
const { style = {} } = point;
const itemStyle = convertToItemStyle(style, lineStyleMap, theme);
const itemStyle = convertToItemStyle(style, symbolStyleMap, theme);
// vchart 的空心点需要配置 color: 'white', stroke: 'auto' (示意),直接转换到 echarts 会导致 fill 和 stroke 都是白色;
// echarts 的空心点与实心点,通过 symbolType 控制,无法根据主题识别;需要用户自己处理
delete itemStyle.color;
lineTheme.itemStyle = itemStyle;
if ('symbolType' in style) {
lineTheme.symbol = style.symbolType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ export function convertSeries(series: ITheme['series'], theme: ITheme) {
VCHART_SERIES_TYPES.forEach(type => {
if (toEChartsConverter[type]) {
if (type === 'area') {
if (!result.line) {
result.line = {};
}
result.line = merge(result.line, toEChartsConverter[type](series[type], theme));
// 暂不处理 area 系列配置,原因:echarts.line.areaStyle 一旦有默认值,折线图就会默认变成面积图
// if (!result.line) {
// result.line = {};
// }
// result.line = merge(result.line, toEChartsConverter[type](series[type], theme));
} else {
// 这里后续可能存在问题:vchart series type 和 echarts series type 不一致
result[type] = merge(result[type] ?? {}, toEChartsConverter[type]((series as any)[type], theme));
Expand Down

0 comments on commit 65ae8f5

Please sign in to comment.