Skip to content

Commit 7054864

Browse files
authored
Merge pull request #467 from apache/doc-6.0
fix docs
2 parents 8b252bb + cec76fb commit 7054864

6 files changed

Lines changed: 79 additions & 13 deletions

File tree

en/api/echarts-instance.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,35 @@ myChart.setOption({
238238
})
239239
```
240240

241+
## setTheme(Function)
242+
243+
```ts
244+
(
245+
theme: string | Object
246+
opts?: {
247+
silent? boolean
248+
}
249+
) => void
250+
```
251+
252+
Sets the theme for the chart instance.
253+
254+
+ `theme`: When `string`: Represents the `themeName` registered via [echarts.registerTheme](~echarts.registerTheme). When `Object`: An anonymous theme object that will be directly applied.
255+
+ `opts.silent` Specify whether or not to prevent triggering events.
256+
257+
Here is a demo of dynamically setting a theme after initialization:
258+
259+
```js
260+
const chart = echarts.init(...);
261+
chart.setOption(...);
262+
// Method 1: Register and apply a named theme
263+
echarts.registerTheme('myTheme', {backgroundColor: 'red'});
264+
chart.setTheme('myTheme');
265+
// Method 2: Apply an anonymous theme directly
266+
chart.setTheme({backgroundColor: 'red'});
267+
```
268+
269+
If there are no other charts using this theme, the above two methods are the same. If not, you should use the former one, so that `setTheme('myTheme')` can be used in other charts.
241270

242271
## resize(Function)
243272
```ts

en/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## v6.0.0-beta.1
1+
## v6.0.0
22

33
+ [Feature] [theme] New theme for ECharts 6.0. [#20865](https://github.com/apache/echarts/issues/20865) [#21097](https://github.com/apache/echarts/issues/21097) [#21114](https://github.com/apache/echarts/issues/21114) ([Ovilia](https://github.com/Ovilia))
44
+ [Feature] [chord] New chord series. [#20522](https://github.com/apache/echarts/issues/20522) ([Ovilia](https://github.com/Ovilia))

en/option/partial/mark-point.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,13 @@ Y position according to container, in pixel.
173173
version = "6.0.0"
174174
) }}
175175

176+
Specify the relationship of overlap between graphic elements. A bigger value means higher.
176177

177-
###${prefix} relativeTo('container' | 'coordinate')
178+
###${prefix} relativeTo(string)
178179

179180
{{ use: partial-version(version: '6.0.0') }}
180181

181-
Specify whether the positions of [x](~series-${seriesType}.markPoint.data.x) and [y](~series-${seriesType}.markPoint.data.y) are relative to the entire chart container (`'container'`, default) or the grid coordinate system (`'coordinate'`).
182-
183-
Specify the relationship of overlap between graphic elements. A bigger value means higher.
182+
Options: `'container'` or `'coordinate'`. Specify whether the positions of [x](~series-${seriesType}.markPoint.data.x) and [y](~series-${seriesType}.markPoint.data.y) are relative to the entire chart container (`'container'`, default) or the grid coordinate system (`'coordinate'`).
184183

185184
###${prefix} value(number)
186185

zh/api/echarts-instance.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,36 @@ myChart.setOption({
236236
})
237237
```
238238

239+
## setTheme(Function)
240+
241+
```ts
242+
(
243+
theme: string | Object
244+
opts?: {
245+
silent? boolean
246+
}
247+
) => void
248+
```
249+
250+
设置图表实例的主题。
251+
252+
+ `theme``string` 时,表示的是使用在图表实例初始化前调用 [echarts.registerTheme](~echarts.registerTheme) 注册主题时使用的 `themeName`;当其为 `Object` 时,表示一个匿名的主题对象,并且直接使用该主题。
253+
+ `opts.silent` 表示是否禁止抛出事件。默认为 `false`
254+
255+
以下是一个动态设置主题的例子:
256+
257+
```js
258+
const chart = echarts.init(...);
259+
chart.setOption(...);
260+
// 图表已经初始化了,也可以调用 registerTheme 和 setTheme
261+
echarts.registerTheme('myTheme', {backgroundColor: 'red'});
262+
chart.setTheme('myTheme');
263+
// 或者直接
264+
chart.setTheme({backgroundColor: 'red'});
265+
```
266+
267+
如果这个主题不在其他图表中使用,那么这两种方式是等价的,否则应使用前一种,这样在其他图表中也可以使用 `setTheme('myTheme')` 使用该主题。
268+
239269
## resize(Function)
240270
```ts
241271
(opts?: {

zh/changelog.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
## v6.0.0-beta.1
1+
## v6.0.0
22

33
+ [Feature] [theme] ECharts 6.0 新主题。 [#20865](https://github.com/apache/echarts/issues/20865) ([Ovilia](https://github.com/Ovilia))
4-
+ [Feature] [chord] 新增和弦图系列。 [#20522](https://github.com/apache/echarts/issues/20522) ([Ovilia](https://github.com/Ovilia))
5-
+ [Feature] [matrix&calendar] 新增矩阵坐标系。并且所有的系列和组件 (包括其他坐标系组件,例如 `grid` (直角坐标系) `geo` `polar` 等) 支持声明式地布局在矩阵坐标系或日历坐标系的格中。 [#19807](https://github.com/apache/echarts/issues/19807) ([Ovilia](https://github.com/Ovilia)) [#21005](https://github.com/apache/echarts/issues/21005) ([100pah](https://github.com/100pah))
4+
+ [Feature] [chord] 新增和弦图系列。 [#20522](https://github.com/apache/echarts/issues/20522) ([Ovilia](https://github.com/Ovilia)) [#21097](https://github.com/apache/echarts/issues/21097) [#21114](https://github.com/apache/echarts/issues/21114) ([Ovilia](https://github.com/Ovilia))
5+
+ [Feature] [matrix&calendar] 新增矩阵坐标系。并且所有的系列和组件 (包括其他坐标系组件,例如 `grid` (直角坐标系) `geo` `polar` 等) 支持声明式地布局在矩阵坐标系或日历坐标系的格中。 [#19807](https://github.com/apache/echarts/issues/19807) [#21093](https://github.com/apache/echarts/pull/21093) ([Ovilia](https://github.com/Ovilia)) [#21005](https://github.com/apache/echarts/issues/21005) [#21108](https://github.com/apache/echarts/issues/21108) ([100pah](https://github.com/100pah))
66
+ [Feature] [custom] 支持可复用的自定义系列。 [#20226](https://github.com/apache/echarts/issues/20226) ([Ovilia](https://github.com/Ovilia))
7-
+ [Feature] [cartesian] 引入新的布局方式避免直角坐标系 (`grid` 组件) 的坐标轴标签 (`axisLabel`) 和坐标轴名称 (`axisName`) 超出可视范围,以及避免他们重叠。并且设为默认。 [#21059](https://github.com/apache/echarts/pull/21059) ([100pah](https://github.com/100pah)), [#19534](https://github.com/apache/echarts/pull/19534) ([robin-gerling](https://github.com/robin-gerling)), [#16825](https://github.com/apache/echarts/pull/16825) ([konrad-amtenbrink](https://github.com/konrad-amtenbrink)).
7+
+ [Feature] [cartesian] 引入新的布局方式避免直角坐标系 (`grid` 组件) 的坐标轴标签 (`axisLabel`) 和坐标轴名称 (`axisName`) 超出可视范围,以及避免他们重叠。并且设为默认。 [#21059](https://github.com/apache/echarts/pull/21059) ([100pah](https://github.com/100pah)) [#19534](https://github.com/apache/echarts/pull/19534) ([robin-gerling](https://github.com/robin-gerling)) [#16825](https://github.com/apache/echarts/pull/16825) ([konrad-amtenbrink](https://github.com/konrad-amtenbrink))
88
+ [Feature] [scatter] 支持散点图系列的抖动。 [#19941](https://github.com/apache/echarts/issues/19941) ([Ovilia](https://github.com/Ovilia))
99
+ [Feature] [axis] 支持坐标轴断轴。 [#19459](https://github.com/apache/echarts/issues/19459) ([Ovilia](https://github.com/Ovilia)) [#20857](https://github.com/apache/echarts/issues/20857) ([100pah](https://github.com/100pah))
1010
+ [Feature] [theme] 支持动态注册和切换主题。 [#20705](https://github.com/apache/echarts/issues/20705) ([Ovilia](https://github.com/Ovilia))
11-
+ [Feature] [roam] 缩放平移的基础设施升级 - 支持用户指定 (`roamTrigger`) 可触发缩放平移的区域;支持 `clip` (于 `geo``series.map`);支持鼠标指针样式变化以提示缩放平移区域;支持 `preserveAspect` (于 `geo``series.map``series.graph`);修复 `center` 的百分比基准 (于 `geo``series.map``series.graph``series.tree`);优化缩放平移区域重叠时的表现。 [#19807#issuecomment-2974437299](https://github.com/apache/echarts/pull/19807#issuecomment-2974437299) ([100pah](https://github.com/100pah)).
11+
+ [Feature] [roam] 缩放平移的基础设施升级 - 支持用户指定 (`roamTrigger`) 可触发缩放平移的区域;支持 `clip` (于 `geo``series.map`);支持鼠标指针样式变化以提示缩放平移区域;支持 `preserveAspect` (于 `geo``series.map``series.graph`);修复 `center` 的百分比基准 (于 `geo``series.map``series.graph``series.tree`);优化缩放平移区域重叠时的表现。 [#19807#issuecomment-2974437299](https://github.com/apache/echarts/pull/19807#issuecomment-2974437299) ([100pah](https://github.com/100pah))
1212
+ [Feature] [thumbnail] 为关系图系列支持缩略图。 [#19807#issuecomment-3013454598](https://github.com/apache/echarts/pull/19807#issuecomment-3013454598) ([100pah](https://github.com/100pah)) [#17471](https://github.com/apache/echarts/issues/17471) ([Lruler](https://github.com/Lruler))
13+
+ [Feature] [marker] 标记点/标记线/标记区域 (`markPoint`/`markLine`/`markArea`) 支持 `z` 选项。 [#21117](https://github.com/apache/echarts/issues/21117) ([sz-p](https://github.com/sz-p))
1314
+ [Feature] [marker] 标记点/标记线/标记区域 (`markPoint`/`markLine`/`markArea`) 支持 `z2` 选项。 [#20782](https://github.com/apache/echarts/issues/20782) ([sz-p](https://github.com/sz-p))
1415
+ [Feature] [stack] 支持反转堆叠顺序。 [#20998](https://github.com/apache/echarts/issues/20998) ([Justin-ZS](https://github.com/Justin-ZS))
1516
+ [Feature] [sankey] 支持桑基图系列的交互缩放 (`roaming`)。 [#20321](https://github.com/apache/echarts/issues/20321) ([Ovilia](https://github.com/Ovilia))
1617
+ [Feature] [custom] 在自定义系列的 `renderItem` 中支持 `compoundPath`[#20402](https://github.com/apache/echarts/issues/20402) [#21040](https://github.com/apache/echarts/issues/21040) ([Ovilia](https://github.com/Ovilia))
1718
+ [Feature] [marker] 标记支持 `relativeTo` 相对坐标系的位置。 [#20166](https://github.com/apache/echarts/issues/20166) [#21042](https://github.com/apache/echarts/issues/21042) ([Ovilia](https://github.com/Ovilia))
1819
+ [Feature] [axis] 支持角度轴 (`angleAxis`) 标签的提示框 (`tooltip`)。 [#20986](https://github.com/apache/echarts/issues/20986) ([plainheart](https://github.com/plainheart))
1920
+ [Feature] [tooltip] 支持 `displayTransition` 选项以控制是否启用提示框显示过渡动画。 [#20966](https://github.com/apache/echarts/issues/20966) ([jqqin](https://github.com/jqqin))
20-
+ [Feature] [legend] 支持 `triggerEvent` 选项。 [#20907](https://github.com/apache/echarts/issues/20907) ([sz-p](https://github.com/sz-p))
21+
+ [Feature] [visualMap] 支持 `unboundedRange`[#21113](https://github.com/apache/echarts/pull/21113) ([100pah](https://github.com/100pah))
22+
+ [Feature] [legend] 支持 `triggerEvent`[#18164](https://github.com/apache/echarts/issues/18164) [#20907](https://github.com/apache/echarts/issues/20907) ([sz-p](https://github.com/sz-p))
2123
+ [Feature] [custom] 自定义系列 (`custom series`) 支持 `tooltipDisabled`[#20447](https://github.com/apache/echarts/issues/20447) ([Ovilia](https://github.com/Ovilia))
2224
+ [Feature] [i18n] 新增挪威博克马尔语 (nb-NO) 翻译。 [#20792](https://github.com/apache/echarts/issues/20792) ([joakimono](https://github.com/joakimono))
25+
+ [Feature] [i18n] 新增希腊语(EL)翻译。 [#21119](https://github.com/apache/echarts/pull/21119) ([tassosgeo](https://github.com/tassosgeo))
2326
+ [Fix] [label] 修复富文本样式不继承普通标签样式的问题。 [#20977](https://github.com/apache/echarts/issues/20977) ([plainheart](https://github.com/plainheart)) [#21016](https://github.com/apache/echarts/issues/21016) ([100pah](https://github.com/100pah))
27+
+ [Fix] [label] 修复标签布局的外边距。 [#21103](https://github.com/apache/echarts/pull/21103) ([100pah](https://github.com/100pah))
2428
+ [Fix] [dataZoom] 修复时间轴上数据形状分布的问题。 [#16978](https://github.com/apache/echarts/issues/16978) ([andrearoota](https://github.com/andrearoota)) [#21043](https://github.com/apache/echarts/issues/21043) [#21039](https://github.com/apache/echarts/issues/21039) ([Ovilia](https://github.com/Ovilia))
2529
+ [Fix] [tooltip] 修复类目轴上值为 `null` 的项应能显示提示框的问题。 [#20777](https://github.com/apache/echarts/issues/20777) ([Justin-ZS](https://github.com/Justin-ZS))
2630
+ [Fix] [visualMap] 修复部分文本样式在视觉映射 (`visualMap`) 上不起作用的问题。 [#20961](https://github.com/apache/echarts/issues/20961) ([plainheart](https://github.com/plainheart))
@@ -31,10 +35,14 @@
3135
+ [Fix] [pie] 修复当单个标签位置不在外部时,`labelLine` 可能未被移除并导致错误的问题。 [#20906](https://github.com/apache/echarts/issues/20906) ([plainheart](https://github.com/plainheart))
3236
+ [Fix] [sankey] 修复当 `emphasis.focus``'trajectory'` 时,处理大数据导致浏览器崩溃的问题。 [#20959](https://github.com/apache/echarts/issues/20959) ([plainheart](https://github.com/plainheart))
3337
+ [Fix] [custom] 修复应用离开过渡时可能出现的空指针异常 (NPE)。 [#20920](https://github.com/apache/echarts/issues/20920) ([plainheart](https://github.com/plainheart))
38+
+ [Fix] [tooltip] 通过显式解除事件监听以避免潜在的内存泄漏问题。 [#21087](https://github.com/apache/echarts/pull/21087) ([seaheart](https://github.com/seaheart))
39+
+ [Fix] [axis] [log] 修复不正确的精度使用,并且支持数据的大的负数指数。 [#21107](https://github.com/apache/echarts/pull/21107) ([SihongShen](https://github.com/SihongShen)) [#21120](https://github.com/apache/echarts/pull/21120) ([100pah](https://github.com/100pah))
40+
+ [Fix] [axis] 修复小的数据因为精度无法在直角坐标系展示的问题。 [#21120](https://github.com/apache/echarts/pull/21120) ([100pah](https://github.com/100pah)) ([SihongShen](https://github.com/SihongShen))
3441
+ [Fix] [dataZoom]`moveHandler` 的光标改为默认 (`default`)。 [#20304](https://github.com/apache/echarts/issues/20304) ([ribeirompl](https://github.com/ribeirompl))
3542
+ [Fix] [tooltip] 修复提示框关闭后用于样式坐标变换的标记点未被移除的问题。 [#20987](https://github.com/apache/echarts/issues/20987) ([plainheart](https://github.com/plainheart))
3643
+ [Fix] [bar]`BarSeriesOption` 接口中移除未使用的 `startValue` 选项。 [#20901](https://github.com/apache/echarts/issues/20901) ([plainheart](https://github.com/plainheart))
3744
+ [Fix] [title] 修复标题文本样式的宽度类型不应包含字符串的问题。 [#20800](https://github.com/apache/echarts/issues/20800) ([sz-p](https://github.com/sz-p))
45+
+ [Fix] [radar] 修复 `blur.itemStyle` 不生效的问题。 [#21081](https://github.com/apache/echarts/pull/21081) ([mustcanbedo](https://github.com/mustcanbedo)) [#21124](https://github.com/apache/echarts/issues/21124) ([Ovilia](https://github.com/Ovilia))
3846
+ [Fix] [roam] 修复 `RoamControllerHost` 的导入路径。 [#20313](https://github.com/apache/echarts/issues/20313) ([Ovilia](https://github.com/Ovilia))
3947
+ [Fix] [svg] 移除 `getSvgDataURL` 中的 SVG 支持检查。 [#20760](https://github.com/apache/echarts/issues/20760) ([plainheart](https://github.com/plainheart))
4048
+ [Break] 相对于 v5.6.0 的 Breaking changes:

zh/option/partial/mark-point.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ data: [{{ if: ${hasType} }}
175175

176176
指定图形元素间的覆盖关系。数值越大,越在层叠的上方。
177177

178-
###${prefix} relativeTo('container' | 'coordinate')
178+
###${prefix} relativeTo(string)
179179

180180
{{ use: partial-version(version: '6.0.0') }}
181181

182-
指定 [x](~series-${seriesType}.markPoint.data.x)[y](~series-${seriesType}.markPoint.data.y) 是相对于整个图表容器(`'container'`,默认值)还是直角坐标系(`'coordinate'`)而言的位置。
182+
可选值:`'container'``'coordinate'`指定 [x](~series-${seriesType}.markPoint.data.x)[y](~series-${seriesType}.markPoint.data.y) 是相对于整个图表容器(`'container'`,默认值)还是直角坐标系(`'coordinate'`)而言的位置。
183183

184184
###${prefix} value(number)
185185

0 commit comments

Comments
 (0)