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

Fix dataview show NaN when user use dataset #11849

Merged
merged 3 commits into from Aug 4, 2020
Merged

Conversation

susiwen8
Copy link
Contributor

@susiwen8 susiwen8 commented Dec 14, 2019

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

When dataset is used, data view shows NaN.

Fixed issues

Close #7533

Details

Before: What was the problem?

Screen Shot 2019-12-14 at 12 45 09

After: How is it fixed in this PR?

Screen Shot 2019-12-14 at 12 44 34

Usage

Are there any API changes?

  • The API has been changed.

Related test cases or examples to use the new APIs

NA.

Others

Merging options

  • Please squash the commits into a single one when merge.

Other information

Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

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

Please provide a test case under test for this issue.

// Using `series.name` as dimension when dataset is being used.
columns.push(series.getRawData().mapArray(series.dependentModels.dataset.length
? series.name
: valueAxisDim, function (val) {
Copy link
Member

@100pah 100pah Apr 21, 2020

Choose a reason for hiding this comment

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

series.name happens to be the dimension name in this case but does not necessarily always be dimension name.
And I think the indention (, function (val) { ... ) is not good.

I think a simple fix of the issue could be:

var rawData = series.getRawData();
columns.push(rawData.mapArray(rawData.mapDimension(valueAxisDim), function (val) {
    return val;
}));

@100pah 100pah modified the milestones: 4.8.0, 4.9.0 Apr 21, 2020
Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

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

LGTM

@pissang pissang merged commit 23596ac into apache:master Aug 4, 2020
@echarts-bot
Copy link

echarts-bot bot commented Aug 4, 2020

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

数据视图中显示NaN
4 participants