Advertisement
Guest User

Untitled

a guest
Mar 5th, 2012
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var chart;
  2. $(document).ready(function() {
  3.     chart = new Highcharts.Chart({
  4.         chart: {
  5.             renderTo: 'container',
  6.             defaultSeriesType: 'spline'
  7.         },
  8.         title: {
  9.             text: 'Wind speed during two days'
  10.         },
  11.         subtitle: {
  12.             text: 'October 6th and 7th 2009 at two locations in Vik i Sogn, Norway'
  13.         },
  14.         xAxis: {
  15.             type: 'datetime'
  16.         },
  17.         yAxis: {
  18.             title: {
  19.                 text: 'Wind speed (m/s)'
  20.             },
  21.             min: 0,
  22.             minorGridLineWidth: 0,
  23.             gridLineWidth: 0,
  24.             alternateGridColor: null,
  25.             plotBands: [{ // Light air
  26.                 from: 0.3,
  27.                 to: 1.5,
  28.                 color: 'rgba(68, 170, 213, 0.1)',
  29.                 label: {
  30.                     text: 'Light air',
  31.                     style: {
  32.                         color: '#606060'
  33.                     }
  34.                 }
  35.             }, { // Light breeze
  36.                 from: 1.5,
  37.                 to: 3.3,
  38.                 color: 'rgba(0, 0, 0, 0)',
  39.                 label: {
  40.                     text: 'Light breeze',
  41.                     style: {
  42.                         color: '#606060'
  43.                     }
  44.                 }
  45.             }, { // Gentle breeze
  46.                 from: 3.3,
  47.                 to: 5.5,
  48.                 color: 'rgba(68, 170, 213, 0.1)',
  49.                 label: {
  50.                     text: 'Gentle breeze',
  51.                     style: {
  52.                         color: '#606060'
  53.                     }
  54.                 }
  55.             }, { // Moderate breeze
  56.                 from: 5.5,
  57.                 to: 8,
  58.                 color: 'rgba(0, 0, 0, 0)',
  59.                 label: {
  60.                     text: 'Moderate breeze',
  61.                     style: {
  62.                         color: '#606060'
  63.                     }
  64.                 }
  65.             }, { // Fresh breeze
  66.                 from: 8,
  67.                 to: 11,
  68.                 color: 'rgba(68, 170, 213, 0.1)',
  69.                 label: {
  70.                     text: 'Fresh breeze',
  71.                     style: {
  72.                         color: '#606060'
  73.                     }
  74.                 }
  75.             }, { // Strong breeze
  76.                 from: 11,
  77.                 to: 14,
  78.                 color: 'rgba(0, 0, 0, 0)',
  79.                 label: {
  80.                     text: 'Strong breeze',
  81.                     style: {
  82.                         color: '#606060'
  83.                     }
  84.                 }
  85.             }, { // High wind
  86.                 from: 14,
  87.                 to: 15,
  88.                 color: 'rgba(68, 170, 213, 0.1)',
  89.                 label: {
  90.                     text: 'High wind',
  91.                     style: {
  92.                         color: '#606060'
  93.                     }
  94.                 }
  95.             }]
  96.         },
  97.         tooltip: {
  98.             formatter: function() {
  99.                     return ''+
  100.                     Highcharts.dateFormat('%e. %b %Y, %H:00', this.x) +': '+ this.y +' m/s';
  101.             }
  102.         },
  103.         plotOptions: {
  104.             spline: {
  105.                 lineWidth: 4,
  106.                 states: {
  107.                     hover: {
  108.                         lineWidth: 5
  109.                     }
  110.                 },
  111.                 marker: {
  112.                     enabled: false,
  113.                     states: {
  114.                         hover: {
  115.                             enabled: true,
  116.                             symbol: 'circle',
  117.                             radius: 5,
  118.                             lineWidth: 1
  119.                         }
  120.                     }
  121.                 },
  122.                 pointInterval: 3600000, // one hour
  123.                 pointStart: Date.UTC(2009, 9, 6, 0, 0, 0)
  124.             }
  125.         },
  126.         series: [{
  127.             name: 'Hestavollane',
  128.             data: [4.3, 5.1, 4.3, 5.2, 5.4, 4.7, 3.5, 4.1, 5.6, 7.4, 6.9, 7.1,
  129.                 7.9, 7.9, 7.5, 6.7, 7.7, 7.7, 7.4, 7.0, 7.1, 5.8, 5.9, 7.4,
  130.                 8.2, 8.5, 9.4, 8.1, 10.9, 10.4, 10.9, 12.4, 12.1, 9.5, 7.5,
  131.                 7.1, 7.5, 8.1, 6.8, 3.4, 2.1, 1.9, 2.8, 2.9, 1.3, 4.4, 4.2,
  132.                 3.0, 3.0]
  133.  
  134.         }, {
  135.             name: 'Voll',
  136.             data: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.3, 0.0,
  137.                 0.0, 0.4, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
  138.                 0.0, 0.6, 1.2, 1.7, 0.7, 2.9, 4.1, 2.6, 3.7, 3.9, 1.7, 2.3,
  139.                 3.0, 3.3, 4.8, 5.0, 4.8, 5.0, 3.2, 2.0, 0.9, 0.4, 0.3, 0.5, 0.4]
  140.         }]
  141.         ,
  142.         navigation: {
  143.             menuItemStyle: {
  144.                 fontSize: '10px'
  145.             }
  146.         }
  147.     });
  148. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement