diff --git a/packages/plots/src/core/plots/area/index.ts b/packages/plots/src/core/plots/area/index.ts index 07f739a33..979e8f3f7 100644 --- a/packages/plots/src/core/plots/area/index.ts +++ b/packages/plots/src/core/plots/area/index.ts @@ -20,6 +20,10 @@ export class Area extends Plot { scale: { y: { nice: true }, }, + axis: { + y: { title: false }, + x: { title: false }, + }, interaction: { tooltip: { shared: true, diff --git a/packages/plots/src/core/plots/bar/index.ts b/packages/plots/src/core/plots/bar/index.ts index 5aa4936d5..e6d03e976 100644 --- a/packages/plots/src/core/plots/bar/index.ts +++ b/packages/plots/src/core/plots/bar/index.ts @@ -21,6 +21,10 @@ export class Bar extends Plot { scale: { y: { nice: true }, }, + axis: { + y: { title: false }, + x: { title: false }, + }, interaction: { tooltip: { shared: true, diff --git a/packages/plots/src/core/plots/box/index.ts b/packages/plots/src/core/plots/box/index.ts index a9863a9e4..757733df7 100644 --- a/packages/plots/src/core/plots/box/index.ts +++ b/packages/plots/src/core/plots/box/index.ts @@ -11,21 +11,25 @@ export class Box extends Plot { public type = 'box'; /** - * 获取 折线图 默认配置项 + * 获取箱线图默认配置项 * 供外部使用 */ static getDefaultOptions(): Partial { return { type: 'view', children: [{ type: 'box' }], + axis: { + y: { title: false }, + x: { title: false }, + }, // 默认 tooltip tooltip: { items: [ - { name: "min", channel: "y" }, - { name: "q1", channel: "y1" }, - { name: "q2", channel: "y2" }, - { name: "q3", channel: "y3" }, - { name: "max", channel: "y4" }, + { name: 'min', channel: 'y' }, + { name: 'q1', channel: 'y1' }, + { name: 'q2', channel: 'y2' }, + { name: 'q3', channel: 'y3' }, + { name: 'max', channel: 'y4' }, ], }, }; diff --git a/packages/plots/src/core/plots/bullet/adaptor.ts b/packages/plots/src/core/plots/bullet/adaptor.ts index 8dc0715d8..d1447eb05 100644 --- a/packages/plots/src/core/plots/bullet/adaptor.ts +++ b/packages/plots/src/core/plots/bullet/adaptor.ts @@ -135,11 +135,6 @@ export function adaptor(params: Params) { if (layout !== 'horizontal') { const target = params.options.children[2]; target.shapeField = 'hyphen'; - target.labels[0] = { - text: target.labels[0].text, - position: 'bottom', - dy: -5, - }; } return params; diff --git a/packages/plots/src/core/plots/bullet/index.ts b/packages/plots/src/core/plots/bullet/index.ts index d300db2e3..fd956d6a4 100644 --- a/packages/plots/src/core/plots/bullet/index.ts +++ b/packages/plots/src/core/plots/bullet/index.ts @@ -29,11 +29,15 @@ export class Bullet extends Plot { }, }, }, + axis: { + y: { title: false }, + x: { title: false }, + }, children: [ { type: 'interval', style: { maxWidth: 30 }, - axis: { y: { grid: true, gridLineWidth: 2 }, x: { title: false } }, + axis: { y: { grid: true, gridLineWidth: 2 } }, }, { type: 'interval', diff --git a/packages/plots/src/core/plots/column/index.ts b/packages/plots/src/core/plots/column/index.ts index 6f73e042e..d8b2240ad 100644 --- a/packages/plots/src/core/plots/column/index.ts +++ b/packages/plots/src/core/plots/column/index.ts @@ -24,6 +24,10 @@ export class Column extends Plot { shared: true, }, }, + axis: { + y: { title: false }, + x: { title: false }, + }, children: [ { type: 'interval', diff --git a/packages/plots/src/core/plots/dual-axes/index.ts b/packages/plots/src/core/plots/dual-axes/index.ts index 65441aa4e..a5c0e9d83 100644 --- a/packages/plots/src/core/plots/dual-axes/index.ts +++ b/packages/plots/src/core/plots/dual-axes/index.ts @@ -14,7 +14,13 @@ export class DualAxes extends Plot { * 供外部使用 */ static getDefaultOptions(): Partial { - return { type: 'view' }; + return { + type: 'view', + axis: { + y: { title: false }, + x: { title: false }, + }, + }; } /** diff --git a/packages/plots/src/core/plots/histogram/index.ts b/packages/plots/src/core/plots/histogram/index.ts index a12312ec7..1e2aac0fb 100644 --- a/packages/plots/src/core/plots/histogram/index.ts +++ b/packages/plots/src/core/plots/histogram/index.ts @@ -17,6 +17,10 @@ export class Histogram extends Plot { return { type: 'view', autoFit: true, + axis: { + y: { title: false }, + x: { title: false }, + }, children: [ { type: 'rect', diff --git a/packages/plots/src/core/plots/line/index.ts b/packages/plots/src/core/plots/line/index.ts index b705304cb..1a8628d37 100644 --- a/packages/plots/src/core/plots/line/index.ts +++ b/packages/plots/src/core/plots/line/index.ts @@ -24,6 +24,10 @@ export class Line extends Plot { shared: true, }, }, + axis: { + y: { title: false }, + x: { title: false }, + }, animate: { enter: { type: 'growInX' }, }, diff --git a/packages/plots/src/core/plots/scatter/index.ts b/packages/plots/src/core/plots/scatter/index.ts index 8f0dafcfa..747cfd162 100644 --- a/packages/plots/src/core/plots/scatter/index.ts +++ b/packages/plots/src/core/plots/scatter/index.ts @@ -16,6 +16,13 @@ export class Scatter extends Plot { */ static getDefaultOptions(): Partial { return { + axis: { + y: { title: false }, + x: { title: false }, + }, + legend: { + size: false, + }, children: [{ type: 'point' }], }; }