Vaadin Charts: Resizing getting triggered by opening 'Element Inspector'

Hey Guys,

I’m faced with a real strange behavior regarding the size (mostly regarding the width) of the vaadin chart component. The component is used in an AbsoluteLayout which has a width of 1000px:

// diagrammLayout diagrammLayout = new AbsoluteLayout(); diagrammLayout.setImmediate(false); diagrammLayout.setWidth(1000, Unit.PIXELS); this.addComponent(this.diagrammLayout, "diagrammLayout"); My Chart component also gots a width of 1000px and a defined Height of 562px. The Chart is filled with all values and categories as intended. So all given values are right. Here’s the snippet:

this.chart.setSizeUndefined(); this.chart.setWidth(1000, Unit.PIXELS); this.chart.setHeight(562, Unit.PIXELS); this.diagrammLayout.addComponent(this.chart); If I view the chart in my Browser (e.g., Firefox, Chromium), it appears with a width of 2547px. See here:



If I open the Element Inspector (or close it, or do something else, which is triggering something special in vaadin I don’t know), the width of my components is set to the width-value I intended. Here is the result after just closing and opening the Element Inspector on exactly the same page (as above):



I’ve tried to mark the Component as dirty or dirtyRecursive. I tried to repaint it. I tried to refresh it. Nothing helped. I just don’t know, where the event of repainting the component with the correct and intended values is triggered. Of course, I can’t please the user to open the element inspector, to get faced with an UI that appears as I imlemented it.

Hope to find a solution with your help, guys.

All the best
Seb
16064.jpg
16065.jpg

Oh, it seems, that linking the pictures isn’t working. Editing the post neither (can’t click ‘Confirm Edit’).
So here are additional Information:

First Picture:
Check fehler.jpg,
which is attached to the first post


Check korrekt.jpg
, which is attached to the first post as well.

Changing to VerticalLayout() helps…
m(