AUD Line Chart with HighCharts

by Evan Sharp

HTML

<script src="http://code.highcharts.com/highcharts.js"></script>
<div class="chartinfo"></div>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>

JavaScript

$(function() {
    var chart;
    $.getJSON("http://marketing.devus.local/GetJson.aspx?File=/everbank_2012/_json/odatafixed.json&_=?");
});

function callback(json) {
    var dataX = [],
        dataY = [];
    $.each(json.graph.data.set, function(i, d) {
        dataX.push(d.closeDateTime);
        dataY.push(d.close);
    });
    chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'line'
        },
        title: null,
        credits: {
            enabled: false
        },
        colors: ["#B1BC34"],
        xAxis: {
            categories: dataX,
            labels: {
                rotation: -45,
                align: 'right'
            },
            tickmarkPlacement: "on"
        },
        yAxis: {
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'}],
            title: null
        },
        tooltip: {
            formatter: function() {
                $(".chartinfo").html("Close = " + this.y + " | " + this.x);
                return false;
            },
            crosshairs: [{
                width: 1,
                color: '#6a6a58',
                dashStyle: "shortdot"
            }, {
                width: 1,
                color: '#6a6a58',
                dashStyle: "shortdot"
            }]
        },
        legend: {
            enabled: false
        },
        series: [{
            name: 'AUD',
            data: dataY}]
    });
}