Diagramme à colonnes 3D avec valeurs nulles et 0

Nous avons déjà vu la configuration utilisée pour dessiner un graphique dans le chapitre Syntaxe de configuration Highcharts .

Un exemple d'un histogramme 3D avec des valeurs nulles et 0 est donné ci-dessous.

Configurations

Voyons maintenant les configurations / étapes supplémentaires prises.

chart.options3d

Configurez le type de graphique pour qu'il soit basé sur la 3D. Définissez le type sur «Colonne». Options pour rendre les graphiques en 3 dimensions.

var chart = {
   type: 'column',
   options3d: {
      enabled: true,
      alpha: 15,
      beta: 15,
      depth: 50,
      viewDistance: 25
   }
};

Exemple

highcharts_3d_column_null.htm

<html>
   <head>
      <title>Highcharts Tutorial</title>
      <script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
      </script>
      <script src = "https://code.highcharts.com/highcharts.js"></script>  
      <script src = "https://code.highcharts.com/highcharts-3d.js"></script>
   </head>
   
   <body>
      <div id = "container" style = "width: 550px; height: 400px; margin: 0 auto"></div>
      <script language = "JavaScript">
         $(document).ready(function() {  
            var chart = {      
               type: 'column',
               margin: 75,
               
               options3d: {
                  enabled: true,
                  alpha: 10,
                  beta: 25,
                  depth: 70
               }
            };
            var title = {
               text: '3D chart with null values'   
            };
            var subtitle = {
               text: 'Notice the difference between a 0 value and a null point'  
            };
            var xAxis = {
               categories: Highcharts.getOptions().lang.shortMonths
            };
            var yAxis = {
               title: {
                  text: null
               }
            };   
            var series = [{
               name: 'Sales',
               data: [2, 3, null, 4, 0, 5, 1, 4, 6, 3]
            }];     
            var json = {};   
            json.chart = chart; 
            json.title = title;   
            json.subtitle = subtitle;    
            json.xAxis = xAxis; 
            json.yAxis = yAxis; 
            json.series = series;   
            $('#container').highcharts(json);
         });
      </script>
   </body>
   
</html>

Résultat

Vérifiez le résultat.