Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Accuracy  





2 Creating graphs for Wikipedia  



2.1  Vega  





2.2  Methods using Wikipedia templates  



2.2.1  Timeline  





2.2.2  Single statistic  





2.2.3  Pie chart  





2.2.4  Horizontal bar graph  



2.2.4.1  Bar chart  





2.2.4.2  Bar box  





2.2.4.3  Stacked bar  







2.2.5  Vertical bar graph  





2.2.6  Brick chart  





2.2.7  Line charts  





2.2.8  Geographical maps  





2.2.9  Colors  







2.3  Methods outside Wikipedia  







3 See also  














Wikipedia:Graphs and charts






Català
Bahasa Indonesia
 

Edit links
 









Project page
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Agraphorchartordiagram is a diagrammatical illustration of a set of data. If the graph is uploaded as an image file, it can be placed within articles just like any other image.

Graphs must be accurate and convey information efficiently. They should be viewable at different computer screen resolutions. Ideally, graphs will also be aesthetically pleasing.

Please note that "graph", "chart" and "diagram" are ambiguous terms, sometimes used interchangeably.

Accuracy[edit]

Graphs that show a trend of data should illustrate the trend accurately in its context, rather than illustrating the trend in an exaggerated or sensationalized way. In short, don't draw misleading graphs.

Choose a type of graph that is appropriate for the data you are illustrating.

Creating graphs for Wikipedia[edit]

Vega[edit]

A graph-making tool called Vega was introduced in May 2015. You can use it to make charts and maps. If you have an old browser, you will see images instead. You can learn how to use it and write help pages for your wiki. You can use the Vega v2 edit tool to make charts and copy the code to your wiki. Note that only Vega 2 is supported at the moment. Charts and maps use complex code, and you should put them into templates.

Methods using Wikipedia templates[edit]

Timeline[edit]

A variety of templates and styles are available to create timelines.

Single statistic[edit]

70 / 100

{{Composition bar}} can be used to provide a single statistic.

This example shows 70% (70 out of 100), but the template is flexible and can show any positive integer out of any (equal or larger) integer. The template is 100 pixels wide, so the results are rounded to 1%.

To use this, copy the above and replace the values ("70" and "100" in the middle line) and the caption ("70% of women...") with your data. The color can also be changed, from "red" in this example to "blue", "green", or any hex color.

If you want to present multiple statistics, you can stack multiple copies of the template inside the first cell of the table.

Pie chart[edit]

  One (40%)
  Two (32%)
  Three (12%)
  Four (9%)
  Other (7%)

{{Pie chart}} is an experimental graph-drawing template that produces a pie chart 200 pixels wide in the article. When making a pie chart, ensure that the segments are ordered by size (largest to smallest) and in a clockwise direction.[clarification needed]

Setting the other parameter to yes will pad the chart so that the values total to 100.

This example was created by typing the following code:

{{Pie chart
|other = yes
|value1 =40|label1 = One
|value2 =32|label2 = Two
|value3 =12|label3 = Three
|value4 =9|label4 = Four}}

Up to 30 slices can be included.

Horizontal bar graph[edit]

Bar chart[edit]

{{Bar chart}} is a template that displays the data as a horizontal bar chart. The width of the graph can be changed.

Women's life expectancy at birth
Country Predicted median age at death
China

71
India

60
USA

79
Indonesia

71
Brazil

67
Bar box[edit]

{{Bar box}} is a template that displays the data as a horizontal bar chart. The width of the chart can be changed, but care must be taken to make sure the bars stay within the box on many browsers.

kinds of stuff pcs.
Foobar

33,213
Barfoo

123,123
Bazbar

210,121
Barfoobaz

12,854
Some stuff displayed by quantity.
Stacked bar[edit]

{{Stacked bar}} is a template that displays a set of data as a single bar of a stacked bar chart. The template supports up to 12 segments in their proportional lengths compared to a total, along with captions for each section. Care must be taken that the captions do not overlap excessively in smaller resolutions, and in many cases you may not be able to include captions if the segment(s) is too small.

Number of video game articles in the 1970s and earlier by year

<1970s

71

72

73

74

1975

1976

1977

1978

1979



Vertical bar graph[edit]

Module:Chart is a Lua module that may be used to create several different types of vertical bar graphs.

A standard vertical bar graph

10

20

30

40

50

60

Before

During

After

Post mortem


A stacked vertical bar graph

25

50

75

100

125

150

Before

During

After

Post mortem

Brick chart[edit]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Causes of death

  Cancer - 13 %
  Unintentional injuries - 6 %
  Uncertain - 0.2 %
  Other - 21.8 %

{{Brick chart}} is a simple block-oriented chart template. It assumes that everything must add up to total=100 (or specify), and fills in any missing amounts with "other".

You can label (and optionally choose colors for) each item, and the labels can be wikilinks to relevant articles. Now, decimal amounts are supported (tiny amounts will appear as slivers).

Line charts[edit]

The template {{Graph:Chart}} implements line charts, such as:

{{Graph:Chart}} can also draw area charts, bar charts, pie charts and scatter plots.

Geographical maps[edit]

The template {{Graph:Map}} allows to draw geographical maps with either discrete colors for qualitative maps, or a gradient of colors for continuous values per country. Here is an example:

Colors[edit]

The default colors are created by Module:ChartColors. The basic 20 are:

                                                                               

If a chart plots 10 colors or fewer, then by default it uses every other one:

                                       

The colors can be manually set in a graph by adding them to the 'colors' parameter. For example, for two pie charts, the first of which is default and the second of which omits some colors in the first, you would manually enter your selections from the default 20:

colors=#1f77b4,#aec7e8,#ff7f0e,#ffbb78,#2ca02c,#98df8a,#d62728,#ff9896,#9467bd,#c5b0d5,#8c564b,#c49c94,#e377c2,#f7b6d2,#7f7f7f,#c7c7c7,#bcbd22,#dbdb8d,#17becf,#9edae5

Similarly if one chart plotted fewer than 10 colors and you wanted it to use the same colors as another that had more than 10.

See also Template:ChartColors.

Methods outside Wikipedia[edit]

Scalable Vector Graphics (SVG) is the recommended format.

See also[edit]


Retrieved from "https://en.wikipedia.org/w/index.php?title=Wikipedia:Graphs_and_charts&oldid=1221715787"

Category: 
Wikipedia how-to
Hidden categories: 
Pages using the Graph extension
Pages with disabled graphs
Pages using bar box without float left or float right
Wikipedia help
 



This page was last edited on 1 May 2024, at 15:59 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki