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
29 changes: 29 additions & 0 deletions en/api/echarts-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,35 @@ myChart.setOption({
})
```

## setTheme(Function)

```ts
(
theme: string | Object
opts?: {
silent? boolean
}
) => void
```

Sets the theme for the chart instance.

+ `theme`: When `string`: Represents the `themeName` registered via [echarts.registerTheme](~echarts.registerTheme). When `Object`: An anonymous theme object that will be directly applied.
+ `opts.silent` Specify whether or not to prevent triggering events.

Here is a demo of dynamically setting a theme after initialization:

```js
const chart = echarts.init(...);
chart.setOption(...);
// Method 1: Register and apply a named theme
echarts.registerTheme('myTheme', {backgroundColor: 'red'});
chart.setTheme('myTheme');
// Method 2: Apply an anonymous theme directly
chart.setTheme({backgroundColor: 'red'});
```

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.

## resize(Function)
```ts
Expand Down
2 changes: 1 addition & 1 deletion en/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## v6.0.0-beta.1
## v6.0.0

+ [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))
+ [Feature] [chord] New chord series. [#20522](https://github.com/apache/echarts/issues/20522) ([Ovilia](https://github.com/Ovilia))
Expand Down
7 changes: 3 additions & 4 deletions en/option/partial/mark-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,13 @@ Y position according to container, in pixel.
version = "6.0.0"
) }}

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

###${prefix} relativeTo('container' | 'coordinate')
###${prefix} relativeTo(string)

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

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'`).

Specify the relationship of overlap between graphic elements. A bigger value means higher.
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'`).

###${prefix} value(number)

Expand Down
30 changes: 30 additions & 0 deletions zh/api/echarts-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,36 @@ myChart.setOption({
})
```

## setTheme(Function)

```ts
(
theme: string | Object
opts?: {
silent? boolean
}
) => void
```

设置图表实例的主题。

+ `theme` 为 `string` 时,表示的是使用在图表实例初始化前调用 [echarts.registerTheme](~echarts.registerTheme) 注册主题时使用的 `themeName`;当其为 `Object` 时,表示一个匿名的主题对象,并且直接使用该主题。
+ `opts.silent` 表示是否禁止抛出事件。默认为 `false`。

以下是一个动态设置主题的例子:

```js
const chart = echarts.init(...);
chart.setOption(...);
// 图表已经初始化了,也可以调用 registerTheme 和 setTheme
echarts.registerTheme('myTheme', {backgroundColor: 'red'});
chart.setTheme('myTheme');
// 或者直接
chart.setTheme({backgroundColor: 'red'});
```

如果这个主题不在其他图表中使用,那么这两种方式是等价的,否则应使用前一种,这样在其他图表中也可以使用 `setTheme('myTheme')` 使用该主题。

## resize(Function)
```ts
(opts?: {
Expand Down
20 changes: 14 additions & 6 deletions zh/changelog.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
## v6.0.0-beta.1
## v6.0.0

+ [Feature] [theme] ECharts 6.0 新主题。 [#20865](https://github.com/apache/echarts/issues/20865) ([Ovilia](https://github.com/Ovilia))
+ [Feature] [chord] 新增和弦图系列。 [#20522](https://github.com/apache/echarts/issues/20522) ([Ovilia](https://github.com/Ovilia))
+ [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))
+ [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))
+ [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))
+ [Feature] [custom] 支持可复用的自定义系列。 [#20226](https://github.com/apache/echarts/issues/20226) ([Ovilia](https://github.com/Ovilia))
+ [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)).
+ [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))
+ [Feature] [scatter] 支持散点图系列的抖动。 [#19941](https://github.com/apache/echarts/issues/19941) ([Ovilia](https://github.com/Ovilia))
+ [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))
+ [Feature] [theme] 支持动态注册和切换主题。 [#20705](https://github.com/apache/echarts/issues/20705) ([Ovilia](https://github.com/Ovilia))
+ [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)).
+ [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))
+ [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))
+ [Feature] [marker] 标记点/标记线/标记区域 (`markPoint`/`markLine`/`markArea`) 支持 `z` 选项。 [#21117](https://github.com/apache/echarts/issues/21117) ([sz-p](https://github.com/sz-p))
+ [Feature] [marker] 标记点/标记线/标记区域 (`markPoint`/`markLine`/`markArea`) 支持 `z2` 选项。 [#20782](https://github.com/apache/echarts/issues/20782) ([sz-p](https://github.com/sz-p))
+ [Feature] [stack] 支持反转堆叠顺序。 [#20998](https://github.com/apache/echarts/issues/20998) ([Justin-ZS](https://github.com/Justin-ZS))
+ [Feature] [sankey] 支持桑基图系列的交互缩放 (`roaming`)。 [#20321](https://github.com/apache/echarts/issues/20321) ([Ovilia](https://github.com/Ovilia))
+ [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))
+ [Feature] [marker] 标记支持 `relativeTo` 相对坐标系的位置。 [#20166](https://github.com/apache/echarts/issues/20166) [#21042](https://github.com/apache/echarts/issues/21042) ([Ovilia](https://github.com/Ovilia))
+ [Feature] [axis] 支持角度轴 (`angleAxis`) 标签的提示框 (`tooltip`)。 [#20986](https://github.com/apache/echarts/issues/20986) ([plainheart](https://github.com/plainheart))
+ [Feature] [tooltip] 支持 `displayTransition` 选项以控制是否启用提示框显示过渡动画。 [#20966](https://github.com/apache/echarts/issues/20966) ([jqqin](https://github.com/jqqin))
+ [Feature] [legend] 支持 `triggerEvent` 选项。 [#20907](https://github.com/apache/echarts/issues/20907) ([sz-p](https://github.com/sz-p))
+ [Feature] [visualMap] 支持 `unboundedRange`。 [#21113](https://github.com/apache/echarts/pull/21113) ([100pah](https://github.com/100pah))
+ [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))
+ [Feature] [custom] 自定义系列 (`custom series`) 支持 `tooltipDisabled`。 [#20447](https://github.com/apache/echarts/issues/20447) ([Ovilia](https://github.com/Ovilia))
+ [Feature] [i18n] 新增挪威博克马尔语 (nb-NO) 翻译。 [#20792](https://github.com/apache/echarts/issues/20792) ([joakimono](https://github.com/joakimono))
+ [Feature] [i18n] 新增希腊语(EL)翻译。 [#21119](https://github.com/apache/echarts/pull/21119) ([tassosgeo](https://github.com/tassosgeo))
+ [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))
+ [Fix] [label] 修复标签布局的外边距。 [#21103](https://github.com/apache/echarts/pull/21103) ([100pah](https://github.com/100pah))
+ [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))
+ [Fix] [tooltip] 修复类目轴上值为 `null` 的项应能显示提示框的问题。 [#20777](https://github.com/apache/echarts/issues/20777) ([Justin-ZS](https://github.com/Justin-ZS))
+ [Fix] [visualMap] 修复部分文本样式在视觉映射 (`visualMap`) 上不起作用的问题。 [#20961](https://github.com/apache/echarts/issues/20961) ([plainheart](https://github.com/plainheart))
Expand All @@ -31,10 +35,14 @@
+ [Fix] [pie] 修复当单个标签位置不在外部时,`labelLine` 可能未被移除并导致错误的问题。 [#20906](https://github.com/apache/echarts/issues/20906) ([plainheart](https://github.com/plainheart))
+ [Fix] [sankey] 修复当 `emphasis.focus` 为 `'trajectory'` 时,处理大数据导致浏览器崩溃的问题。 [#20959](https://github.com/apache/echarts/issues/20959) ([plainheart](https://github.com/plainheart))
+ [Fix] [custom] 修复应用离开过渡时可能出现的空指针异常 (NPE)。 [#20920](https://github.com/apache/echarts/issues/20920) ([plainheart](https://github.com/plainheart))
+ [Fix] [tooltip] 通过显式解除事件监听以避免潜在的内存泄漏问题。 [#21087](https://github.com/apache/echarts/pull/21087) ([seaheart](https://github.com/seaheart))
+ [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))
+ [Fix] [axis] 修复小的数据因为精度无法在直角坐标系展示的问题。 [#21120](https://github.com/apache/echarts/pull/21120) ([100pah](https://github.com/100pah)) ([SihongShen](https://github.com/SihongShen))
+ [Fix] [dataZoom] 将 `moveHandler` 的光标改为默认 (`default`)。 [#20304](https://github.com/apache/echarts/issues/20304) ([ribeirompl](https://github.com/ribeirompl))
+ [Fix] [tooltip] 修复提示框关闭后用于样式坐标变换的标记点未被移除的问题。 [#20987](https://github.com/apache/echarts/issues/20987) ([plainheart](https://github.com/plainheart))
+ [Fix] [bar] 从 `BarSeriesOption` 接口中移除未使用的 `startValue` 选项。 [#20901](https://github.com/apache/echarts/issues/20901) ([plainheart](https://github.com/plainheart))
+ [Fix] [title] 修复标题文本样式的宽度类型不应包含字符串的问题。 [#20800](https://github.com/apache/echarts/issues/20800) ([sz-p](https://github.com/sz-p))
+ [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))
+ [Fix] [roam] 修复 `RoamControllerHost` 的导入路径。 [#20313](https://github.com/apache/echarts/issues/20313) ([Ovilia](https://github.com/Ovilia))
+ [Fix] [svg] 移除 `getSvgDataURL` 中的 SVG 支持检查。 [#20760](https://github.com/apache/echarts/issues/20760) ([plainheart](https://github.com/plainheart))
+ [Break] 相对于 v5.6.0 的 Breaking changes:
Expand Down
4 changes: 2 additions & 2 deletions zh/option/partial/mark-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ data: [{{ if: ${hasType} }}

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

###${prefix} relativeTo('container' | 'coordinate')
###${prefix} relativeTo(string)

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

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

###${prefix} value(number)

Expand Down