ElementStacks

by hfrntt

HTML

<script src="http://highcharts.com/js/testing.js"></script>
<div id="container" style="height: 400px"></div>

JavaScript

$(document).ready(function () {
              var options = {
                  chart: {
                      renderTo: 'container',
                      defaultSeriesType: 'line',
                      zoomType: 'xy'
                  },
                  credits: {
                      enabled: false
                  },
                    exporting: {
                    enabled: false
                },
                  legend: {
                      layout: 'vertical',
                      backgroundColor: '#FFFFFF',
                      align: 'right',
                      verticalAlign: 'top',
                      //floating: true,
                      x: 0,
                      y: 100
                  },
                  tooltip: {
                      crosshairs: true,
                      formatter: function () {
                          return '<b>Hour: </b>' + Highcharts.dateFormat('%e. %b %Y, %H:00', this.x) +
                            '<br/><b>ID</b>' + this.series.name +
                            '<br/><b> Count: </b>' + this.y;
                      }
                  },
                  title: {
                      text: 'Test'
                  },
                  xAxis: {
                      type: 'datetime',
                      //dateTimeLabelFormats: { hour: '%H:00' },
                      categories: []
                  },
                  yAxis: {
                      title: {
                          text: 'Values'
                      },
                      min: 0
                  },
                  plotOptions: {
                      series: {
                  }
              },
              series: []
          };


    $.get('/echo/json', { data: 'hour,a,b,c,d\n01/01/11 01:00,10,20,10,20\n01/01/11 02:00,10,20,10,20\n01/01/11 03:00,10,20,10,20' }, function (data) {
              // Split the lines
        console.log(data)
              var lines = data.split('\n');
              var Series =...