Combining Gauge chart with Line Chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

Combining Gauge chart with Line Chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <style id="compiled-css" type="text/css">

#mainContainer {//w  ww  .  java2 s  . c  o  m
   position: relative;
}
#container2 {
   position: absolute;
   top: 40px;
   left: 90px;
}


      </style> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/highcharts-more.js"></script> 
      <div id="mainContainer"> 
         <div id="container1"></div> 
         <div id="container2"></div> 
      </div> 
      <script type="text/javascript">
Highcharts.chart('container1', {
    series: [{
        data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
    }]
});
Highcharts.chart('container2', {
    chart: {
        type: 'gauge',
        height: 200,
        width: 200,
        backgroundColor: 'rgba(0,0,0,0)'
    },
    credits: {
       enabled: false
    },
    title: {
       text: ''
    },
    yAxis: {
        min: 0,
        max: 200
    },
    pane: {
        startAngle: -150,
        endAngle: 150
    },
    series: [{
        data: [110]
    }]
});

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

Related Tutorials