0

ZK Charts Resize

asked 2014-05-20 10:25:20 +0800

IngoB gravatar image IngoB flag of Germany
256 6

Hi,

i create dynamically ZK Charts in a panel and i want to fit the chart to the panel size if it gets max/minimized.

I found Chart Resize, but since i do it dynamically i got stuck.

Div div = new Div();
div.setHflex("1");
div.setVflex("1");

div.addEventListener(Events.ON_AFTER_SIZE, new EventListener<Event>() {
    @Override
    public void onEvent(Event event) throws Exception {
        chart.setWidth(event.getWidth() + "px");
    }
});

div.appendChild(chart);

it says "The method getWidth() is undefined for the type Event"

Any help would be greatly appreciated :)

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-05-20 11:09:09 +0800

vincentjian gravatar image vincentjian
2245 6

updated 2014-05-20 11:11:02 +0800

Hi, you should use AfterSizeEvent

div.addEventListener(Events.ON_AFTER_SIZE, new EventListener<AfterSizeEvent>() {
    public void onEvent(AfterSizeEvent event) throws Exception {
        //do something
    }
}
link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-05-20 10:25:20 +0800

Seen: 24 times

Last updated: May 20 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More