Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 53 additions & 38 deletions en/option/component/calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,29 +228,40 @@ Options:
+ 'start'
+ 'end'

### nameMap(string|Array) = 'en'
### nameMap(string|Array)

<ExampleUIControlEnum options="en,cn" default="en" />
<ExampleUIControlEnum options="EN,ZH" default="EN" />

Week text content, defaults to 'en';
It supports Chinese, English, and custom;
index 0 always means Sunday;
Week text content, defaults to 'en'. Since `v5.2.2`, it defaults to the specified `locale` name when [initializing charts](api.html#echarts.init). If not specified, it defaults to the auto-detected locale by the browser language.

It supports Chinese(`cn`), English(`en`), and customized array. Since `v5.2.2`, it also supports any built-in(`EN`/`ZH`) or other registered locale names (case-sensitive).

The index `0` always means `Sunday`.

Examples:
```js

// Before v5.2.2

// shortcut to English ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
nameMap: 'en'
nameMap: 'en',
// shortcut to Chinese ['日', '一', '二', '三', '四', '五', '六']
nameMap: 'cn',

// Since v5.2.2

// shortcut to English ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
nameMap: 'EN',
// shortcut to Chinese ['日', '一', '二', '三', '四', '五', '六']
nameMap: 'cn'
nameMap: 'ZH',

// Custom settings: mixed in English and Chinese or not displayed
// Customized: mixed in English and Chinese or not displayed
nameMap: ['S', '一', 'T', '三', '', '五', 'S'],

calendar: [{
dayLabel: {
nameMap: 'en'
// nameMap: 'en' // Before v5.2.2
nameMap: 'EN' // Since v5.2.2
}
}]
```
Expand Down Expand Up @@ -296,45 +307,49 @@ Options:
+ 'start'
+ 'end'

### nameMap(string|Array) = 'en'
### nameMap(string|Array)

<ExampleUIControlEnum options="EN,ZH" default="EN" />

<ExampleUIControlEnum options="en,cn" default="en" />
Month text content, defaults to 'en'. Since `v5.2.2`, it defaults to the specified `locale` name when [initializing charts](api.html#echarts.init). If not specified, it defaults to the auto-detected locale by the browser language.

Month text content, defaults to 'en';
It supports Chinese, English, and custom;
Index 0 always means Jan;
It supports Chinese(`cn`), English(`en`), and customized array. Since `v5.2.2`, it also supports any built-in(`EN`/`ZH`) or other registered locale names (case-sensitive).

The index `0` always means `Jan`.

Examples:
```js
// Shortcut to English [
'Jan', 'Feb', 'Mar',
'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep',
'Oct', 'Nov', 'Dec'
],
nameMap: 'en'

// Shortcut to Chinese [
'一月', '二月', '三月',
'四月', '五月', '六月',
'七月', '八月', '九月',
'十月', '十一月', '十二月'
]
nameMap: 'cn'

// Custom settings: mixed in English and Chinese or not displayed
nameMap: [
'一月', 'Feb', '三月',
'四月', 'May', '六月',
'七月', '八月', '',
'十月', 'Nov', '十二月'
],

// Before v5.2.2

// Shortcut to English
// ['Jan', 'Feb', 'Mar','Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
nameMap: 'en',
// Shortcut to Chinese
// ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
nameMap: 'cn',

// Since v5.2.2

// Shortcut to English
// ['Jan', 'Feb', 'Mar','Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
nameMap: 'EN',
// Shortcut to Chinese
// ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
nameMap: 'ZH',

// Customized settings: mixed in English, Chinese, Russian or not displayed
nameMap: [
'一月', 'Feb', '三月',
'四月', 'May', '六月',
'Июль', '八月', '',
'十月', 'Nov', '十二月'
],

calendar: [{
monthLabel: {
nameMap: 'en'
// nameMap: 'en' // Before v5.2.2
nameMap: 'EN' // Since v5.2.2
}
}]
```
Expand Down
92 changes: 57 additions & 35 deletions zh/option/component/calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,26 +278,40 @@ calendar: [{
+ 'start'
+ 'end'

### nameMap(string|Array) = 'en'
### nameMap(string|Array)

<ExampleUIControlEnum options="en,cn" default="en" />
<ExampleUIControlEnum options="EN,ZH" default="EN" />

星期显示的效果,默认为'en'
可设置中英文以及自定义
下标0为对应星期天的文字显示
星期显示的效果,默认为'en'。从 `v5.2.2` 起,默认为[初始化图表](api.html#echarts.init) 时指定的语言 `locale`,如未指定则根据浏览器语言自动侦测。

可设置中英文以及自定义。从 `v5.2.2` 起,还可以是任意内置(`ZH` / `EN`)或其他[已注册的语言包](api.html#echarts.registerLocale)名称(区分大小写)。

下标 `0` 为对应 `星期日` 的文字显示

使用示例:
```js
// 快捷设置英文 ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
nameMap: 'en'

// v5.2.2 以前版本

// 快捷设置英文 ['S', 'M', 'T', 'W', 'T', 'F', 'S']
nameMap: 'en',
// 快捷设置中文 ['日', '一', '二', '三', '四', '五', '六']
nameMap: 'cn'
nameMap: 'cn',

// v5.2.2 及以后版本

// 快捷设置英文 ['S', 'M', 'T', 'W', 'T', 'F', 'S']
nameMap: 'EN',
// 快捷设置中文 ['日', '一', '二', '三', '四', '五', '六']
nameMap: 'ZH',

// 自定义设置: 中英文混杂 或者不显示
nameMap: ['S', '一', 'T', '三', '', '五', 'S'],

calendar: [{
dayLabel: {
nameMap: 'en'
// nameMap: 'en' // v5.2.2 以前版本
nameMap: 'EN' // v5.2.2 及以后版本
}
}]
```
Expand Down Expand Up @@ -343,41 +357,49 @@ calendar: [{
+ 'start'
+ 'end'

### nameMap(string|Array) = 'en'
### nameMap(string|Array)

<ExampleUIControlEnum options="en,cn" default="en" />
<ExampleUIControlEnum options="EN,ZH" default="EN" />

月份显示的效果,默认为'en'
可设置中英文以及自定义
下标0为对应一月的文字显示
月份显示的效果,默认为'en'。从 `v5.2.2` 起,默认为[初始化图表](api.html#echarts.init) 时指定的语言 `locale`,如未指定则根据浏览器语言自动侦测。

可设置中英文以及自定义。从 `v5.2.2` 起,还可以是任意内置(`ZH` / `EN`)或其他[已注册的语言包](api.html#echarts.registerLocale)名称(区分大小写)。

下标 `0` 为对应 `1月` 的文字显示。

使用示例:
```js
// 快捷设置英文 [
'Jan', 'Feb', 'Mar',
'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep',
'Oct', 'Nov', 'Dec'
],
nameMap: 'en'
// 快捷设置中文 [
'一月', '二月', '三月',
'四月', '五月', '六月',
'七月', '八月', '九月',
'十月', '十一月', '十二月'
]
nameMap: 'cn'
// 自定义设置: 中英文混杂 或者不显示

// v5.2.2 以前版本

// 快捷设置英文
// ['Jan', 'Feb', 'Mar','Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
nameMap: 'en',
// 快捷设置中文
// ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
nameMap: 'cn',

// v5.2.2 及以后版本

// 快捷设置英文
// ['Jan', 'Feb', 'Mar','Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
nameMap: 'EN',
// 快捷设置中文
// ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
nameMap: 'ZH',

// 自定义设置:中英俄混杂 或者不显示
nameMap: [
'一月', 'Feb', '三月',
'四月', 'May', '六月',
'七月', '八月', '',
'十月', 'Nov', '十二月'
],
'一月', 'Feb', '三月',
'四月', 'May', '六月',
'Июль', '八月', '',
'十月', 'Nov', '十二月'
],

calendar: [{
monthLabel: {
nameMap: 'en'
// nameMap: 'en' // v5.2.2 以前版本
nameMap: 'EN' // v5.2.2 及以后版本
}
}]
```
Expand Down