-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 增加水球图 #542
feat: 增加水球图 #542
Conversation
基于ecahrts-liquidfill,增加对水球图的封装
examples/data/liquidfill.js
Outdated
color: ['red', 'green', 'yellow'], | ||
label: { | ||
formatter (options) { | ||
return options.seriesName + ': ' + options.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return ${options.seriesName}:${options.value}
src/packages/liquidfill/main.js
Outdated
if (!isNaN(val)) { | ||
data.push({ value: val }) | ||
if (itemMap['wave'] && isArray(itemMap['wave'])) { | ||
layers = itemMap['wave'].filter(num => typeof num === 'number' && val > num).sort((a, b) => a < b).map(val => ({ value: val })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
换行
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该不需要对数值做判断,只要把值直接添加上去就行了。
src/packages/liquidfill/main.js
Outdated
if (itemMap['wave'] && isArray(itemMap['wave'])) { | ||
layers = itemMap['wave'].filter(num => typeof num === 'number' && val > num).sort((a, b) => a < b).map(val => ({ value: val })) | ||
data = data.concat(layers) | ||
delete itemMap['wave'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要删除
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个属性可以放到settings里
settings.wave = [0.1, 0.2, 0.3]
settings.wave = [[0,1, 0.2, 0.3], [0.1, 0.2, 0.3]]
src/packages/liquidfill/main.js
Outdated
results.push(result) | ||
}) | ||
|
||
if (results.length > 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
位置最好是不要做特殊处理,让用户来配置,可以省去很多麻烦。
docs/en/liquidfill.md
Outdated
chartData: { | ||
columns: ['city', 'percent'], | ||
rows: [{ | ||
city: '上海', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英文文档尽量别出现中文
docs/en/liquidfill.md
Outdated
| metrics | metrics of chart data | String | default `columns[1]` | | ||
| dataType | type of data | String | default `percent`, also can be setted as `normal` | | ||
| digit | Set the number of digits to retain when the dataType is `percent` | Number | default `2` | | ||
| wave | set the liquidfill layering | Array[Number],Array[Array[Number]] | default `[]`, The value in the array is not greater than the dimension value in the row, and needs to be arranged from large to small. It can be setted like [0.3, 0.2, 0.1],which represents each liquidfill shows four layers and the values of bottom layers are 0.1、0.2、0.3 from bottom to top;It also can be setted like [[0.2, 0.1], [0.1], []].When there are a few liquidfill balls, Each item in the wave corresponds to a hierarchical setting of a liquidfill ball.If the wave.length is less than the rows.length, the left liquidfill will be setted according to the last value of wave. For example, the rows is [{val: 0.1}, {val: 0.2}, {val: 0.3}, {val: 0.4}], and the wave is [[0.2,0.1], [0.2]].此时Now the last three items's layering of rows will be setted as [0.2]. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
比较长的备注可以放到下面
Check List
What Changed
基于ecahrts-liquidfill,增加对水球图的封装
Breaking Change
Document Update