stacked-chart

Cluster stacked bargraph

倾然丶 夕夏残阳落幕 提交于 2019-12-11 19:38:50
问题 I want to plot something like this in R. I found some similar solution here so I tried something similar: test <- data.frame(person=c("group 1", "group 2", "group 3"), value1=c(100,150,120), # male value2=c(25,30,45) , # female value3=c(25,30,45), # male value4=c(100,120,150), # female value5=c(10,12,15), # male value6=c(50,40,70)) # female library(reshape2) # for melt melted <- melt(test, "person") melted$cat <- '' melted[melted$variable == 'value1' | melted$variable == 'value2',]$cat <-

Why do Chart Stacked Columns show up as thin lines?

眉间皱痕 提交于 2019-12-11 10:53:51
问题 I am trying to create a stacked column chart with 4 series in it. But somehow, after populating the series and making sure they are aligned, instead of columns, thin lines appears. Code is as below. foreach (Series s in chartEvents.Series) s.Points.Clear(); foreach (DataRow dr in data.Rows) { string reason = ""; double xVal = 0; double yVal = 0; double overFlow = 0; double existFlow = 0; try { reason = dr["reasonID"].ToString(); xVal = Math.Round(Convert.ToDateTime(dr["XValue"].ToString())

highchart stacked column total data per categories

淺唱寂寞╮ 提交于 2019-12-11 08:45:16
问题 I want to get the total data per categories. The point.stackTotal only gives the total of the active data. From the code example I pasted, I would like to know the total consumption per fruit. So even if I clicked Joe's name on the legend on upper right part (that makes all Joe's information on stacked chart inactive), I'd still know the total consumption of Apple (and any other fruits) of John, Jane, and Joe on mouseover each bar categories so apparently, what I am looking for is not the

stacked chart with ZingChart

旧街凉风 提交于 2019-12-10 18:53:37
问题 I'm making stacked bar chart with ZingChart library. Here is a sample http://jsfiddle.net/api/post/library/pure/ but suppose i need a limit , e.g the color should only change if it exceeds 15k. Is that possible? var myConfig = { "type": "bar", "stacked": true, "stack-type": "normal", "background-color": "#FFFFFF", "title": { "text": "Mobile OS Sales - ", "font-family": "arial", "x": "40px", "y": "5px", "align": "left", "bold": false, "font-size": "16px", "font-color": "#000000", "background

count plot with stacked bars per hue [duplicate]

妖精的绣舞 提交于 2019-12-10 11:05:09
问题 This question already has answers here : How to have clusters of stacked bars with python (Pandas) (7 answers) Closed 10 months ago . I am looking for an efficient way of drawing a count plot with stacked bars according to "hue". Standard hue behavior is to split a count into parallel bars according to the value of a second column, what I am looking for is an efficient way to have the hue bars stacked in order to quickly compare totals. Let me explain with an example from the titanic dataset:

Click event on stacked bar chart - ChartJs

十年热恋 提交于 2019-12-06 00:49:54
问题 I am trying to implement click event on Stacked Bar chart. The data looks like below: var chartData = { type: 'horizontalBar', data: { labels: ['A0224', 'A3681', 'A3984', 'A4101', 'A4150', 'B0682', 'Others'], datasets: [ { label: "P1", backgroundColor: '#cc3399', data: [6, 7, 6, 8, 6, 10, 3] }, { label: "P2", backgroundColor: '#0099ff', data: [8, 9, 5, 8, 6, 10, 3] }, { label: "P3", backgroundColor: '#0022ff', data: [6, 7, 6, 8, 6, 10, 3] } ] }, options: { legend: { display: false }, scales:

Click event on stacked bar chart - ChartJs

倾然丶 夕夏残阳落幕 提交于 2019-12-04 04:46:55
I am trying to implement click event on Stacked Bar chart. The data looks like below: var chartData = { type: 'horizontalBar', data: { labels: ['A0224', 'A3681', 'A3984', 'A4101', 'A4150', 'B0682', 'Others'], datasets: [ { label: "P1", backgroundColor: '#cc3399', data: [6, 7, 6, 8, 6, 10, 3] }, { label: "P2", backgroundColor: '#0099ff', data: [8, 9, 5, 8, 6, 10, 3] }, { label: "P3", backgroundColor: '#0022ff', data: [6, 7, 6, 8, 6, 10, 3] } ] }, options: { legend: { display: false }, scales: { yAxes: [{ stacked: true }], xAxes: [{ stacked: true }] }, } } The method for click event and chart

Position geom_text in the middle of each bar segment in a geom_col stacked barchart [duplicate]

半腔热情 提交于 2019-12-03 09:34:28
问题 This question already has answers here : Showing data values on stacked bar chart in ggplot2 (2 answers) Closed 3 years ago . I would like to position the corresponding value labels in a geom_col stacked barchart in the middle of each bar segment . However, my naive attempt fails. library(ggplot2) # Version: ggplot2 2.2 dta <- data.frame(group = c("A","A","A", "B","B","B"), sector = c("x","y","z", "x","y","z"), value = c(10,20,70, 30,20,50)) ggplot(data = dta) + geom_col(aes(x = group, y =

Position geom_text in the middle of each bar segment in a geom_col stacked barchart [duplicate]

好久不见. 提交于 2019-12-02 23:56:38
This question already has an answer here: Showing data values on stacked bar chart in ggplot2 2 answers I would like to position the corresponding value labels in a geom_col stacked barchart in the middle of each bar segment . However, my naive attempt fails. library(ggplot2) # Version: ggplot2 2.2 dta <- data.frame(group = c("A","A","A", "B","B","B"), sector = c("x","y","z", "x","y","z"), value = c(10,20,70, 30,20,50)) ggplot(data = dta) + geom_col(aes(x = group, y = value, fill = sector)) + geom_text(position="stack", aes(x = group, y = value, label = value)) Obviously, setting y=value/2 for

Stacked Bar Graph reproduction in R

感情迁移 提交于 2019-12-02 20:17:20
问题 I am trying to reproduce this graph in R without success: But for more years This is the data: title 2016 phased 2017 phased 2018 phased 2019 fully loaded Pillar 1 minimum requirement (p1min) 4,50% 4,50% 4,50% 4,50% Pillar 2 requirement (P2R) 4,63% 1,75% 1,75% 1,75% Conservation Buffer 0,63% 1,25% 1,88% 2,50% O-SII buffer 0,50% 1,00% 1,50% 1,50% Countercyclical Buffer 0,00% 0,15% 0,25% 0,35% Ideally, the colours would take the 'title' column as labels (pillar1, 2 etc.) Here is my code so far