Heatmap chart background color for invalid data - Javascript highcharts

Javascript examples for highcharts:Heatmap Chart

Description

Heatmap chart background color for invalid data

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/heatmap.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container" style="height: 400px; min-width: 310px; max-width: 800px; margin: 0 auto"></div> 
      <script type="text/javascript">
(function (H) {/*ww w . jav a  2s  .co  m*/
   H.wrap(H.ColorAxis.prototype, 'toColor', function (proceed, value, point) {
      if(typeof value === 'string')
         return 'rgb(255,105,180)';
      else
         return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
   });
}(Highcharts));
Highcharts.chart('container', {
    chart: {
        type: 'heatmap'
    },
    colorAxis: {
        min: 0,
        minColor: '#FFFFFF',
        maxColor: Highcharts.getOptions().colors[0]
    },
    series: [{
        borderWidth: 1,
        data: [[0, 0, 1], [1, 0, "B"], [2, 0, "C"], [3, 0, 6], [4, 0, 10]],
        dataLabels: {
            enabled: true
        }
    }]
});

      </script>  
   </body>
</html>

Related Tutorials