条形图(),或条图(),台湾常称为长条图,又称为柱状图、棒形图,是一种以长方形的长度为变量的統計圖表。长条图用来比较两个或以上的价值(不同时间或者不同条件),只有一个变量,通常利用于较小的数据集分析。长条图亦可横向排列,或用多维方式表达。
繪製長條圖時,長條柱或柱組中線須對齊項目刻度。相較之下,折線圖則是將數據代表之點對齊項目刻度。在數字大且接近時,兩者皆可使用波浪形省略符號,以擴大表現數據間的差距,增強理解和清晰度。
类似的图形表达为直方图,不过后者较长条图而言更复杂(直方图可以表达两个不同的变量)。
例子
这是一个柱形图的示例:
{
"version": 2, "width": 400, "height": 200,
"padding": {"top": 10, "left": 30, "bottom": 30, "right": 10},
"data": [
{
"name": "table",
"values": [
{"x": 1, "y": 28}, {"x": 2, "y": 55},
{"x": 3, "y": 43}, {"x": 4, "y": 91},
{"x": 5, "y": 81}, {"x": 6, "y": 53},
{"x": 7, "y": 19}, {"x": 8, "y": 87},
{"x": 9, "y": 52}, {"x": 10, "y": 48},
{"x": 11, "y": 24}, {"x": 12, "y": 49},
{"x": 13, "y": 87}, {"x": 14, "y": 66},
{"x": 15, "y": 17}, {"x": 16, "y": 27},
{"x": 17, "y": 68}, {"x": 18, "y": 16},
{"x": 19, "y": 49}, {"x": 20, "y": 15}
]
}
],
"scales": [
{
"name": "x",
"type": "ordinal",
"range": "width",
"domain": {"data": "table", "field": "x"}
},
{
"name": "y",
"range": "height",
"nice": true,
"domain": {"data": "table", "field": "y"}
}
],
"axes": [
{"type": "x", "scale": "x"},
{"type": "y", "scale": "y"}
],
"marks": [
{
"type": "rect",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x", "field": "x"},
"width": {"scale": "x", "band": true, "offset": -1},
"y": {"scale": "y", "field": "y"},
"y2": {"scale": "y", "value": 0}
},
"update": {
"fill": {"value": "steelblue"}
},
"hover": {
"fill": {"value": "red"}
}
}
}
]
}
其他
- 直方图
- 甘特图
参考
外部链接
*[https://web.archive.org/web/20081103002418/http://www.statcan.ca/english/edu/power/ch9/bargraph/bar.htm Bar Graphs],一个介绍网站
*[http://www.statistiker-wg.de/pgf/tutorials/barplot.htm Schritt für Schritt Anleitung] . 条形图建设、一步一步的教程
*[https://web.archive.org/web/20110508050639/http://www.planchart.co.uk/index.html Easy to use BARCHART Software Tool]. 一个简易的制作软件
*[https://web.archive.org/web/20100114162356/http://zh.pictovia.com/ Pictovia-图形发生器]. 一图形发生器
*[http://www.wiwiweb.de/statistik/haeufigkeit/unklassiert/stabdiagram.html Datendarstellung] . 数据表示
*[http://course.cug.edu.cn/21cn/%E7%BB%9F%E8%AE%A1%E5%AD%A6/zhang02/d0202011.htm 条形图: 基础知识] . 条形图: 基础知识
*[https://web.archive.org/web/20140823143650/http://www.jpowered.com/graphs-and-charts/bar-chart-history.htm History of the Bar Chart]. 条形图: 历史
*[https://web.archive.org/web/20140326065025/http://www.ucv.cl/web/estadistica/gr_grafbarras.htm Aplicación de un diagrama de barras]. 条形图的应用
Représentation graphique de données statistiques#Variables quantitatives discrètes
评论 (0)