Questions tagged [bar-chart]

A bar chart is graphical representation of data where the value is represented by the length of the bar.

Bar charts are used for marking clear data which has discrete values. Some examples of discontinuous data include 'shoe size' or 'eye color', for which a bar chart is appropriate. In contrast, some examples of continuous data would be 'height' or 'weight'. A bar chart is very useful for recording certain information whether it is continuous or not continuous data. Bar charts also look a lot like histograms. They are often mistaken for each other.

Example of a bar chart, with 'Country' as the discrete data set.

enter image description here

Source: eNotes (Bar chart)

In scientific software for statistical computing and graphics, a bar-chart can be generated by function barplot.

8160 questions
2
votes
1 answer

D3 V5 Bar chart

Okay I am trying to make a bar chart. This is the Javascript I have. var data = [ { "date": "1459468800000", // 1 April 2016 "values": [{ "name": "US", "value": 72580613, "domainname":…
Rooney
  • 1,674
  • 1
  • 14
  • 24
2
votes
3 answers

Bar plot with two y axes

I have the following code for a plot with 2 y-axes in MATLAB. I am glad that the 2-axes feature works, however, I would like to avoid the overlapping of the bars. Also, the categories on the right-hand axis should have different colors, not only…
LenaH
  • 313
  • 2
  • 14
2
votes
3 answers

How do i create a series that I can create a bar chart from

I have a list of names: ['joe','brian','stephen'] i would like to create a bar chart in jupyter with names as indexes and the bar showing the numbers of letters in each name. How do I create a series which I can call ".plot(kind='bar')" on and get…
Bennie
  • 509
  • 1
  • 4
  • 19
2
votes
1 answer

How to get string value centered above bars in bar chart

I am having trouble aligning the text above the correct bars in the following bar graph, I can't figure out where it's going wrong? CODE: bar(two_weeks,zAxis); text(1:length(two_weeks),zAxis,num2str(zAxis),'vert','bottom','horiz','center'); box…
SPYBUG96
  • 1,089
  • 5
  • 20
  • 38
2
votes
2 answers

GGplot 2 stacked bar seems to order randomly

I want to plot a result of some dummy data (see below). I want to use a (stacked bar plot and ggplot2) The plot should differentiate between the Profiles (facet_grid(Profile~.)) and show the results of the Answer values in a stacked bar chart, by…
2
votes
1 answer

Specify location of bar on bar chart R

I have example data below: > eg_data <- data.frame(period = c("1&2", "1&2","1", "1", "2","2"), size = c("big", "small", "big", "small","big", "small"), trip=c(1000, 250, 600, 100, 400, 150)) I want to make a stacked bar chart, where I have both…
Adam_S
  • 687
  • 2
  • 12
  • 24
2
votes
0 answers

Barplot labels too long, is it possible to set a "label width"

I am trying to create a stacked barplot where beside = TRUE. Here is the data used to generate this figure; significant <- c(27, 44, 25, 54, 40, 31, 25, 9, 57, 59) annotated <- c(119, 267, 109, 373, 250, 173, 124, 20, 452, 478) names <-…
Harnarday
  • 21
  • 7
2
votes
1 answer

plotting stacked bar graph on column values

I have a Pandas data frame that looks like this: ID Management Administrative 1 1 2 3 2 1 4 3 3 10 1 3 essentially the 1-3 is a grade of low medium or high. I want a stacked…
user8322222
  • 489
  • 3
  • 14
  • 28
2
votes
0 answers

Bar chart goes below zero line ios-charts

I have following question, today i updated the 'charts' pod in my project and suddenly the chart is drawn wrong. I mean the bars are going below zero, and not starting at the zero line. and before the update it looked like this: (i know the second…
Elliot Czigány
  • 188
  • 1
  • 14
2
votes
1 answer

Adding an x-axis to Barplot in R

For the following barplot in R: bp <- barplot(df$share.work, names.arg=df space = c(0, diff(df$dist.km.work)), col="blue", xlab="Kilometer", ylab="Trip Frequency", …
Hossein
  • 461
  • 3
  • 9
  • 17
2
votes
1 answer

C3 Chart bar with percentage

I am using a C3 Chart with react. And the chart is created without problem. But I need the data from the bars [1, 5, 1, 5, 2, 2, 1, 3] to be shown next to a %. Example 1%, 5%, 1%, 2%... This is my code const failureTopBar = { data:…
NelbeDG
  • 425
  • 1
  • 7
  • 19
2
votes
1 answer

Stacked bar chart in MATLAB

I'm trying to create a bar chart in MATLAB where bar positions are in one column, bar heights are in another, and the bars are stacked whenever two or more positions overlap. To illustrate, here is the same chart created in R with…
David M.
  • 186
  • 2
  • 8
2
votes
0 answers

pandas dataframe bar plot with multiple x-axis labels

Forgive me if I didn't identify an existing answer to this. I have this Pandas dataframe: In [1]: import pandas as pd ...: from numpy.random import rand ...: import matplotlib.pyplot as plt ...: ...: case = ['A', 'A', 'B', 'B', 'C',…
kde8
  • 321
  • 2
  • 10
2
votes
2 answers

R barplot - highest value on top is hidden

Simple barplot with values on top of bars (I know it is silly - I was forced to add them :)). text works good, but value above highest frequency bar is hidden. I tried margins but it moves the whole plot instead of only the graph area. What can you…
Alexey Ferapontov
  • 5,029
  • 4
  • 22
  • 39
2
votes
0 answers

Color issues in Google Charts Bar

I can not generate different colors in google charts bars. The data is coming from a variable data.addRows([[${golLog}]]); and I realized that inside this variable has an array. It looks like he throws only the first color for the two bars. Here is…
Evandro
  • 23
  • 6