plotly / plotly/plotly.R

in bar plot bars are in the wrong order

未关闭
#2,180 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
R
星标
2.7k
派生
641
PR 合并指标
30 天内没有已合并 PR

描述

Please briefly describe your problem and what output you expect. If you have a question, please don't use this form, but instead ask on the community forum http://community.plot.ly/c/api/r or stackoverflow http://stackoverflow.com.

Please include a minimal reprex. The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it. If you've never heard of a reprex before, start by reading https://github.com/tidyverse/reprex#readme, and follow the advice further down the page. Do NOT include session info unless it's explicitly asked for, or you've used reprex::reprex(..., si = TRUE) to hide it away.

Delete these instructions once you have read them.


Brief description of the problem
bar named 3 months must follow bar named "ban". currently, it is between 12 and 6 month bar


library(plotly)
fig <- plot_ly()
fig <- fig %>% add_bars(
  x = c("12 months", "6 months", "3 months","ban on short term plans" ),
  y = c(-200),
  base = c(0),
  marker = list(
    color = 'red'
  ),
)
fig <- fig %>% add_bars(
  x = c("12 months", "6 months", "3 months","ban on short term plans"),
  y = c(-76, -61, -44,-121),
  base = c(0),
  marker = list(
    color = 'grey'
  ),
  name = 'decrease in premiums'
)
fig

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

根据提供的 R 示例复现排序问题,从 plot_ly() 和 add_bars() 入口点开始。检查两个条形 trace 中分类 x 值的排序方式;当“3 months”条紧接在“ban on short term plans”之前,而不是位于“12 months”和“6 months”之间时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
r
领域
data-visualization
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。