/**默认配置**/
/**
图表类型line, spline, area, areaspline, 
需要其他配置:column, bar, pie , scatter 
xAxis:x 轴
xAxis::labels::rotation:字体倾斜
yAxis:y 轴
**/
Highcharts.theme = {
    colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4', '#0099cc'],
    chart: {
        backgroundColor: {
            linearGradient: [0, 0, 500, 500],
            stops: [
				[0, 'rgb(255, 255, 255)'],
				[1, 'rgb(240, 240, 255)']
			]
        }
,
        borderWidth: 2,
        plotBackgroundColor: 'rgba(255, 255, 255, .9)',
        plotShadow: true,
        plotBorderWidth: 1
    },
    title: {
        style: {
            color: '#0099cc',
            font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
        }
    },
    subtitle: {
        style: {
            color: '#888',
            font: 'bold 12px "Trebuchet MS", Verdana, sans-serif',
            margin: '2px 0px'
        }
    },
    xAxis: {
        gridLineWidth: 1,
        lineColor: '#000',
        tickColor: '#000',
        labels: {
            style: {
                color: '#000',
                font: '11px Trebuchet MS, Verdana, sans-serif'
            }
        },
        title: {
            style: {
                color: '#333',
                fontWeight: 'bold',
                fontSize: '12px',
                fontFamily: 'Trebuchet MS, Verdana, sans-serif'
            }
        }
    },
    yAxis: {
        minorTickInterval: 'auto',
        lineColor: '#000',
        lineWidth: 1,
        tickWidth: 1,
        tickColor: '#000',
        labels: {
            style: {
                color: '#000',
                font: '11px Trebuchet MS, Verdana, sans-serif'
            }
        },
        title: {
            style: {
                color: '#333',
                fontWeight: 'bold',
                fontSize: '12px',
                fontFamily: 'Trebuchet MS, Verdana, sans-serif'
            }
        }
    },
    legend: {
        itemStyle: {
            font: '9pt Trebuchet MS, Verdana, sans-serif',
            color: 'black'

        },
        itemHoverStyle: {
            color: '#039'
        },
        itemHiddenStyle: {
            color: 'gray'
        }
    },
    labels: {
        style: {
            color: '#99b'
        }
    }
};

// Apply the theme
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
/**创建一个图表**/
function CreateChar(chartsData) {
   return new Highcharts.Chart({
       chart: { defaultSeriesType: chartsData.chr_seriesType, renderTo: chartsData.chr_render, plotBackgroundColor: null, plotBorderWidth: null },
        title: { text: chartsData.chr_title },
        subtitle: { text: chartsData.chr_small_title },
        xAxis: { categories: chartsData.chr_x_datas, labels: { rotation: -30, align: 'right', style: { font: 'normal 12px 宋体', color: '#494'}} },
        yAxis: { title: { text: chartsData.chr_y_title} },
        tooltip: { enabled: true, formatter: function () { return '<b>' + this.x + '</b><br/>' + this.series.name + ': ' + Highcharts.numberFormat(this.y, 0); } },
        plotOptions: { line: { dataLabels: { enabled: true }, enableMouseTracking: true} },
        series: chartsData.chr_datas
    });
}

/* 使用实例**
jquery 1.6.2
引入文件 :highcharts.js defaultconfig.js

//图表数据
var chartsData = {
chr_render: "container",    //显示容器
chr_seriesType: 'spline',   //绘制样式
chr_title: "重返大航海",    //主标题
chr_small_title: "2011年 用户在线时间统计", //副标题
//X 轴显示
chr_x_datas: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
//Y 轴显示
chr_y_title: "人/次",
//数据
chr_datas: [
{ name: '杭州', data: [70, 69, 95, 145, 184, 215, 252, 265, 233, 183, 139, 96] },
{ name: '江西', data: [40, 29, 55, 245, 184, 115, 352, 365, 233, 383, 239, 36] },
{ name: '北京', data: [140, 129, 155, 145, 284, 215, 152, 165, 133, 283, 139, 136] },
{ name: '湖南7', data: [39, 42, 57, 85, 119, 152, 170, 166, 142, 103, 66, 48] }
]
}
//创建图表 数据库配置参数
CreateChar(chartsData);
*/