Skip to content

Commit

Permalink
docs: update docs of axis style
Browse files Browse the repository at this point in the history
  • Loading branch information
xile611 committed Dec 20, 2024
1 parent 2bbf9d1 commit f0fc87c
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 13 deletions.
42 changes: 31 additions & 11 deletions docs/assets/examples/en/axis/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand All @@ -23,26 +23,27 @@ 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

```javascript livedemo
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 }
]
}
],
Expand All @@ -54,14 +55,23 @@ const spec = {
title: {
visible: true,
space: 12,
text: '右轴标题'
text: 'Right axis title'
},
label: {
formatMethod: val => `${val}°C`,
style: {
fill: '#000'
}
},
unit: {
visible: true,
text: 'Unit of right axis',
style: {
// dx: -18,
dy: -8
// textAlign: 'right'
}
},
tick: {
visible: true,
tickStep: 2,
Expand All @@ -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`,
Expand Down Expand Up @@ -121,6 +140,7 @@ const spec = {
fill: '#000'
}
},

tick: {
inside: true,
tickSize: 8,
Expand Down
22 changes: 21 additions & 1 deletion docs/assets/examples/zh/axis/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand All @@ -23,6 +23,7 @@ option: lineChart#axes
- `tick` 坐标轴刻度线配置
- `grid` 坐标轴网格线配置
- `title` 坐标轴标题配置
- `unit` 坐标轴单位配置

## 代码演示

Expand Down Expand Up @@ -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,
Expand All @@ -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: {
Expand Down Expand Up @@ -121,6 +140,7 @@ const spec = {
fill: '#000'
}
},

tick: {
inside: true,
tickSize: 8,
Expand Down
Binary file added docs/public/vchart/preview/axis-style_1.13.1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/vchart/bundler.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f0fc87c

Please sign in to comment.