﻿/**
 * 名盛房产走势图
 *http://www.msfc.cn
 * */


$(document).ready(function() {
	var chart;
	var option;
    option = {
        chart: {
            renderTo: 'chart_container',
            plotBackgroundImage: 'images/zst_bg.jpg',
            height: 166,
            width: 460,
            margin: [12, 25, 20, 55]
        },
        credits: {
            enabled: false
        },

        events: {
            selection: function() {
                alert('The chart was just redrawn');
            }
        },
        title: {
            text: '',
            style: {
            }
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            type: 'datetime',
            dateTimeLabelFormats: {
                second: '%H:%M:%S',
                minute: '%H:%M',
                hour: '%H:%M',
                day: '%m月%e日',
                week: '%e. %b',
                month: '%Y.%m',
                year: '%Y年'
            },
            minPadding: 0.04,
            maxPadding: 0.04,
            showFirstLabel: false,
            title: {
                text: null
            }
        },
        yAxis: {
            labels: {
                enabled: true,
                formatter: function() {
                    return Highcharts.numberFormat(this.value, 0);
                },
                style: {
                    color: '#8e8e8e',
                    fontWeight: 'bolder'

                }
            },

            reversed: false,
            title: {
                text: '单位：元'
            },
            gridLineWidth: 0,
            gridLineColor: '#f0f0f0',
            lineWidth: 1,
            min: 4000,
            max:5000,
            startOnTick: false,
            tickWidth: 1,
            tickInterval: 200,
            showFirstLabel: true,
            showLastLabel: true
        },
        tooltip: {
            formatter: function() {
                return '' +
				    Highcharts.dateFormat('%y年%m月', this.x) + '：' +
				    Highcharts.numberFormat(this.y, 2) + "";
            }
        },
        legend: {
            enabled: false
        },
        plotOptions: {
            area: {
                fillColor: {
                    linearGradient: [0, 0, 0, 180],
                    stops: [
						    [0, 'rgb(185, 209, 233)'],
						    [1, 'rgba(2,0,0,0)']
					    ]
                },
                dataLabels: {
                    enabled: true,
                    style: {
                        fontWeight: 'bold',
                        color: '#E17800 !important'
                    },
                    formatter: function() {
                        return Highcharts.numberFormat(this.y, 0);
                    }
                },
                lineWidth: 1,
                lineColor: '#687e93',
                marker: {
                    enabled: true,
                    states: {
                        hover: {
                            enabled: true,
                            fillColor: '#687e93',
                            radius: 5
                        }
                    },
                    radius: 2,
                    fillColor: '#99c2f1'
                },
                shadow: false,
                states: {
                    hover: {
                        lineWidth: 1
                    }
                }
            }
        },
        series: [{
            type: 'area',
            name: '房价走势',
            pointInterval: 30.5 * 24 * 3600 * 1000,
            pointStart: Date.UTC(2011, 07,06,05,04,03,02),
data: [4520,4470,4408,4380,4336,4340]
        }]
    };
    chart = new Highcharts.Chart(option);
});
