Using Highcharts and displaying a message on top or on a chart when there is no data

I would like to know if there is a built-in or accepted way to show a label or message on a chart (or where the chart will be) if there are no data series.

I could not find anything in the Highcharts docs, and I try to stay away from using jQuery (or just JavaScript in general) to check if the result has data, and then change the DOM myself.

The data comes as json from the MVC 3 controller call if this helps or changes something.

Ideally, this message will be displayed on an empty chart so that users know that the chart object exists.

Thanks!

+6
source share
1 answer

Now there is an official plugin that displays the message "There is no data to display" after the download message when there is no data in the chart. I found this very convenient when the user is allowed to select a time range from the search form and filter, and the search results are not returned. It looks much better than having an empty chart.

Here is the link declaring the plugin and the jsfiddle example.

http://highcharts.uservoice.com/forums/55896-general/suggestions/1065633-display-no-data-to-display

+5
source

Source: https://habr.com/ru/post/944575/


All Articles