Invient Charts - Resizing chart inside Horizontal sliding pane

Hello everyone-

I have a multi-axis chart set into a HorizontalSplitPanel. When I resize the panel, the chart doesn’t redraw, but if I resize the browser window it does. Is there a way to force this on the resize of the panel?

I’ve tried requestRepaint() and requestRepaintAll() on my chart panel… wondering if I’m missing something obvious.

Thanks for the great add-on!

Dave

Hi,

I assume this is using Invient Chart add-on?

FWIW, I have encountered the same issue with Invient (resizing splitpane does change size, but changing browser window does), but not reported it (silly me).

I think it’s a bug.

Cheers,

Charles.

Currently, the chart listens only to window resize event and hence it resizes only when the browser window is resized. However, if you can listen to panel resize event then set width of the chart in panel resize event listener. e.g.


                chart.getConfig().getGeneralChartConfig().setWidth(800);
                chart.getConfig().getGeneralChartConfig().setHeight(400);
                chart.refresh();                


OR

If you want to display scrollbar due to resize of a panel then height of the panel must be set. E.g.


                horzPanel.addComponent(chart);
                horzPanel.setHeight("400px");

Thanks

Did it work for you?

Hi,

As far as I can see, there is no (server-side) Resize event on SplitPanel, so it’s not possible to manually perform a refresh.

Cheers,

Charles.

You are right. I think SplitPanel should raise such an event just like window resize event.

Hi,

Yes, it would be good if that were so - but I’m not sure a component user should be explicitly setting the size on a parent resize; I just want to say “take 100% of the available space” and be done with ! We don’t do that for any other component, I’m not sure why a graph would be any different.

Hope you see what I mean,

Cheers,

Charles

I needed this too, so I fixed this in my own version of invient charts:

https://github.com/ingokegel/invientcharts