0

How to get viewData from a chart

asked 2020-12-15 19:13:30 +0800

softteam gravatar image softteam
120 8

Hi,

We have a chart like this:

image description

And we want to show the data from this chart in a window. We can show now this Data below the chart using:

Charts chart;
...
Exporting export = chart.getExporting();
ExportingButton buttons = new ExportingButton();
List<MenuItem> menuItems = new ArrayList<>();

menuItems.add(customMenuItem("Ver datos", "this.viewData()"));
buttons.setMenuItems(menuItems);    
export.setButtons(buttons);

private MenuItem customMenuItem(String text, String onclickJS) {
        MenuItem menuItem = new MenuItem();
        menuItem.setText(text);
        menuItem.setOnclick(new JavaScriptValue("function(evt) {" + onclickJS + "}"));
        return menuItem;
}

And we can see:

image description

But, which is the easiest way to get this data to show it then in a window using Java?

We use ZK 9.1.0 and chart 7.2.1.1 versions.

Thank you, Javier

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-17 17:57:54 +0800

hawk gravatar image hawk
2740 1 5
http://hawkphoenix.blogsp... ZK Team

I have mentioned to your colleague. Currently, you render those data in javascript.

But you can add a menu item to fire an event to the server and implement the data rendering logic in Java. So that you can create a ZK Window dynamically in Java.

Or just add <window visible="false"> in the zul and make it visible when rendering data.

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

RSS

Stats

Asked: 2020-12-15 19:13:30 +0800

Seen: 6 times

Last updated: Dec 17 '20

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