stacked-area-chart

multiarea chart in lattice

筅森魡賤 提交于 2019-12-11 06:14:44
问题 I am pushing lattice to its limits. Consider this example tibble(time = c(ymd('2019-01-01'), ymd('2019-01-02'), ymd('2019-01-03'), ymd('2019-01-01'), ymd('2019-01-02'), ymd('2019-01-03'), ymd('2019-01-01'), ymd('2019-01-02'), ymd('2019-01-03')), variable = c('a','a','a','b','b','b', 'c','c','c'), value = c(1,2,3,0,0,2,2,4,3)) %>% ggplot(aes(x = time, y = value, fill = variable)) + geom_area() Using the nice solution in how to create a stacked area chart in lattice? does not work here, perhaps

R colors - many distinctive colors that are still pretty

浪尽此生 提交于 2019-12-10 23:24:33
问题 I am curious if you have some tips on colour-brewing in R, for many distinctive colours, in a way that the graph is still good-looking. I need a fair amount of distinctive colours (24 at least, probably will need even more, ~50) for stacked area plots (so not heatmaps, gradual colours would not work). I came across viridis, that has really pretty palettes, which also work for colourblind people. Unfortunatelly those do not have enough colours to still be distinguishable on my plots. I looked

Capture XAxis value NVD3 Stacked Area Chart

可紊 提交于 2019-12-08 10:38:15
问题 I'm having trouble with capturing some data on the StackedAreaChart in NVD3. I'm able to successfully intercept the click event using this answer: NVD3 Stacked Area Chart However, I need to go one step deeper. Now that I've intercepted the event, I'm getting back an object that looks like this: { point: {key:"A Place", values:[], seriesIndex: 1}, pos: [479, 283], series: "A Place", seriesIndex: 1 } The object's pos array looks the most promising- the first element in the array is obviously

Correct for missing values in a Stacked area plot using ggplot2

僤鯓⒐⒋嵵緔 提交于 2019-12-08 04:39:02
问题 I've been trying to recreate this post on a combination of stacked bar/area plot. I have some problems with missing values though. Here's my data: https://www.dropbox.com/sh/pnkspwnn1qslm6u/JapTKCwqMS What I run is; wa=read.table('wa_class.txt', sep="", header=F, na.string="0") names(wa)=c("Class","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") wam=melt(wa) wam$variablen=as.numeric(wam$variable) How it looks like > head(wam) Class variable value variablen 1

d3.js csv to nvd3 (stacked area chart) format

大城市里の小女人 提交于 2019-12-04 19:34:00
I'm trying to convert my csv to the format needed by nvd3's stacked area chart: http://nvd3.org/ghpages/stackedArea.html but got lost in the arrays conversion. Can someone help? csv: length,m1,m2,m3,m4 9,1,2,3,4 99,11,22,33,44 999,111,222,333,444 format needed by nvd3 var histcatexplong = [ { "key" : "Consumer Discretionary" , "values" : [ [ 0000000000000 , 27.38478809681] , [ 0000000000000 , 27.371377218208] , [ 0000000000000 , 26.823411519395] } , { "key" : "Consumer Staples" , "values" : [ [ 0000000000000 , 27.45458809681] , [ 0000000000000 , 27.444444444408] , [ 0000000000000 , 26

Stacked Area Chart in Plot.ly and R

百般思念 提交于 2019-12-01 23:33:00
问题 Plot.ly has a tutorial on this for Python: # Add original data x=['Winter', 'Spring', 'Summer', 'Fall'] y0_org=[40, 80, 30, 10] y1_org=[20, 10, 10, 10] y2_org=[40, 10, 60, 80] # Add data to create cumulative stacked values y0_stck=y0_org y1_stck=[y0+y1 for y0, y1 in zip(y0_org, y1_org)] y2_stck=[y0+y1+y2 for y0, y1, y2 in zip(y0_org, y1_org, y2_org)] R doesn't seem to have any similar tutorial. I tried to play with the filled area plot tutorial for R, but failed to build a stacked plot.

Stacked Area Chart in Plot.ly and R

孤街醉人 提交于 2019-12-01 22:24:37
Plot.ly has a tutorial on this for Python: # Add original data x=['Winter', 'Spring', 'Summer', 'Fall'] y0_org=[40, 80, 30, 10] y1_org=[20, 10, 10, 10] y2_org=[40, 10, 60, 80] # Add data to create cumulative stacked values y0_stck=y0_org y1_stck=[y0+y1 for y0, y1 in zip(y0_org, y1_org)] y2_stck=[y0+y1+y2 for y0, y1, y2 in zip(y0_org, y1_org, y2_org)] R doesn't seem to have any similar tutorial. I tried to play with the filled area plot tutorial for R, but failed to build a stacked plot. library(plotly) p <- plot_ly(x = c(1, 2, 3, 4), y = c(0, 2, 3, 5), fill = "tozeroy") add_trace(p, x = c(1, 2

nvd3 stacked area chart looks glitchy how to fix?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 00:59:33
My stacked area chart looks like this: The data I used has the same number of values and is just like in the example. THe data I used is at : http://pastebin.com/D07hja76 The code I use is also almost similar appart from the selector: var colors = d3.scale.category20(); keyColor = function(d, i) {return colors(d.key)}; nv.addGraph(function() { chart = nv.models.stackedAreaChart() .useInteractiveGuideline(true) .x(function(d) { return d.t }) .y(function(d) { return d.v }) .color(keyColor) .transitionDuration(300) chart.xAxis .tickFormat(function(d) { return d3.time.format('%x')(new Date(d)) });

Highcharts: having trouble recreating stacked area chart from Excel with positive and negative values

假如想象 提交于 2019-12-01 00:37:57
I'm converting a series of Excel charts into Highcharts, and came across a curious situation involving a stacked area chart with both positive and negative values. Here is now the chart is displayed in Excel, along with the accompanying data points. For illustration purposes, I've selected series G. Despite having all positive values in its data, it appears at the bottom of the stack, beneath the zero line. Here is how the chart appears in Highcharts (see below). In this instance, series G appears above the chart, and all of the other series appear much differently than in Excel. For reference

nvd3 stacked area chart looks glitchy how to fix?

[亡魂溺海] 提交于 2019-11-30 19:09:15
问题 My stacked area chart looks like this: The data I used has the same number of values and is just like in the example. THe data I used is at : http://pastebin.com/D07hja76 The code I use is also almost similar appart from the selector: var colors = d3.scale.category20(); keyColor = function(d, i) {return colors(d.key)}; nv.addGraph(function() { chart = nv.models.stackedAreaChart() .useInteractiveGuideline(true) .x(function(d) { return d.t }) .y(function(d) { return d.v }) .color(keyColor)