Highcharts 基本条形图
配置
chart 配置
设置 chart 的 type 属性 为 bar ,chart.type 描述了图表类型。默认值为 "line"。
var chart = {
type: ‘bar‘
};
实例
文件名:highcharts_bar_basic.htm
<html>
<head>
<meta charset="UTF-8" />
<title>Highcharts 教程 | 菜鸟教程(runoob.com)</title>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
</head>
<body>
<div id="container" style="width: 550px; height: 400px; margin: 0 auto"></div>
<script language="JavaScript">
$(document).ready(function() {
var chart = {
type: ‘bar‘
};
var title = {
text: ‘Historic World Population by Region‘
};
var subtitle = {
text: ‘Source: Wikipedia.org‘
};
var xAxis = {
categories: [‘Africa‘, ‘America‘, ‘Asia‘, ‘Europe‘, ‘Oceania‘],
title: {
text: null
}
};
var yAxis = {
min: 0,
title: {
text: ‘Population (millions)‘,
align: ‘high‘
},
labels: {
overflow: ‘justify‘
}
};
var tooltip = {
valueSuffix: ‘ millions‘
};
var plotOptions = {
bar: {
dataLabels: {
enabled: true
}
}
};
var legend = {
layout: ‘vertical‘,
align: ‘right‘,
verticalAlign: