Skip to content

'scatter' objects don't have these attributes: 'stackgroup' #1359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cristofertadrissi opened this issue Oct 4, 2018 · 5 comments
Closed

Comments

@cristofertadrissi
Copy link

cristofertadrissi commented Oct 4, 2018

Hi all,

just contacting you because I am having some problems regarding with the generation of one plot and looking for some help, I am trying to plot one stacked area chart with cumulative values using plot_ly but I am getting this error al the time:

'scatter' objects don't have these attributes: 'stackgroup', 'groupnorm'
Valid attributes include:
'type', 'visible', 'showlegend', 'legendgroup', 'opacity', 'name', 'uid', 'ids', 'customdata', 'selectedpoints', 'hoverinfo', 'hoverlabel', 'stream', 'transforms', 'x', 'x0', 'dx', 'y', 'y0', 'dy', 'text', 'hovertext', 'mode', 'hoveron', 'line', 'connectgaps', 'cliponaxis', 'fill', 'fillcolor', 'marker', 'selected', 'unselected', 'textposition', 'textfont', 'r', 't', 'error_x', 'error_y', 'xcalendar', 'ycalendar', 'xaxis', 'yaxis', 'idssrc', 'customdatasrc', 'hoverinfosrc', 'xsrc', 'ysrc', 'textsrc', 'hovertextsrc', 'textpositionsrc', 'rsrc', 'tsrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule', '_bbox'

I have been following the instructions to build this graph showed in this link: https://plot.ly/r/filled-area-plots/
Also I if run the code of the section stacked area chart with cumulative values in a Rstudio session I get the same problem.

Code that works on the website

library(plotly)

data <- t(USPersonalExpenditure)
data <- data.frame("year"=rownames(data), data)

p <- plot_ly(data, x = ~year, y = ~Food.and.Tobacco, name = 'Food and Tobacco', type = 'scatter', mode = 'none', stackgroup = 'one', groupnorm = 'percent', fillcolor = '#F5FF8D') %>%
  add_trace(y = ~Household.Operation, name = 'Household Operation', fillcolor = '#50CB86') %>%
  add_trace(y = ~Medical.and.Health, name = 'Medical and Health', fillcolor = '#4C74C9') %>%
  add_trace(y = ~Personal.Care, name = 'Personal Care', fillcolor = '#700961') %>%
  add_trace(y = ~Private.Education, name = 'Private Education', fillcolor = '#312F44') %>%
  layout(title = 'United States Personal Expenditures by Categories',
         xaxis = list(title = "",
                      showgrid = FALSE),
         yaxis = list(title = "Proportion from the Total Expenditures",
                      showgrid = FALSE,
                      ticksuffix = '%'))

Also it appears on the reference of scatter objects that "stackgroup" key is available
https://plot.ly/r/reference/

So, maybe there is something that I am missing.....

Kind Regards

@cpsievert
Copy link
Collaborator

These are newly released plotly.js attributes -- #1338 will fix it.

@cristofertadrissi
Copy link
Author

Hello, if I just execute the following code, should be working?

plotlyMainBundle <- function() {
htmltools::htmlDependency(
"plotly-main",
version = "1.40.1",
version = "1.41.0",
src = depPath("plotlyjs"),
script = "plotly-latest.min.js",
all_files = FALSE
)
}

Thanks.

@ethanyxu
Copy link

@cristofertadrissi I had the exactly the same issue. Installing the dev version of plotly worked for me:

devtools::install_github("ropensci/plotly")

@dean-n
Copy link

dean-n commented Oct 23, 2018

I see #1338 has been merged, but I still get the following when I try to run the example in the first post:

Warning messages: 1: 'scatter' objects don't have these attributes: 'stackgroup' Valid attributes include: 'type', 'visible', 'showlegend', 'legendgroup', 'opacity', 'name', 'uid', 'ids', 'customdata', 'selectedpoints', 'hoverinfo', 'hoverlabel', 'stream', 'transforms', 'x', 'x0', 'dx', 'y', 'y0', 'dy', 'text', 'hovertext', 'mode', 'hoveron', 'line', 'connectgaps', 'cliponaxis', 'fill', 'fillcolor', 'marker', 'selected', 'unselected', 'textposition', 'textfont', 'r', 't', 'error_x', 'error_y', 'xcalendar', 'ycalendar', 'xaxis', 'yaxis', 'idssrc', 'customdatasrc', 'hoverinfosrc', 'xsrc', 'ysrc', 'textsrc', 'hovertextsrc', 'textpositionsrc', 'rsrc', 'tsrc', 'key', 'set', 'frame', 'transforms', '_isNestedKey', '_isSimpleKey', '_isGraticule', '_bbox'

@juliendiot42
Copy link

@cpsievert do you have any idea of when the package will be updated on the CRAN ?
Thank-you ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants