plotly / plotly/plotly.py

offsetgroup with horizontally stacked/relative bar traces

オープン
#5,007 コメント 8 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug P2
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
21

説明

It appears the feature to allow offsetgroup to work with stacked/relative bar traces (https://github.com/plotly/plotly.js/pull/7009) does not work with horizontally oriented bar traces. Taking the example from the documentation

https://plotly.com/python/bar-charts/#grouped-stacked-bar-chart

if I reverse the x and y axis and set orientation to 'h', the traces are not separated by the different offset groups:

import plotly.graph_objects as go

data = [
    go.Bar(
        y=['Q1', 'Q2', 'Q3', 'Q4'],
        x=[150, 200, 250, 300],
        name='New York',
        offsetgroup="USA",
        orientation='h'
    ),
    go.Bar(
        y=['Q1', 'Q2', 'Q3', 'Q4'],
        x=[180, 220, 270, 320],
        name='Boston',
        offsetgroup="USA",
        orientation='h'
    ),
    go.Bar(
        y=['Q1', 'Q2', 'Q3', 'Q4'],
        x=[130, 170, 210, 260],
        name='Montreal',
        offsetgroup="Canada",
        orientation='h'
    ),
    go.Bar(
        y=['Q1', 'Q2', 'Q3', 'Q4'],
        x=[160, 210, 260, 310],
        name='Toronto',
        offsetgroup="Canada",
        orientation='h'
    )
]

layout = go.Layout(
    title={
        'text': 'Quarterly Sales by City, Grouped by Country'
    },
    yaxis={
        'title': {
            'text': 'Quarter'
        }
    },
    xaxis={
        'title': {
            'text': 'Sales'
        }
    },
    barmode='stack'
)

fig = go.Figure(data=data, layout=layout)

fig.show()

Image

Using plotly 6.0.0.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

この issue の Python の再現から始め、リンクされた Plotly ドキュメントの例および Plotly.js pull request #7009 と比較してください。水平の積み上げ棒トレースが offsetgroup をどのように処理するかを追跡し、提供された例で異なる水平 offsetgroup グループが正しくレンダリングされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
data-visualization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。