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(polar): hide series bar when no data #11452

Closed
Ovilia opened this issue Oct 22, 2019 · 9 comments
Closed

feat(polar): hide series bar when no data #11452

Ovilia opened this issue Oct 22, 2019 · 9 comments

Comments

@Ovilia
Copy link
Contributor

Ovilia commented Oct 22, 2019

What problem does this feature solve?

For bar series in polar, it will display a circle when data value is 0. This may be strange to users if they don't know this is data 0.

Current

image

Expected

b4cc5c729bb80ad79e27207454924218

We should provide an optionmake it default that the developer can choose to display nothing when data is 0.

What does the proposed API look like?

No extra option.

@Ovilia Ovilia added this to the 4.6.0 milestone Oct 22, 2019
@Ovilia Ovilia self-assigned this Oct 22, 2019
@foolzhang
Copy link
Contributor

can we hava a try ? 😁

@Ovilia
Copy link
Contributor Author

Ovilia commented Oct 22, 2019

@foolzhang Sure! You're more than welcomed to make a pull request about this.

The bar series in the polar system was introduced in #11393.

I think we should not add the shape (or remove the previous shape) if the option is set to be true and the startAngle and the endAngle is the same. @pissang Is this the correct way?
Related code is https:/apache/incubator-echarts/pull/11393/files#diff-9f3e66cf4f6fab7ab14223075cd4df3bR339-R341.

And do we need to remove bars in the cartesian coordinate system also? The result would be not having borders any more for zero bars. I don't think this is necessary, but just out of the uniformity.

@pissang
Copy link
Contributor

pissang commented Oct 22, 2019

The main concern from me is that there will be no differences between '-' and 0 data if this option is enabled.

@Ovilia
Copy link
Contributor Author

Ovilia commented Oct 22, 2019

'-' means no data, but when there is data as 0, and the user wants to hide the circle (maybe he doesn't care about whether it will cause confusion with '-'), we should provide a way to do so.

@Ovilia
Copy link
Contributor Author

Ovilia commented Oct 22, 2019

@foolzhang You can set the fill and stroke to be 'none' when the startAngle and endAngle are the same, and set the shape to be silent: true to avoid using emphasis style when the user hovers on it.
This is also required for bars without roundCap and bar series under the cartesian coordinate system.
Please comment here if you need some extra help.

@foolzhang
Copy link
Contributor

you mean is No extra option and data 0 should hide series bar ,is right?
currently roundCap is only available for polar . how about like this
in BarView.js

polar:function(...){
   // ...
   var ShapeClass = (!isRadial && (roundCap && layout.startAngle!=layout.endAngle)) ? Sausage : graphic.Sector;
  // ...
}

i think this easy to satisfy your request

@Ovilia

@Ovilia
Copy link
Contributor Author

Ovilia commented Oct 25, 2019

No extra option and data 0 should hide series bar

Yes.

We still need to add the shape, only that the fill and stroke are set to be transparent. Otherwise, it may cause error when data update since there was no previous shape.

@foolzhang
Copy link
Contributor

@Ovilia pr

@Ovilia
Copy link
Contributor Author

Ovilia commented Nov 21, 2019

Merged in #11557. Thanks @foolzhang !

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

No branches or pull requests

3 participants