Skip to content

Commit 4c36a0b

Browse files
committed
Supplement coord sys related API doc, custom series doc, media query doc.
1 parent 393ba3a commit 4c36a0b

9 files changed

Lines changed: 758 additions & 209 deletions

File tree

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,24 @@ These global variables can be used in doc:
6363
+ `${galleryViewPath}`
6464
+ `${galleryEditorPath}`
6565
+ `${websitePath}`
66+
+ `${handbookPath}`
67+
68+
Note: All of them are ended with a `/`, therefore, use them like `${galleryEditorPath}pie-legend`.
6669

6770
See samples in "Reference of echarts-examples or other links"
6871

6972
### Reference of echarts-examples or Other Links
7073

71-
Embed an example in doc:
74+
Embed an example in doc (display the example directly in doc with an iframe. To avoid performance issues, do not overuse it.):
7275
```md
73-
~[700X300](${galleryEditorPath}pie-legend&edit=1&reset=1)
76+
~[700X300](${galleryViewPath}pie-legend&edit=1&reset=1)
7477
~[700x300](${galleryViewPath}doc-example/aria-pie&edit=1&reset=1)
7578
```
7679

7780
Provide an example link in doc:
7881
```md
7982
[vertically scrollable legend](${galleryEditorPath}pie-legend&edit=1&reset=1)
80-
[aria pie](${galleryViewPath}doc-example/aria-pie&edit=1&reset=1)
83+
[aria pie](${galleryEditorPath}doc-example/aria-pie&edit=1&reset=1)
8184
```
8285

8386
Provide a website link in doc:
@@ -94,8 +97,10 @@ A `~` can be used to refer to a option item in the same doc. For example:
9497

9598
If intending to reference an anchor in different doc, it can be:
9699
```md
97-
In api.html, reference
98100
[itemStyle](option.html#series.itemStyle)
101+
[action.highlight](api.html#action.highlight)
102+
[Custom Series](tutorial.html#Custom%20Series)
103+
[Use ECharts with bundler and NPM](${handbookPath}basics/import)
99104
```
100105

101106

en/api/echarts-instance.md

Lines changed: 346 additions & 90 deletions
Large diffs are not rendered by default.

en/option/partial/coord-sys.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Most series only support `coordinateSystemUsage: 'data'` - such as [series-line]
169169

170170
See also [${componentNameInLink}.coordinateSystem](~${componentNameInLink}.coordinateSystem).
171171

172-
## coord(Array|string)
172+
## coord(Array|number|string)
173173

174174
{{ use: partial-version(version = ${version|minVersion('6.0.0')}) }}
175175

@@ -185,6 +185,8 @@ Examples: [sparkline in matrix](${galleryEditorPath}matrix-sparkline&edit=1&rese
185185

186186
> Note: when [coordinateSystemUsage](~${componentNameInLink}.coordinateSystemUsage) is `'data'`, the input of coordinate system is `series.data[i]` rather than this `coord`.
187187
188+
The format this `coord` is defined by each coordinate system, and it's the same as the second parameter of [chart.convertToPixel](api.html#echartsInstance.convertToPixel).
189+
188190

189191
{{ if: ${cartesian2d} }}
190192
## xAxisIndex(number) = 0

en/option/series/custom.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ The first parameter of `renderItem`, including:
147147
},
148148
coordSys: {
149149
type: 'calendar',
150-
x: // {number} x of calendar rect
151-
y: // {number} y of calendar rect
152-
width: // {number} width of calendar rect
153-
height: // {number} height of calendar rect
150+
x: // {number} x of the calendar component rect
151+
y: // {number} y of the calendar component rect
152+
width: // {number} width of the calendar component rect
153+
height: // {number} height of the calendar component rect
154154
cellWidth: // {number} calendar cellWidth
155155
cellHeight: // {number} calendar cellHeight
156156
rangeInfo: {
@@ -160,6 +160,13 @@ The first parameter of `renderItem`, including:
160160
dayCount: // day count in calendar.
161161
}
162162
},
163+
coordSys: {
164+
type: 'matrix',
165+
x: // {number} x of the matrix component rect
166+
y: // {number} y of the matrix component rect
167+
width: // {number} width of the matrix component rect
168+
height: // {number} height of the matrix component rect
169+
},
163170
coordSys: {
164171
type: 'geo',
165172
x: // {number} x of geo rect
@@ -207,12 +214,15 @@ Get value on the given dimension.
207214

208215
Convert data to coordinate.
209216

210-
```
211-
@param {Array.<number>} data.
212-
@return {Array.<number>} Point on canvas, at least includes [x, y].
213-
In polar, it also contains:
214-
polar: [x, y, radius, angle]
215-
```
217+
The behavior, parameters and returns are the same as [chart.convertToPixel](api.html#echartsInstance.convertToPixel) (only exclude its first parameter `finder`).
218+
219+
##### layout(Function)
220+
221+
Convert data to the corresponding layout info based on the current coordinate system.
222+
223+
The behavior, parameters and returns are the same as [chart.convertToLayout](api.html#echartsInstance.convertToLayout) (only exclude its first parameter `finder`).
224+
225+
See [matrix api.layout example](${galleryEditorPath}matrix-mini-bar-data-collection).
216226

217227
##### size(Function)
218228

en/tutorial/media-query.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Besides, sometimes one chart may need to be displayed on both PC and mobile-end,
1010
To solve this problem, ECharts improved component location algorithm, and implemented responsive ability similar to [CSS Media Query](https://www.w3.org/TR/css3-mediaqueries/).
1111

1212

13-
## Location and layout of ECharts components
13+
## Location and Layout of ECharts Components
1414

1515

1616
Most *component* and *series* follow two locating methods:
@@ -212,7 +212,11 @@ But if the container DOM node needs to change size with dragging, you need to pa
212212

213213
When `chart.setOption(rawOption)` for the second, third, fourth, fifth, and etc. times, if `rawOption` is `composite option` (which means it contains `media` list), then, the new `rawOption.media` list will not merge with the old `media`. instead, it will simply replace the option. Of course, `baseOption` will still merge with the old option normally.
214214

215-
<br>
216-
Finally, let's see an example combining with timeline:
217215

218-
~[750x700](${galleryViewPath}doc-example/bar-media-timeline&edit=1&reset=1)
216+
## Some Examples
217+
218+
Use [matrix coordinate system (grid layout)](option.html#matrix) and media query:
219+
220+
~[750x500](${galleryViewPath}matrix-grid-layout&edit=1&reset=1)
221+
222+
This is another [media query example](${galleryEditorPath}doc-example/bar-media-timeline&edit=1&reset=1).

0 commit comments

Comments
 (0)