条形图[1](英语:bar chart),或 条图(英语:bar graph),台湾常称为 长条图[2],又称为 柱状图、棒形图,是一种以长方形的长度为变量的统计图表。长条图用来比较两个或以上的价值(不同时间或者不同条件),只有一个变量,通常利用于较小的数据集分析。长条图亦可横向排列,或用多维方式表达。
绘制长条图时,长条柱或柱组中线须对齐项目刻度。相较之下,折线图则是将数据代表之点对齐项目刻度。在数字大且接近时,两者皆可使用波浪形省略符号,以扩大表现数据间的差距,增强理解和清晰度。
类似的图形表达为直方图,不过后者较长条图而言更复杂(直方图可以表达两个不同的变量)。
例子
这是一个柱形图的示例:
<graph> {
"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"} } } } ]
}</graph>
其他
参考
外部链接
- Bar Graphs,一个介绍网站
- Schritt für Schritt Anleitung. 条形图建设、一步一步的教程
- Easy to use BARCHART Software Tool. 一个简易的制作软件
- Pictovia-图形发生器. 一图形发生器
- Datendarstellung. 数据表示
- 条形图: 基础知识 . 条形图: 基础知识
- History of the Bar Chart. 条形图: 历史
- Aplicación de un diagrama de barras. 条形图的应用