Highcharts - New Actions

author(s): Torstein Hønsi Roydon DSouza

by Roydon DSouza

HTML

<script src="http://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 400px"></div>

JavaScript

$(function() {
     $('#container').highcharts({
         chart: {},
         title: {
             text: 'yo',
             style: {
                 "color": "#ffffff"
             }
         },
         credits: {
             enabled: false
         },
         legend: {
             enabled: false
         },
         yAxis: {

             title: {
                 align: 'high',
                 offset: 13,
                 text: 'CPA',
                 rotation: 0,
                 y: -10
             },
             lineWidth: 1,
             tickWidth: 0,
             gridLineWidth: 0,
             minorGridLineWidth: 0,
             labels: {
                 formatter: function() {
                     return '$' + this.value;
                 }
             }
         },
         xAxis: {
            tickWidth: 0,
             categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
         },


         tooltip: {
             crosshairs: true,

             formatter: function() {
                 console.log(this);
                 if (typeof(this.point.options.note) === 'undefined') {
                     return this.series.name + ':' + ' <b> $' + this.point.y + '</b><br/>';
                 } else {
                     return this.series.name + ':' + ' <b> $' + this.point.y + '<br>' + this.point.options.note.text + '</b><br/>';
                 }


             }
         },
         series: [{

             marker: {
                 enabled: false
             },
             states: {
                 hover: {
                     enabled: false
                 }
             },
             name: 'CPA',
             data: [29.9, {
                     marker: {
                         enabled: true,
                         fillColor: '#FFFFFF',
                         lineWidth: 4,
                         lineColor: "orange", // inherit from series
                         radius: 7,
           ...