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

showEmpty doesn't work when min and max are defined #705

Closed
slawekkolodziej opened this issue Jan 17, 2012 · 10 comments
Closed

showEmpty doesn't work when min and max are defined #705

slawekkolodziej opened this issue Jan 17, 2012 · 10 comments

Comments

@slawekkolodziej
Copy link
Contributor

As in title - when axis min and max are defined, axis doesn't hide. However, it hides when you set just min, or just max. See the demo: http://jsfiddle.net/c92Zn/

@TorsteinHonsi
Copy link
Collaborator

Currently, showEmtpy only has an effect when the axis doesn't have
information on the scale at all.

@pawelfus
Copy link
Contributor

Possible workaround: http://jsfiddle.net/bfrHc/4/

@SteveSchreiner
Copy link

Are there any plans to fix this? Or maybe suggest a work around? Thanks

@alexcohaniuc
Copy link

Can you elaborate please on how this is not a bug?

@TorsteinHonsi
Copy link
Collaborator

Empty in this case means that the axis does not have information that defines how it should draw labels. Once you set min and max, it does have that information.

But from your comment I assume that you consider an empty axis an axis that has no populated data series?

@alexcohaniuc
Copy link

Hi,
Yes, makes sense now.
Would be very useful to have a showEmptyData or something.

Is that something you might consider adding?
As I've seen a couple of threads having the same issue.

@pawanvjadhav
Copy link

+1 are you going to add this configuration?

@TorsteinHonsi
Copy link
Collaborator

I am a bit concerned about creating new issues, but I did a small refactoring that makes this accessible from the outside, so we can now override the Axis.prototype.hasData method like this:

Highcharts.Axis.prototype.hasData = function () {
    return this.hasVisibleSeries;
};

View it live on jsFiddle

@hon2a
Copy link

hon2a commented Apr 12, 2017

I'd also appreciate a second flag showWithoutSeries to act as a stronger version of showEmpty. In our current project, we need to set min and max in almost all cases (to keep the plot area in sync between multiple charts), but showing axes without series makes no sense in our case. It's especially unhelpful in multi-axis charts where hiding a series could greatly increase the ammount of space available for plot area if the axis belonging to that series was hidden as well.

@TorsteinHonsi Thanks for the work-around though, that's sufficient for us as we don't have any use for the current version of showEmpty.

@KacperMadej
Copy link

In case you want to show no-data message with custom conditions then no-data-to-display module supports showing message about lack of data on function call as presented in a demo from API reference:
https://api.highcharts.com/highcharts/noData

Closing this issue as this is not a bug.

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

8 participants