0

ZK Chart Dynamic Type & Model

asked 2015-04-21 07:58:11 +0800

MarkLauw gravatar image MarkLauw
1

Hi,

I'm creating a dashboard application which requires me to allow user to change the chart type to any other available chart type and reload the org.zkoss.chart.Charts <charts>.

Charts charts = (Charts) dashboardBuilderCanvas.getFellow(chartsId);

I can get the Charts, but when I want to change the type or the model from Column chart to Pie Chart:

charts.setType(Charts.PIE);

I get the following error: Unsupported model type [org.zkoss.chart.model.DefaultCategoryModel@5665ad96] on that line.

I tried to do this:

PieModel model = new
DefaultPieModel();
charts.setModel(model);
charts.setType(Charts.PIE);

But I get the same error:

java.lang.IllegalArgumentException: Unsupported model type [org.zkoss.chart.model.DefaultCategoryModel@5e92429a]
    at org.zkoss.chart.impl.PiePlotImpl.drawPlot(PiePlotImpl.java:33)
    at org.zkoss.chart.Charts.doSmartDraw(Charts.java:2197)
    at org.zkoss.chart.Charts.smartDrawChart(Charts.java:1702)
    at org.zkoss.chart.Charts.setType(Charts.java:662)

How can I resolve this? Thanks.

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2015-06-05 08:33:06 +0800

mausca29 gravatar image mausca29
0

I have the same problem. Are you solve it?

Thanks

link publish delete flag offensive edit
Your reply
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: 2015-04-21 07:58:11 +0800

Seen: 31 times

Last updated: Jun 05 '15

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