This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/echarts-doc.git
The following commit(s) were added to refs/heads/next by this push:
new b6b4f54 add upgrade guide.
b6b4f54 is described below
commit b6b4f54a4015f15fb9accb4a9b49b5262f35bf34
Author: 100pah <[email protected]>
AuthorDate: Thu Jan 21 01:22:48 2021 +0800
add upgrade guide.
---
en/tutorial/tutorial.md | 1 +
en/tutorial/upgrade-guide-v5.md | 265 ++++++++++++++++++++++++++++++++++++++++
zh/tutorial/tutorial.md | 1 +
zh/tutorial/upgrade-guide-v5.md | 260 +++++++++++++++++++++++++++++++++++++++
4 files changed, 527 insertions(+)
diff --git a/en/tutorial/tutorial.md b/en/tutorial/tutorial.md
index 6aa7c90..b7f8c70 100644
--- a/en/tutorial/tutorial.md
+++ b/en/tutorial/tutorial.md
@@ -19,3 +19,4 @@
{{ import: headless }}
{{ import: renderer }}
{{ import: aria }}
+{{ import: upgrade-guide-v5 }}
diff --git a/en/tutorial/upgrade-guide-v5.md b/en/tutorial/upgrade-guide-v5.md
new file mode 100644
index 0000000..21fefdd
--- /dev/null
+++ b/en/tutorial/upgrade-guide-v5.md
@@ -0,0 +1,265 @@
+{{ target: upgrade-guide-v5 }}
+
+# ECharst 5 Upgrade Guide
+
+
+This guide is primarily for users who wish to upgrade their echarts 4.x to
echarts 5.x. The notable new features of echarts 5 can be checked in this
[docucment](xxx). In most cases we do not have to do anything for this
migration because echarts has always tried to keep the API as stable and
backward compatible as possible. But there are still some changes that breaks
from echarts 4, as well as some cases that echarts 5 provides better API and
deprecated the previous one. We attempt to e [...]
+
+Because `v5.0.1` provides a significant new feature of [module
registry](tutorial.html#Use%20ECharts%20with%20bundler%20and%20NPM). This
document is based on `v5.0.1` or higher versions.
+
+
+## Breaking Changes
+
+
+### Default theme
+
+The color in the default theme has been changed in `v5`. If users intend to
roll back to the color theme of `v4`, please manually declare the color palette
of `v4`, for example:
+```js
+chart.setOption({
+ color: [
+ '#c23531', '#2f4554', '#61a0a8', '#d48265', '#91c7ae', '#749f83',
+ '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3'
+ ],
+ // ...
+});
+```
+or make a theme:
+```js
+var themeEC4 = {
+ color: [
+ '#c23531', '#2f4554', '#61a0a8', '#d48265', '#91c7ae', '#749f83',
+ '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3'
+ ]
+};
+var chart = echarts.init(dom, themeEC4);
+chart.setOption(/* ... */);
+```
+
+
+### ECharts Import
+
+
+#### Import from `lib`
+
+If the users previously import echarts in `v4` like this:
+```js
+import echarts from 'echarts/lib/echarts';
+```
+or
+```js
+import echarts from 'echarts';
+```
+
+They do not work in `v5` any more.
+
+Users should modify it to:
+```js
+import * as echarts from 'echarts/lib/echarts';
+```
+or
+```js
+import * as echarts from 'echarts';
+```
+
+
+#### Import from `src`
+
+If the upper JavaScript application previously imported `src/echarts.js`,
`src/chart/*.js` or `src/component/*.js` in `v4`, for example:
+```js
+import * as echarts from 'echarts/src/echarts';
+import 'echarts/src/chart/bar';
+import 'echarts/src/component/grid';
+```
+It can not work any more in `v5` because all of the files in `echarts/src`
folder are migrated to `*.ts`.
+
+In fact, importing code form `echarts/src` fold is not recommended in `v5`.
User can modify it to:
+```js
+import * as echarts from 'echarts/index.blank';
+import { BarChart } from 'echarts/charts';
+import { GridComponent } from 'echarts/components';
+
+echarts.use([BarChart, GridComponent]);
+```
+
+The full list of charts and components exported can be check in
[[email protected]](https://cdn.jsdelivr.net/npm/[email protected]/lib/export/charts.js),
[[email protected]](https://cdn.jsdelivr.net/npm/[email protected]/lib/export/components.js).
+
+
+
+#### Import of `aria`
+
+[aria](option.html#aria) is not included any more in
[echarts/dist/echarts.simple(.min).js](https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.simple.js)
and
[echarts/index.simple.js](https://cdn.jsdelivr.net/npm/[email protected]/index.simple.js)
since `v5`. Previously in `v4` it is included by them.
+
+If users are using
[echarts/dist/echarts(.min).js](https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.js)
or
[echarts/dist/echarts.common(.min).js](https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.common.js)
or
+```js
+import * as echarts from 'echarts';
+```
+or
+```js
+import * as echarts from 'echarts/index.common';
+```
+there is nothing need to do when migrate about [aria](option.html#aria) from
`v4` to `v5`. Because those source are still include [aria](option.html#aria)
in `v5`.
+
+But if users are using
[echarts/dist/echarts.simple(.min).js](https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.simple.js)
or
+```js
+import * as echarts from 'echarts/index.simple';
+```
+they need to manually import [aria](option.html#aria), for example:
+```js
+import * as echarts from 'echarts/index.simple';
+import { AriaComponent } from 'echarts/components';
+
+echarts.use([AriaComponent]);
+```
+
+
+### Built-in geoJSON
+
+The built-in geoJSON has been removed (previously in `echarts/map` folder)
since `v5`. Those geoJSON have been coming from third-parties. If users still
need those geoJSON, please find them in the old version or prepare them
yourself.
+
+
+### Legacy IE8
+
+The support of the legacy IE8 has been dropped. In terms of details, the
previous [VML renderer](https://github.com/ecomfe/zrender/tree/4.3.2/src/vml)
(necessary in IE8) will not be updated to work in `v5`. If there are strong
requirements of the legacy IE8 support while `v5` features needed, welcome the
pull request to upgrade that VML renderer, or make a third-party VML renderer,
since renderers can be registered separately since `v5.0.1`.
+
+
+### ECharts Option
+
+#### Priority of Visuals Setting
+
+The priority of the visuals between [visualMap
component](option.html#visualMap) and
[itemStyle](option.html#series-scatter.itemStyle) |
[lineStyle](option.html#series-scatter.lineStyle) |
[areaStyle](option.html#series-scatter.areaStyle) are reversed since `v5`.
+
+That is, previously in `v4`, the visuals (i.e., color, symbol, symbolSize,
...) that generated by [visualMap component](option.html#visualMap) has the
highest priority, which will overwrite the same visuals settings in
[itemStyle](option.html#series-scatter.itemStyle) |
[lineStyle](option.html#series-scatter.lineStyle) |
[areaStyle](option.html#series-scatter.areaStyle). That brought troubles when
needing to specify specific style to some certain data items while using
[visualMap compone [...]
+
+In most cases, users will probably not notice this change when migrating from
`v4` to `v5`. But users can still check that if [visualMap
component](option.html#visualMap) and
[itemStyle](option.html#series-scatter.itemStyle) |
[lineStyle](option.html#series-scatter.lineStyle) |
[areaStyle](option.html#series-scatter.areaStyle) are both specified.
+
+
+#### `padding` in Rich Text
+
+The behavior of
[rich.?.padding](option.html#series-scatter.label.rich.<style_name>.padding)
are changed. Previously in `v4`, `rich.?.padding: [11, 22, 33, 44]` indicates
that `padding-top` is `33` and `padding-bottom` is `11`, which is a buggy
implementation because it is different from what CSS did. Since `v5`, we fixed
it that `rich.?.padding: [11, 22, 33, 44]` indicates `padding-top` is `11` and
`padding-bottom` is `33`.
+
+If users are using
[rich.?.padding](option.html#series-scatter.label.rich.<style_name>.padding) in
their `option`, please consider to switch them.
+
+
+
+
+## ECharts Related Extensions
+
+ECharts extensions can be found but not limit to [this
list](https://echarts.apache.org/en/download-extension.html). Some of the
extensions do not need users to upgrade its version if upgrading echarts to
`v5`, but some others need. At least this extension need to be upgraded to new
version to support echarts `v5`:
+
++ [echarts-gl](https://github.com/ecomfe/echarts-gl)
++ [echarts-wordcloud](https://github.com/ecomfe/echarts-wordcloud)
++ [echarts-liquidfill](https://github.com/ecomfe/echarts-liquidfill)
+
+This list will be kept up to date.
+
+
+
+
+## Deprecated API
+
+Some of the API and echarts options are deprecated since `v5`, but are still
backward compatible. Users can **keep using these deprecated API**, with only
some warning will be printed to console in dev mode. But if users have spare
time, it is recommended to upgraded to new API for the consideration of long
term maintenance.
+
+The deprecated API and their corresponding new API are listed as follows:
+
++ Transform related props of a graphic element are changed:
+ + Changes:
+ + `position: [number, number]` are changed to `x: number`/`y: number`.
+ + `scale: [number, number]` are changed to `scaleX: number`/`scaleY:
number`.
+ + `origin: [number, number]` are changed to `originX:
number`/`originY: number`.
+ + The `position`, `scale` and `origin` are still supported but deprecated.
+ + It effects these places:
+ + In the `graphic` components: the declarations of each element.
+ + In `custom series`: the declarations of each element in the return
of `renderItem`.
+ + Directly use zrender graphic elements.
++ Text related props on graphic elements are changed:
+ + Changes:
+ + The declaration of attached text (or say, rect text) are changed.
+ + Prop `style.text` are deprecated in elements except `Text`.
Instead, Prop set `textContent` and `textConfig` are provided to support more
powerful capabilities.
+ + These related props at the left part below are deprecated. Use
the right part below instead.
+ + textPosition => textConfig.position
+ + textOffset => textConfig.offset
+ + textRotation => textConfig.rotation
+ + textDistance => textConfig.distance
+ + The props at the left part below are deprecated in `style` and
`style.rich.?`. Use the props at the right part below instead.
+ + textFill => fill
+ + textStroke => stroke
+ + textFont => font
+ + textStrokeWidth => lineWidth
+ + textAlign => align
+ + textVerticalAlign => verticalAlign);
+ + textLineHeight =>
+ + textWidth => width
+ + textHeight => hight
+ + textBackgroundColor => backgroundColor
+ + textPadding => padding
+ + textBorderColor => borderColor
+ + textBorderWidth => borderWidth
+ + textBorderRadius => borderRadius
+ + textBoxShadowColor => shadowColor
+ + textBoxShadowBlur => shadowBlur
+ + textBoxShadowOffsetX => shadowOffsetX
+ + textBoxShadowOffsetY => shadowOffsetY
+ + Note: these props are not changed:
+ + textShadowColor
+ + textShadowBlur
+ + textShadowOffsetX
+ + textShadowOffsetY
+ + It effects these places:
+ + In the `graphic` components: the declarations of each element.
[compat, but not accurately the same in some complicated cases.]
+ + In `custom series`: the declarations of each element in the return
of `renderItem`. [compat, but not accurately the same in some complicated
cases].
+ + Directly use zrender API to create graphic elements. [No compat,
breaking change].
++ API on chart instance:
+ + `chart.one(...)` is deprecated.
++ `label`:
+ + In props `color`, `textBorderColor`, `backgroundColor` and
`borderColor`, the value `'auto'` is deprecated. Use the value `'inherit'`
instead.
++ `hoverAnimation`:
+ + option `series.hoverAnimation` is deprecated. Use
`series.emphasis.scale` instead.
++ `line series`:
+ + option `series.clipOverflow` is deprecated. Use `series.clip` instead.
++ `custom series`:
+ + In `renderItem`, the `api.style(...)` and `api.styleEmphasis(...)` are
deprecated. Because it is not really necessary and hard to ensure backward
compatibility. Users can fetch system designated visual by `api.visual(...)`.
++ `sunburst series`:
+ + Action type `highlight` is deprecated. Use `sunburstHighlight` instead.
+ + Action type `downplay` is deprecated. Use `sunburstUnhighlight` instead.
+ + option `series.downplay` is deprecated. Use `series.blur` instead.
+ + option `series.highlightPolicy` is deprecated. Use
`series.emphasis.focus` instead.
++ `pie series`:
+ + The action type at the left part below are deprecated. Use the right
part instead:
+ + `pieToggleSelect` => `toggleSelect`
+ + `pieSelect` => `select`
+ + `pieUnSelect` => `unselect`
+ + The event type at the left part below are deprecated. Use the right part
instead:
+ + `pieselectchanged` => `selectchanged`
+ + `pieselected` => `selected`
+ + `pieunselected` => `unselected`
+ + option `series.label.margin` is deprecated. Use
`series.label.edgeDistance` instead.
+ + option `series.clockWise` is deprecated. Use `series.clockwise` instead.
+ + option `series.hoverOffset` is deprecated. Use
`series.emphasis.scaleSize` instead.
++ `map series`:
+ + The action type at the left part below are deprecated. Use the right
part instead:
+ + `mapToggleSelect` => `toggleSelect`
+ + `mapSelect` => `select`
+ + `mapUnSelect` => `unselect`
+ + The event type at the left part below are deprecated. Use the right part
instead:
+ + `mapselectchanged` => `selectchanged`
+ + `mapselected` => `selected`
+ + `mapunselected` => `unselected`
+ + option `series.mapType` is deprecated. Use `series.map` instead.
+ + option `series.mapLocation` is deprecated.
++ `graph series`:
+ + option `series.focusNodeAdjacency` is deprecated. Use `series.emphasis:
{ focus: 'adjacency'}` instead.
++ `gauge series`:
+ + option `series.clockWise` is deprecated. Use `series.clockwise` instead.
+ + option `series.hoverOffset` is deprecated. Use
`series.emphasis.scaleSize` instead.
++ `dataZoom component`:
+ + option `dataZoom.handleIcon` need prefix `path://` if using SVGPath.
++ `radar`:
+ + option `radar.name` is deprecated. Use `radar.axisName` instead.
+ + option `radar.nameGap` is deprecated. Use `radar.axisNameGap` instead.
++ Parse and format:
+ + `echarts.format.formatTime` is deprecated. Use `echarts.time.format`
instead.
+ + `echarts.number.parseDate` is deprecated. Use `echarts.time.parse`
instead.
+ + `echarts.format.getTextRect` is deprecated.
+
+
+
diff --git a/zh/tutorial/tutorial.md b/zh/tutorial/tutorial.md
index 967cc91..744392f 100644
--- a/zh/tutorial/tutorial.md
+++ b/zh/tutorial/tutorial.md
@@ -23,3 +23,4 @@
{{ import: aria }}
{{ import: echarts-gl }}
{{ import: weixin-application }}
+{{ import: upgrade-guide-v5 }}
diff --git a/zh/tutorial/upgrade-guide-v5.md b/zh/tutorial/upgrade-guide-v5.md
new file mode 100644
index 0000000..87264c4
--- /dev/null
+++ b/zh/tutorial/upgrade-guide-v5.md
@@ -0,0 +1,260 @@
+{{ target: upgrade-guide-v5 }}
+
+# ECharst 5 升级指南
+
+
+本指南面向那些希望将 echarts 4.x(以下简称 `v4`)升级到 echarts 5.x(以下简称 `v5`)的用户。echarts 5
的新功能可以在这个 [文档](xxx) 中查看。绝大多数情况下,我们用不着为这个升级做什么额外的事,因为 echarts 一直尽可能地保持 API
的稳定和向后兼容。但是,echarts 5 仍然带来了一些非兼容改动。此外,在一些情况下,echarts 5 提供了一些更好的
API,并不再推荐使用一些以前的 API(当然,仍保持兼容他们)。这篇文档,会尽力详尽得解释它们。
+
+因为 `v5.0.1`
带来了一个重要功能,[模块注册](tutorial.html#%E5%9C%A8%E6%89%93%E5%8C%85%E7%8E%AF%E5%A2%83%E4%B8%AD%E4%BD%BF%E7%94%A8%20ECharts)。所以本文档基于
`v5.0.1` 或者更高的版本。
+
+
+## 非兼容性改变
+
+
+### 默认主题(theme)
+
+`v5` 改变了默认主题中的颜色。如果使用者想改回 `v4` 的颜色,可以手动声明颜色,如下:
+```js
+chart.setOption({
+ color: [
+ '#c23531', '#2f4554', '#61a0a8', '#d48265', '#91c7ae', '#749f83',
+ '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3'
+ ],
+ // ...
+});
+```
+或者,做一个简单的 `v4` 主题:
+```js
+var themeEC4 = {
+ color: [
+ '#c23531', '#2f4554', '#61a0a8', '#d48265', '#91c7ae', '#749f83',
+ '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3'
+ ]
+};
+var chart = echarts.init(dom, themeEC4);
+chart.setOption(/* ... */);
+```
+
+
+### 引用 ECharts
+
+
+#### 从 `lib` 中引用
+
+如果使用者在 `v4` 中这样引用了 echarts:
+```js
+import echarts from 'echarts/lib/echarts';
+```
+或者
+```js
+import echarts from 'echarts';
+```
+
+这两种方式,`v5` 中不再支持了。
+
+使用者需要如下更改代码解决这个问题:
+```js
+import * as echarts from 'echarts/lib/echarts';
+```
+或者
+```js
+import * as echarts from 'echarts';
+```
+
+
+#### 从 `src` 中引用
+
+如果一个使用 echarts 的 JavaScript 工程,在 `v4` 中引用了 `src/echarts.js`,`src/chart/*.js` 或
`src/component/*.js`,例如:
+```js
+import * as echarts from 'echarts/src/echarts';
+import 'echarts/src/chart/bar';
+import 'echarts/src/component/grid';
+```
+`v5` 不再支持这种做法,因为所有 `echarts/src` 中的文件,都已经变为了 `*.ts`,不再是 `js` 文件。
+
+其实 `v5` 不再推荐从 `echarts/src` 引用文件。使用者可以这样更改代码:
+```js
+import * as echarts from 'echarts/index.blank';
+import { BarChart } from 'echarts/charts';
+import { GridComponent } from 'echarts/components';
+
+echarts.use([BarChart, GridComponent]);
+```
+
+charts 和 components 的完整列表,见
[[email protected]](https://cdn.jsdelivr.net/npm/[email protected]/lib/export/charts.js),[[email protected]](https://cdn.jsdelivr.net/npm/[email protected]/lib/export/components.js)。
+
+
+
+#### 无障碍访问(`aria`)的引用
+
+`v5` 里
[echarts/dist/echarts.simple(.min).js](https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.simple.js)
和
[echarts/index.simple.js](https://cdn.jsdelivr.net/npm/[email protected]/index.simple.js)
不再默认引用 [无障碍访问(aria)](option.html#aria) 了。
+
+如果使用者在用
[echarts/dist/echarts(.min).js](https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.js)
或者
[echarts/dist/echarts.common(.min).js](https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.common.js)
或者
+```js
+import * as echarts from 'echarts';
+```
+或者
+```js
+import * as echarts from 'echarts/index.common';
+```
+那么,关于 [无障碍访问(aria)](option.html#aria),开发者不用改任何东西。因为上述文件和模块仍然对其有默认引用。
+
+但是,如果使用者在用
[echarts/dist/echarts.simple(.min).js](https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.simple.js)
或者
+```js
+import * as echarts from 'echarts/index.simple';
+```
+那么需要更改代码,手动引用一下 [无障碍访问(aria)](option.html#aria) 模块,例如:
+```js
+import * as echarts from 'echarts/index.simple';
+import { AriaComponent } from 'echarts/components';
+
+echarts.use([AriaComponent]);
+```
+
+
+### 内置的 geoJSON
+
+`v5` 移除了内置的 geoJSON(原先在 `echarts/map` 文件夹下)。这些 geoJSON
文件本就一直来源于第三方。如果使用者仍然需要他们,可以去从老版本中得到,或者自己准备它们。
+
+
+### 老 IE8
+
+`v5` 不再支持老 IE8 。具体来说,之前的 [VML
渲染器](https://github.com/ecomfe/zrender/tree/4.3.2/src/vml)(IE8
渲染所须)没有再取升级使它能运行在 `v5` 里。如果使用者确实有很强的需求,那么欢迎提 pull request 来升级 VML 渲染器,或者做个第三方
VML 渲染器,以为 `v5.0.1` 开始已经可以注册独立的渲染器了。
+
+
+### ECharts Option
+
+#### 视觉样式设置的优先级改变
+
+`v5` 对调了 [visualMap 组件](option.html#visualMap) 和
[itemStyle](option.html#series-scatter.itemStyle) |
[lineStyle](option.html#series-scatter.lineStyle) |
[areaStyle](option.html#series-scatter.areaStyle) 的视觉样式优先级。
+
+具体来说,`v4` 中,[visualMap 组件](option.html#visualMap)
中生成的视觉样式(如,颜色、图形类型、图形尺寸等)的优先级,比开发者在
[itemStyle](option.html#series-scatter.itemStyle) |
[lineStyle](option.html#series-scatter.lineStyle) |
[areaStyle](option.html#series-scatter.areaStyle)
中设置的样式的优先级高,也就是说如果他们同时设置的话,前者会生效而后者不会生效。这带来了些麻烦:假如使用者在使用 [visualMap
组件](option.html#visualMap) 时,又想针对某个数据项对应的图形,设置
[itemStyle](option.html#series-scatter.itemStyle) 样式,则做不到。`v5` 中于是提高了
[itemStyle](option.html#series-scatter.itemStyle) | [lineStyle](opt [...]
+
+在绝大多处情况下,这个变化并不会带来什么影响。但是为保险起见,使用者在升级 `v4` 到 `v5` 时,还是可以检查下,是否有同时使用
[visualMap](option.html#visualMap) 和
[itemStyle](option.html#series-scatter.itemStyle) |
[lineStyle](option.html#series-scatter.lineStyle) |
[areaStyle](option.html#series-scatter.areaStyle) 的情况。
+
+
+#### 富文本的 `padding`
+
+`v5` 修正了 `v4` 里
[rich.?.padding](option.html#series-scatter.label.rich.<style_name>.padding)
的含义问题。`v4` 里,例如 `rich.?.padding: [11, 22, 33, 44]` 表示 `padding-top` 是 `33` 且
`padding-bottom` 是 `11`。这是个有问题的实现,因为它和 CSS 的习惯做法不符合。`v5`
改为了符合习惯的解释方式,`rich.?.padding: [11, 22, 33, 44]` 表示 `padding-top` 是 `11` 且
`padding-bottom` 是 `33`。
+
+如果使用者有在使用
[rich.?.padding](option.html#series-scatter.label.rich.<style_name>.padding),需要修改他们。
+
+
+## ECharts 的相关扩展
+
+[这个列表](https://echarts.apache.org/en/download-extension.html) 有 ECharts
的诸多扩展,但也不限于这个列表。如果想要升级到 `v5` ,有些扩展需要使用者升级扩展本身的版本,有些不用。已知需要使用者升级版本的扩展,见下表:
+
++ [echarts-gl](https://github.com/ecomfe/echarts-gl)
++ [echarts-wordcloud](https://github.com/ecomfe/echarts-wordcloud)
++ [echarts-liquidfill](https://github.com/ecomfe/echarts-liquidfill)
+
+这个列表会持续更新。
+
+
+
+## 不再推荐使用的 API
+
+一些 API(包括函数接口和 echarts option)在 `v5` 中不再推荐使用。当然,使用者**仍然可以用他们**,只会在 dev 模式下,在
console 中打印一些 warning,其他并不会有什么影响。但是从长远维护考虑,如果使用者有时间的话,还是推荐升级成新的替代 API。
+
+这些不再推荐使用的 API 和他们的替代品,列表如下:
+
++ 图形元素 transform 相关的属性被改变了:
+ + 变更点:
+ + `position: [number, number]` 改为 `x: number` / `y: number`。
+ + `scale: [number, number]` 改为 `scaleX: number` / `scaleY: number`。
+ + `origin: [number, number]` 改为 `originX: number` / `originY: number`。
+ + `position`、`scale` 和 `origin` 仍然支持,但已不推荐使用。
+ + 它影响到这些地方:
+ + 在`graphic`组件中:每个元素的声明。
+ + 在 `custom series` 中:`renderItem` 返回的每个元素的声明。
+ + 直接使用 zrender 图形元素时。
++ Text 相关的属性被改变:
+ + 变更点:
+ + 图形元素附带的文本的声明方式被改变:
+ + 除了 `Text` 元素之外,其他元素中的属性 `style.text` 都不推荐使用了。取而代之的是新属性
`textContent` 和 `textConfig`,他们能带来更丰富的功能。
+ + 其中,下面左边部分的这些属性已不推荐使用或废弃。请使用下面的右边部分的属性:
+ + textPosition => textConfig.position
+ + textOffset => textConfig.offset
+ + textRotation => textConfig.rotation
+ + textDistance => textConfig.distance
+ + 下面左边部分的属性在 `style` 和 `style.rich.?` 中已不推荐使用或废弃。请使用下面右边的属性:
+ + textFill => fill
+ + textStroke => stroke
+ + textFont => font
+ + textStrokeWidth => lineWidth
+ + textAlign => align
+ + textVerticalAlign => verticalAlign
+ + textLineHeight =>
+ + textWidth => width
+ + textHeight => hight
+ + textBackgroundColor => backgroundColor
+ + textPadding => padding
+ + textBorderColor => borderColor
+ + textBorderWidth => borderWidth
+ + textBorderRadius => borderRadius
+ + textBoxShadowColor => shadowColor
+ + textBoxShadowBlur => shadowBlur
+ + textBoxShadowOffsetX => shadowOffsetX
+ + textBoxShadowOffsetY => shadowOffsetY
+ + 注:这些属性并没有变化:
+ + textShadowColor
+ + textShadowBlur
+ + textShadowOffsetX
+ + textShadowOffsetY
+ + 它影响到这些地方:
+ + 在 `graphic` 组件中:每个元素的声明。(原来的写法仍兼容,但在一些很复杂的情况下,可能效果不完全一致。)
+ + 在自定义系列(`custom series`)中:`renderItem`
返回中的每个元素的声明。(原来的写法仍兼容,但在一些很复杂的情况下,可能效果不完全一致。)
+ + 直接使用 zrender API 创建图形元素。(不再兼容,原写法被废弃。)
++ 图表实例上的 API:
+ + `chart.one(...)` 已不推荐使用。
++ `label`。
+ + 属性 `color`、`textBorderColor`、`backgroundColor`、`borderColor` 中,值 `auto`
已不推荐使用,而推荐使用 `'inherit'` 代替。
++ `hoverAnimation`:
+ + 选项 `series.hoverAnimation` 已不推荐使用,使用 `series.emphasis.scale` 代替之。
++ 折线图(`line series`):
+ + 选项 `series.clipOverflow` 已不推荐使用,使用 `series.clip` 代替之。
++ 自定义系列(`custom series`)。
+ + 在 `renderItem` 中,`api.style(...)` 和 `api.styleEmphasis(...)`
已不推荐使用。因为这两个接口其实并不真正必要,也很难保证向后兼容。用户可以通过 `api.visual(...)` 获取系统自动分配的视觉信息。
++ 旭日图(`sunburst`):
+ + 动作类型 `highlight` 已被弃用,请使用 `sunburstHighlight` 代替。
+ + 动作类型 `downplay` 已被弃用,请使用 `sunburstUnhighlight` 代替。
+ + 选项 `series.downplay` 已被弃用,请使用 `series.blur` 代替。
+ + 选项 `series.highlightPolicy` 已不适用,请使用 `series.emphasis.focus` 代替。
++ 饼图(`pie`):
+ + 下面左边部分的 action 名已经不推荐使用。请使用右边的 action 名。
+ + `pieToggleSelect` => `toggleSelect`。
+ + `pieSelect` => `select`。
+ + `pieUnSelect` => `unselect`。
+ + 下面左边部分的事件名已经不推荐使用。请使用右边的事件名。
+ + `pieselectchanged` => `selectchanged`。
+ + `pieselected` => `selected`。
+ + `pieunselected` => `unselected`。
+ + 选项 `series.label.margin` 已经不推荐使用。使用 `series.label.edgeDistance` 代替。
+ + 选项 `series.clockWise` 已经不推荐使用。使用 `series.clockwise` 代替。
+ + 选项 `series.hoverOffset` 已经不推荐使用。使用 `series.emphasis.scaleSize` 代替。
++ 地图(`map series`):
+ + 下文左边部分的 action 名已经不推荐使用。请使用右边的 action 名。
+ + `mapToggleSelect` => `toggleSelect`。
+ + `mapSelect` => `select`。
+ + `mapUnSelect` => `unselect`。
+ + 下面左边部分的事件名已经不推荐使用。请使用右边的事件名。
+ + `mapselectchanged` => `selectchanged`。
+ + `mapselected` => `selected`。
+ + `mapunselected` => `unselected`。
+ + 选项 `series.mapType` 已经不推荐使用。使用 `series.map` 代替。
+ + 选项 `series.mapLocation` 已经不推荐使用。
++ 关系图(`graph series`):
+ + 选项 `series.focusNodeAdjacency` 已经不推荐使用。使用 `series.emphasis: { focus:
'adjacency'}` 代替。
++ 仪表盘(`gauge series`):
+ + 选项 `series.clockWise` 已经不推荐使用。使用 `series.clockwise` 代替。
+ + 选项 `series.hoverOffset` 已经不推荐使用。使用 `series.emphasis.scaleSize` 代替。
++ `dataZoom` 组件:
+ + 选项 `dataZoom.handleIcon` 如果使用 `SVGPath`,需要前缀 `path://`。
++ 雷达图(`radar`):
+ + 选项 `radar.name` 已经不推荐使用。使用 `radar.axisName` 代替。
+ + 选项 `radar.nameGap` 已经不推荐使用。使用 `radar.axisNameGap` 代替。
++ Parse and format:
+ + `echarts.format.formatTime` 已经不推荐使用。使用 `echarts.time.format` 代替。
+ + `echarts.number.parseDate` 已经不推荐使用。使用 `echarts.time.parse` 代替。
+ + `echarts.format.getTextRect` 已经不推荐使用。
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]