"angular-highcharts": "5.2.12"
"highcharts": "6.1.0"
"@types/highcharts": "5.0.19"
Here is a live demo https://stackblitz.com/edit/highcharts-toggling-nodata,
First of all I would like to point out that the usage and enabling of the noData functionality for angular highCharts specifically is quite shady. There is no proper guideline available any where regarding how to use it properly.
Now coming to the real issue, I am importing noData using the following way,
Code: Select all
import NoDataToDisplay from 'highcharts/modules/no-data-to-display';
...
@NgModule({
...
providers: [
{ provide: HIGHCHARTS_MODULES, useFactory: () => [NoDataToDisplay] }
]
Code: Select all
const options = this.chartConfig.ref.options;
options.lang.noData = `no data from: ${chartData.customMsgFromDate} to ${chartData.customMsgEndDate}.`;
this.chartConfig.ref.update(options, true);
P.S I did manage to find this(http://jsfiddle.net/pszyn1e4/1/) fiddle for achieving things using plain JavaScript but haven't been able to use the same approach with angular highcharts. Here is the code used in the fiddle.
if (!chart.hasData()) { chart.hideN ... ssage"); }
Are these methods not available for the highcharts version I am using? do I need to upgrade to the latest version? Any help would be highly appreciated.