diff --git a/docs/assets/examples/en/axis/style.md b/docs/assets/examples/en/axis/style.md index 0ad68ea1cb..b793ae2dc8 100644 --- a/docs/assets/examples/en/axis/style.md +++ b/docs/assets/examples/en/axis/style.md @@ -4,7 +4,7 @@ group: axis title: General Style Configuration keywords: lineChart,comparison,trend,line,axis order: 25-1 -cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/vchart/preview/axis/style.png +cover: /vchart/preview/axis-style_1.13.1.png option: lineChart#axes --- @@ -23,6 +23,7 @@ For axis style configuration, configure through: - `tick` Coordinate axis scale line configuration - `grid` Coordinate axis grid line configuration - `title` Coordinate axis title configuration +- `unit` Coordinate axis unit configuration ## Demo source @@ -30,19 +31,19 @@ For axis style configuration, configure through: const spec = { type: 'line', theme: { - fontFamily: 'serif' // configure global font + fontFamily: 'serif' // Configure global fonts }, data: [ { id: 'line', values: [ - { x: '周一', y: 12 }, - { x: '周二', y: 13 }, - { x: '周三', y: 11 }, - { x: '周四', y: 10 }, - { x: '周五', y: 12 }, - { x: '周六', y: 14 }, - { x: '周日', y: 17 } + { x: 'Monday', y: 12 }, + { x: 'Tuesday', y: 13 }, + { x: 'Wednesday', y: 11 }, + { x: 'Thursday', y: 10 }, + { x: 'Friday', y: 12 }, + { x: 'Saturday', y: 14 }, + { x: 'Sunday', y: 17 } ] } ], @@ -54,7 +55,7 @@ const spec = { title: { visible: true, space: 12, - text: '右轴标题' + text: 'Right axis title' }, label: { formatMethod: val => `${val}°C`, @@ -62,6 +63,15 @@ const spec = { fill: '#000' } }, + unit: { + visible: true, + text: 'Unit of right axis', + style: { + // dx: -18, + dy: -8 + // textAlign: 'right' + } + }, tick: { visible: true, tickStep: 2, @@ -85,7 +95,16 @@ const spec = { title: { visible: true, space: 12, - text: '左轴标题' + text: 'Left axis title' + }, + unit: { + visible: true, + text: 'Unit of left axis', + style: { + // dx: -18, + dy: -8 + // textAlign: 'right' + } }, label: { formatMethod: val => `${val}°C`, @@ -121,6 +140,7 @@ const spec = { fill: '#000' } }, + tick: { inside: true, tickSize: 8, diff --git a/docs/assets/examples/zh/axis/style.md b/docs/assets/examples/zh/axis/style.md index 7e0f0a5177..2f0c4147df 100644 --- a/docs/assets/examples/zh/axis/style.md +++ b/docs/assets/examples/zh/axis/style.md @@ -4,7 +4,7 @@ group: axis title: 通用样式配置 keywords: lineChart,comparison,trend,line,axis order: 25-1 -cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/vchart/preview/axis/style.png +cover: /vchart/preview/axis-style_1.13.1.png option: lineChart#axes --- @@ -23,6 +23,7 @@ option: lineChart#axes - `tick` 坐标轴刻度线配置 - `grid` 坐标轴网格线配置 - `title` 坐标轴标题配置 +- `unit` 坐标轴单位配置 ## 代码演示 @@ -62,6 +63,15 @@ const spec = { fill: '#000' } }, + unit: { + visible: true, + text: 'Unit of right axis', + style: { + // dx: -18, + dy: -8 + // textAlign: 'right' + } + }, tick: { visible: true, tickStep: 2, @@ -87,6 +97,15 @@ const spec = { space: 12, text: 'Left axis title' }, + unit: { + visible: true, + text: 'Unit of left axis', + style: { + // dx: -18, + dy: -8 + // textAlign: 'right' + } + }, label: { formatMethod: val => `${val}°C`, style: { @@ -121,6 +140,7 @@ const spec = { fill: '#000' } }, + tick: { inside: true, tickSize: 8, diff --git a/docs/public/vchart/preview/axis-style_1.13.1.png b/docs/public/vchart/preview/axis-style_1.13.1.png new file mode 100644 index 0000000000..c43c571a8e Binary files /dev/null and b/docs/public/vchart/preview/axis-style_1.13.1.png differ diff --git a/packages/vchart/bundler.config.js b/packages/vchart/bundler.config.js index 252002a440..34dc0c8c4f 100644 --- a/packages/vchart/bundler.config.js +++ b/packages/vchart/bundler.config.js @@ -63,7 +63,7 @@ const crossEnvs = bundle_analyze_mode ? {} : { }, }; -const esEntries = ['index-harmony', 'index-harmony-simple']; +const esEntries = bundle_analyze_mode ? [] : ['index-harmony', 'index-harmony-simple']; const umdEntries = Object.keys(crossEnvs) .map(env => crossEnvs[env].input) .filter((input, index, arr) => arr.indexOf(input, 0) === index);