Comments (6)
I see the div id 'c10' created correctly under row element id c7 but it is not displayed in browser. When the div id c10 is not under c7, chart is displayed in the browser.
EDIT: This is due to default height & width of echart when displaying under a container element. I provided min-width & min-height to row element, now I can see the chart.
r1=ui.row().style('min-height:250px;min-width:450px')
with r1:
ec=ui.echart({'xAxis':{},'yAxis': {},'series': [{'type': 'line', 'data': []},{'type': 'line', 'data': [1,2,3]}]}).style('height:250px;width:650px')
from nicegui.
Hi @mswastik, thanks for bringing this up!
We also had problems with ECharts in flexboxes like ui.row
. It might be related to apache/echarts#11791, but I'm not sure. So far I couldn't come up with a simple workaround.
If anyone has an idea how to work around or fix this problem, we're all ears!
from nicegui.
I was able to view echart by manually specifying row min-height & min-width as mentioned above.
from nicegui.
@mswastik Yes, that might work in certain cases. But as soon as you add a second chart, they resize strangely when resizing the browser window.
from nicegui.
ok, maybe you can try experimenting with tailwind classes as a workaround.
from nicegui.
I think I finally understand the original problem:
ui.echart
comes with "width: 100%" by default. That means it gets the width from its parent container.ui.row
is a flexbox with an undefined width.- Because the nested
ui.echart
has a minimum width of 0, theui.row
shrinks to this size.
To avoid this problem, you can either set a width or minimum width on the ui.echart
or on the ui.row
:
with ui.row().classes('w-full'):
ui.echart({'xAxis': {}, 'yAxis': {}, 'series': [{'type': 'line', 'data': [1, 2, 3]}]})
from nicegui.
Related Issues (20)
- May I ask if it's possible to apply for a CVE for this project if a security vulnerability is found? HOT 7
- Quasar CSS flexbox layout classes don't work HOT 7
- Intrinsic high CPU usage HOT 7
- [AG Grid] Setting column to sortable doesn't work in a callback function HOT 4
- emoji favicons depend on python string length in a weird way HOT 1
- Docs: "Input element with date picker" - menu is closed when clicking "<" or ">" HOT 1
- ui.date doesn't not close the menu after picking the day HOT 6
- Select & Radio not working with On Air HOT 2
- del Client.instances[self.id] Key error HOT 3
- 'Tailwind' object has no attribute 'value' HOT 1
- Plotly chart changes position after updating the chart. HOT 10
- ⚠️ `ui.upload` File upload stops at 99.9% HOT 4
- 3D visualization not reliable HOT 15
- From 188c81b on some pages load extremely slowly HOT 9
- I use pyinstaller to generate .exe file find question, how to solve it?
- Setting ui.number min/max property is failing after version nicegui-1.4.19 HOT 1
- When executing the run_method , a KeyError error occurs. HOT 6
- Native mode [Windows] : Stay on top option
- Firefox cannot establish the websocket connection but other browsers and firefox private browsing can. HOT 8
- app.storage.user in unit tests throws error. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nicegui.