Categories
  Encyclosphere.org ENCYCLOREADER
  supported by EncyclosphereKSF

Bar chart

From Wikidoc - Reading time: 3 min

Editor-In-Chief: C. Michael Gibson, M.S., M.D. [1]


Overview[edit | edit source]

A bar chart, also known as a bar graph, is a chart with rectangular bars of lengths usually proportional to the magnitudes or frequencies of what they represent. Bar charts are used for comparing two or more values. The bars can be horizontally or vertically oriented. Sometimes a stretched graphic is used instead of a solid bar.

Example[edit | edit source]

The example chart is based on the results of the election for the European Parliament in 2004 and in 1999. The following table lists the number of seats allocated to each party group. The results of 1999 have been multiplied by 1.16933, to compensate for the change in number of seats between those years.

Group Seats (2004) Seats (1999) scaled
EUL 39 49
PES 200 210
EFA 42 56
EDD 15 19
ELDR 67 60
EPP 276 272
UEN 27 36
Other 66 29

A bar chart visualizing the above results of the 2004 election can look like this:
(If all the values were arranged in descending order this type of bar graph would be called a pareto chart.)

<timeline> ImageSize = width:400 height:240 PlotArea = width:300 height:150 left:50 bottom:40 AlignBars = late

DateFormat = yyyy Period = from:0 till:300 TimeAxis = orientation:vertical ScaleMajor = unit:year increment:50 start:0

BarData=

bar:1 text:"EUL"
bar:2 text:"PES"
bar:3 text:"EFA"
bar:4 text:"EDD"
bar:5 text:"ELDR"
bar:6 text:"EPP"
bar:7 text:"UEN"
bar:8 text:"Other"

Colors =

 id:lightgrey value:gray(0.7)
 id:darkgrey  value:gray(0.1)

TextData =

 pos:(10,220) textcolor:black fontsize:S
 text:Seats
 pos:(180,25) textcolor:black fontsize:S
 text:Group
 pos:(90,225) textcolor:black fontsize:M
 text:European Parliament Election 2004

PlotData=

width:18
bar:1 color:lightgrey from:0 till:39
bar:2 color:lightgrey from:0 till:200
bar:3 color:lightgrey from:0 till:42
bar:4 color:lightgrey from:0 till:15
bar:5 color:lightgrey from:0 till:67
bar:6 color:lightgrey from:0 till:276
bar:7 color:lightgrey from:0 till:27
bar:8 color:lightgrey from:0 till:66

</timeline>

This bar chart shows both the results of 2004, and those of 1999:

<timeline> ImageSize = width:480 height:240 PlotArea = width:360 height:150 left:50 bottom:40 AlignBars = late

DateFormat = yyyy Period = from:0 till:300 TimeAxis = orientation:vertical ScaleMajor = unit:year increment:50 start:0

BarData=

bar:17 text:
bar:2 text:
bar:1 text:
bar:17 text:
bar:4 text:
bar:3 text:
bar:17 text:
bar:6 text:
bar:5 text:
bar:17 text:
bar:8 text:
bar:7 text:
bar:17 text:
bar:10 text:
bar:9 text:
bar:17 text:
bar:12 text:
bar:11 text:
bar:17 text:
bar:14 text:
bar:13 text:
bar:17 text:
bar:16 text:
bar:15 text:

Colors =

 id:lightgrey value:gray(0.7)
 id:darkgrey  value:gray(0.4)

TextData =

tabs:(28-center,74-center,118-center,164-center,211-center,254-center,300-center,347-center)
pos:(10,220) textcolor:black fontsize:S
 text:Seats
 pos:(200,25) textcolor:black fontsize:S
 text:Group
 pos:(130,225) textcolor:black fontsize:M
 text:European Parliament Elections
 pos:(233,193) textcolor:black fontsize:S
 text:2004
 pos:(185,193) textcolor:black fontsize:S
 text:1999
 pos:(50,40) textcolor:black fontsize:S
 text:^EUL^PES^EFA^EDD^ELDR^EPP^UEN^Other

PlotData=

width:0
bar:1 color:lightgrey from:0 till:39 width:15
bar:2 color:darkgrey from:0 till:49 width:15
bar:3 from:0 till:200 width:15 color:lightgrey 
bar:4 color:darkgrey from:0 till:210 width:15
bar:5 from:0 till:42 width:15 color:lightgrey
from:280 till:300 color:darkgrey width:10
bar:6  
from:0 till:56 width:10 color:darkgrey width:15
bar:7
from:0 till:15 width:15 color:lightgrey 
from:280 till:300 color:lightgrey width:10 
bar:8 color:darkgrey from:0 till:19 width:15
bar:9 color:lightgrey from:0 till:67 width:15
bar:10 color:darkgrey from:0 till:60 width:15
bar:11 color:lightgrey from:0 till:276 width:15
bar:12 color:darkgrey from:0 till:272 width:15
bar:13 color:lightgrey from:0 till:27 width:15
bar:14 color:darkgrey from:0 till:36 width:15
bar:15 color:lightgrey from:0 till:66 width:15
bar:16 color:darkgrey from:0 till:29 width:15

</timeline>

History[edit | edit source]

The bar chart is possibly the invention of the Scots engineer and economist William Playfair (1759-1823). A bar chart was used in his work The Commercial and Political Atlas (London, 1786).

See also[edit | edit source]

External links[edit | edit source]

  • "bar graphs in Javascript".


Template:WikiDoc Sources


Licensed under CC BY-SA 3.0 | Source: https://www.wikidoc.org/index.php/Bar_chart
3 views | Status: cached on November 21 2024 23:38:20
↧ Download this article as ZWI file
Encyclosphere.org EncycloReader is supported by the EncyclosphereKSF