Pie Chart with Legend loads small before window resize
See original GitHub issue- [x ] I have searched the issues of this repository and believe that this is not a duplicate.
Anyone with any guidance would be greatly appreciated
Reproduction link
DOESN’T WORK: Put the pie inside of a Col
https://github.com/emaxedon/ant-pie-chart-bug
WORKS: If you put the pie outside of a Col
https://github.com/emaxedon/ant-pie-chart-bug/tree/working
Steps to reproduce
- Add Pie chart that is in demo to a Card
- Load Pie Chart with legend
What is expected?
The pie chart to be full width
What is actually happening?
Pie chart is very small
Environment | Info |
---|---|
antd | 3.13.2 |
React | 16.14.1 |
System | OSX |
Browser | Chrome |
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top Results From Across the Web
Highchart legend overlapping when change window size
You can solve this issue by redrawing the chart whenever the browser window is resized. That way, the legend elements will be rendered...
Read more >Customize the Chart - Google Developers
All options have a documented default value. The following object defines the legend position, chart title, chart size, and a 3D option for...
Read more >Chart Legend in an External Container - amCharts
This tutorial will show you how you can easily move your chart legend outside main container into a totally separate one. NOTE. We're...
Read more >Graph | Dash for Python Documentation | Plotly
In short, it accepts as a value True , False , or 'auto' : True forces the graph to be responsive to window...
Read more >Element: <oj-chart> - Oracle
JET Chart with support for bar, line, area, combination, pie, scatter, ... Enter, Drill on data item, categorical axis label, or legend item ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chenshuai2144 Your delay technique works sometimes, and other times it does not. The main issue is that when a
Pie
component is placed inside aCol
, the chart does not render properly.Please take a look at the above code. You’ll notice on a widescreen it renders “ok”, with the delay. When rendering on a smaller screen it renders improperly sometimes (see attached image).
Your delay fix works sometimes; what else can we do to make sure the Pie chart works all the time (including when resizing the screen, when on mobile, etc.). Please demonstrate a working example using the code above (wrapped in the
Col
).Same problem.When container is small, pie chart render too small.When I set
styles.hasLegend
tofalse
, it’s OK, so I know why it happen. in css file there are these css code:&.hasLegend .chart {
width: ~'calc(100% - 240px)';
}
It will calc chart width, so i add a custom classname ‘my-pie’ to Pie component, and add css.my-pie > div{
width: 100% !important;
}