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

Loading and No data to display are overlapped. #4588

Closed
fizerkhan opened this Issue Sep 19, 2015 · 11 comments

Comments

Projects
None yet
8 participants
@fizerkhan

fizerkhan commented Sep 19, 2015

I uses option of loading: true to show the message of Loading while fetching the data. I also uses no-data-to-display.js module to display a message for pie chart.

But no data to display is message shown along with Loading message. Can we hide no data to display message while loading?

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Sep 21, 2015

Contributor

That snippet should do the thing:

    chart: {
        events: {
            load: function() {
                this.showLoading(); // show loading message
                this.hideNoData();  // hide no data message
            }
        }  
    },

But for some reasons it doesn't work: http://jsfiddle.net/594ntok2/ Looks like chart.events.load is called before event added this way: H.addEvent(chart, 'load', handleNoData); (from no-data-to-display.js module).

Contributor

pawelfus commented Sep 21, 2015

That snippet should do the thing:

    chart: {
        events: {
            load: function() {
                this.showLoading(); // show loading message
                this.hideNoData();  // hide no data message
            }
        }  
    },

But for some reasons it doesn't work: http://jsfiddle.net/594ntok2/ Looks like chart.events.load is called before event added this way: H.addEvent(chart, 'load', handleNoData); (from no-data-to-display.js module).

@jandillmann

This comment has been minimized.

Show comment
Hide comment
@jandillmann

jandillmann Jun 8, 2016

Is there a workaround for this? Having both messages shown overlapping doesn't make much sense…

jandillmann commented Jun 8, 2016

Is there a workaround for this? Having both messages shown overlapping doesn't make much sense…

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi
Collaborator

TorsteinHonsi commented Jun 9, 2016

@oysteinmoseng

This comment has been minimized.

Show comment
Hide comment
@oysteinmoseng

oysteinmoseng Jun 9, 2016

Collaborator

@jandillmann: The most "politically correct" workaround is perhaps to override chart.hasData to return true once data is being loaded. Alternatively, you can override chart.showNoData to do nothing. Remember to restore the old functions when loading has finished if you still want the no-data message to appear (e.g. when hiding series). Demo: http://jsfiddle.net/594ntok2/1/.

Collaborator

oysteinmoseng commented Jun 9, 2016

@jandillmann: The most "politically correct" workaround is perhaps to override chart.hasData to return true once data is being loaded. Alternatively, you can override chart.showNoData to do nothing. Remember to restore the old functions when loading has finished if you still want the no-data message to appear (e.g. when hiding series). Demo: http://jsfiddle.net/594ntok2/1/.

@oysteinmoseng oysteinmoseng self-assigned this Jun 9, 2016

@oysteinmoseng oysteinmoseng added this to the 5.0.11 milestone Mar 29, 2017

@jon-a-nygaard jon-a-nygaard modified the milestones: 5.0.12, 5.0.11 May 18, 2017

@TorsteinHonsi TorsteinHonsi removed this from the 5.0.12 milestone May 23, 2017

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi May 23, 2017

Collaborator

Is this still valid? Can't reproduce it.

Collaborator

TorsteinHonsi commented May 23, 2017

Is this still valid? Can't reproduce it.

@oysteinmoseng

This comment has been minimized.

Show comment
Hide comment
@oysteinmoseng
Collaborator

oysteinmoseng commented May 23, 2017

@TorsteinHonsi Seems valid, see master demo vs bugfix demo.

@oysteinmoseng

This comment has been minimized.

Show comment
Hide comment
@oysteinmoseng

oysteinmoseng May 23, 2017

Collaborator

Note that Chart.hasData should return chart.loadingShown, not false. That fix-commit seems to just delete the return statement, but the actual code line in bugfix is chart.loadingShown; // #4588. None of the series have data, but don't show message if we are loading.

Collaborator

oysteinmoseng commented May 23, 2017

Note that Chart.hasData should return chart.loadingShown, not false. That fix-commit seems to just delete the return statement, but the actual code line in bugfix is chart.loadingShown; // #4588. None of the series have data, but don't show message if we are loading.

@scottadmi

This comment has been minimized.

Show comment
Hide comment
@scottadmi

scottadmi Aug 17, 2017

This solution does not seem to address the case in which the graph is initially displayed empty (with the no data message), and the chart showLoading() is subsequently called (to indicate data refresh is being attempted) - in which case neither or "load" or "redraw" event are fired to reassess this message.

scottadmi commented Aug 17, 2017

This solution does not seem to address the case in which the graph is initially displayed empty (with the no data message), and the chart showLoading() is subsequently called (to indicate data refresh is being attempted) - in which case neither or "load" or "redraw" event are fired to reassess this message.

@KacperMadej

This comment has been minimized.

Show comment
Hide comment
@KacperMadej

KacperMadej Aug 17, 2017

Contributor

@scottadmi Could you provide a live demo for the case?

Contributor

KacperMadej commented Aug 17, 2017

@scottadmi Could you provide a live demo for the case?

@scottadmi

This comment has been minimized.

Show comment
Hide comment
@scottadmi

scottadmi Aug 18, 2017

The second chart demonstrates this case. In our real usage, we poll for the presence of data at certain intervals, but show the user "loading" during these attempts so they are aware which creates the odd effect in the second pane if there was no data initially.

http://jsfiddle.net/bjooth9q/2/

scottadmi commented Aug 18, 2017

The second chart demonstrates this case. In our real usage, we poll for the presence of data at certain intervals, but show the user "loading" during these attempts so they are aware which creates the odd effect in the second pane if there was no data initially.

http://jsfiddle.net/bjooth9q/2/

@KacperMadej

This comment has been minimized.

Show comment
Hide comment
@KacperMadej

KacperMadej Aug 18, 2017

Contributor

In this case before showing the loading info you could hide the no-data label - http://jsfiddle.net/bjooth9q/3/ This doesn't require redrawing of a chart.

Contributor

KacperMadej commented Aug 18, 2017

In this case before showing the loading info you could hide the no-data label - http://jsfiddle.net/bjooth9q/3/ This doesn't require redrawing of a chart.

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