I am looking for a best solution to hvplot the multilayer data. Sorted by Name-Type-Size QTY is the value
I used Excel to make an example, but I'm not sure how to achieve the same goal with Python. I tried use
df.hvplot.bar(
x = 'Name',
y = 'Qty',
by = ['Type', 'Size'] # This is not what I think it can work,the issue is x axis includs a lot of empty Size.
)
Then I use scatter
a.hvplot.scatter(x='Size',
y='Qty',
by=['Name','Type'],
rot=90,
alpha=0.5,
width=2500,
height=400,
yformatter = '%0f'
)
It can show the data, but still not very convenient to see.
hvplot.bar(x='Name', y='Qty', by=['Type', 'Size'], rot=90,yformatter = '%0f')
I also tried this one. However, the Size are in question marks and not sure why.
[Size are in question marks][1] [1]: https://i.stack.imgur.com/5mW0I.png
[Data structure][2] [2]: https://i.stack.imgur.com/CQMEd.png
[example using excel][3] [3]: https://i.stack.imgur.com/hv9cU.png
Here is the markdown showing the example data:
| Name | Type | Size | Qty |
|---|---|---|---|
| A | Female | 16 | 146857 |
| A | Female | 15 | 116617 |
| A | Male | 14 | 29363 |
| A | Male | 13 | 25563 |
| A | Male | 12 | 12835 |
| B | Female | 170 | 32196 |
| B | Female | 155 | 34995 |
| B | Male | 150 | 34976 |
| B | Male | 145 | 14472 |
| B | Male | 125 | 21065 |
| ABC | Female | 140 | 46920 |
| ABC | Female | 135 | 20163 |
| ABC | Female | 126 | 7482 |
| ABC | Female | 125 | 20156 |
| ABC | Female | 124 | 7913 |
| ABC | Male | 123 | 4551 |
| ABC | Male | 120 | 84065 |
| ABC | Male | 117 | 2689 |
| ABC | Male | 115 | 31458 |
| ABC | Male | 70 | 238 |
| DDD | Female | 310 | 4764 |
| DDD | Female | 305 | 10331 |
| DDD | Male | 300 | 34198 |
| DDD | Male | 290 | 8392 |
| DDD | Male | 260 | 15220 |
| DDD | Male | 250 | 35272 |
| ADF | Female | 170 | 26161 |
| ADF | Female | 165 | 32156 |
| ADF | Female | 155 | 11172 |
| ADF | Female | 150 | 21497 |
| ADF | Male | 145 | 1026 |
| BMD | Female | 90 | 30093 |
| BMD | Female | 85 | 20964 |
| BMD | Female | 78 | 4028 |
| BMD | Male | 76 | 4426 |
| BMD | Male | 75 | 4410 |