Advertisement
widana

Highcharts

Oct 29th, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.79 KB | None | 0 0
  1. <script src="https://code.highcharts.com/highcharts.js"></script>
  2. <script src="https://code.highcharts.com/modules/exporting.js"></script>
  3. <h1 style="color:red" align="center">WELCOME TO LINE CHARTS</h1>
  4.  
  5.  
  6. <div id="container" name="container"></div>
  7.  
  8.  
  9. <script>
  10. Highcharts.chart('container', {
  11.     chart: {
  12.         zoomType: 'xy'
  13.     },
  14.     title: {
  15.         text: 'Multi Salesmen GP Amount'
  16.     },
  17.     subtitle: {
  18.         text: ''
  19.     },
  20.     xAxis: [{
  21.         categories: ['Budiman', 'Anto', 'Agus', 'Beduk','Amir','Andi','Santo','Dewi','Wati','Sule','Parto','Danang'],
  22.         crosshair: true
  23.     }],
  24.     yAxis: [{ // Primary yAxis
  25.         min :0,
  26.         max:100,
  27.         labels: {
  28.             format: '{value}%',
  29.             style: {
  30.                 color: Highcharts.getOptions().colors[2]
  31.             }
  32.         },
  33.         title: {
  34.             text: 'Average GP %',
  35.             style: {
  36.                 color: Highcharts.getOptions().colors[2]
  37.             }
  38.         },
  39.         opposite: true
  40.  
  41.     }, { // Secondary yAxis
  42.         gridLineWidth: 0,
  43.         min:0,
  44.         max:2000,
  45.         title: {
  46.             text: 'Nominal',
  47.             style: {
  48.                 color: Highcharts.getOptions().colors[0]
  49.             }
  50.         },
  51.         labels: {
  52.             format: '{value} Juta',
  53.             style: {
  54.                 color: Highcharts.getOptions().colors[0]
  55.             }
  56.         }
  57.  
  58.     },{
  59.         min:0,
  60.       max:2000,
  61.       gridLineWidth: 0,
  62.         title: {
  63.             text: 'Target GP',
  64.             style: {
  65.                 color: Highcharts.getOptions().colors[1]
  66.             }
  67.         },
  68.         labels: {
  69.             format: '{value} Juta',
  70.             style: {
  71.                 color: Highcharts.getOptions().colors[1]
  72.             }
  73.         },
  74.       opposite:true
  75.     }],
  76.     tooltip: {
  77.         shared: true
  78.     },
  79.     legend: {
  80.         layout: 'vertical',
  81.         align: 'left',
  82.         x: 80,
  83.         verticalAlign: 'top',
  84.         y: 20,
  85.         floating: true,
  86.         backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  87.    },
  88.     plotOptions: {
  89.       column: {
  90.            stacking: 'normal',
  91.            dataLabels: {
  92.                enabled: true,
  93.                color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
  94.            }
  95.        }
  96.    },
  97.    series: [{
  98.        name: 'January',
  99.        type: 'column',
  100.        yAxis: 1,
  101.        data: [400, 400, 400, 400, 400, 400, 400, 300, 400, 500, 100, 200],
  102.        tooltip: {
  103.            valueSuffix: ' JUTA'
  104.        }
  105.  
  106.    },{
  107.        name: 'Februari',
  108.        type: 'column',
  109.        yAxis: 1,
  110.        data: [400, 400, 400, 400, 400, 400, 300, 500, 600, 700, 600, 500],
  111.        tooltip: {
  112.            valueSuffix: ' JUTA'
  113.        }
  114.  
  115.    },{
  116.        name: 'Maret',
  117.        type: 'column',
  118.        yAxis: 1,
  119.        data: [200, 200, 200, 200, 200, 200, 100, 300, 400, 500, 100, 200],
  120.        tooltip: {
  121.            valueSuffix: ' JUTA'
  122.        }
  123.  
  124.    },{
  125.        name: 'April',
  126.        type: 'column',
  127.        yAxis: 1,
  128.        data: [200, 200, 200, 200, 200, 200, 100, 300, 400, 500, 100, 200],
  129.        tooltip: {
  130.            valueSuffix: ' JUTA'
  131.        }
  132.  
  133.    }
  134.    ,{
  135.        name: 'Traget GP',
  136.        type: 'spline',
  137.        yAxis: 2,
  138.        data: [1016, 1016, 1015.9, 1015.5, 1012.3, 1009.5, 1009.6, 1010.2, 1013.1, 1016.9, 1018.2, 1016.7],
  139.        marker: {
  140.            enabled: false
  141.        },
  142.        dashStyle: 'shortdot',
  143.        tooltip: {
  144.            valueSuffix: ''
  145.        }
  146.  
  147.    }, {
  148.        name: 'Average GP %',
  149.        type: 'spline',
  150.        data: [40,43,41,44,44,45,47,48,50,51,53,52],
  151.        tooltip: {
  152.            valueSuffix: 'Percentage'
  153.        }
  154.    }]
  155. });
  156.  
  157.  
  158. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement