Skip to content
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

Merged
merged 5 commits into from
Oct 9, 2018
Merged

feat: 增加水球图 #542

merged 5 commits into from
Oct 9, 2018

Conversation

maxy612
Copy link
Collaborator

@maxy612 maxy612 commented Oct 2, 2018

Check List

  • Every Commit message is meaningful
  • Synchronized with the master branch
  • CI passed

What Changed

基于ecahrts-liquidfill,增加对水球图的封装

Breaking Change

  • Yes
  • No

Document Update

  • Yes
  • No

基于ecahrts-liquidfill,增加对水球图的封装
@maxy612 maxy612 requested a review from xiguaxigua October 2, 2018 13:11
color: ['red', 'green', 'yellow'],
label: {
formatter (options) {
return options.seriesName + ': ' + options.value
Copy link
Contributor

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}

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 }))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

换行

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该不需要对数值做判断,只要把值直接添加上去就行了。

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']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要删除

Copy link
Contributor

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]]

results.push(result)
})

if (results.length > 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

位置最好是不要做特殊处理,让用户来配置,可以省去很多麻烦。

chartData: {
columns: ['city', 'percent'],
rows: [{
city: '上海',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

英文文档尽量别出现中文

| 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]. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

比较长的备注可以放到下面

@maxy612 maxy612 merged commit f6e14a4 into ElemeFE:master Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants