-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I'm interested in using a chart like this one.
I just need one level of drilldown and be able to come back to the original series. I would like to use the MVVM approach though and for now i can only set some series but without any drilldowns. I used the PieModel
to set the values but i can't find a way to create drilldowns.
<charts type="pie" model="@load(myVM.model)" />
PieModel pieModel = new DefaultPieModel();
pieModel.setValue(categoryDescription, myValue);
My only idea is to pass the charts
component from the zul page to the MVVM on the onPlotClick
event for example and use that to set the drilldowns, but this is extremely ugly.. I would have to re-calculate the series and implement the back button i guess.
Isn't there a way to actually set these drilldowns in a MVVM approach? I would like to avoid mixing MVC and MVVM approaches.
Thank you
The ChartsModels don't contain drilldown information and there is also no dedicated MVVM way here.
In this case you have to access the Charts component directly (or through its ChartsApi interface).
I try to keep the configuration code separate, to have only a single "ugly" method delegating the chart configuration which can become complex in many cases. It's often more than just setting up the data - something you don't want in a view model anyway like colors, formats, paddings, axis configuration, drilldown...
@Command
public void configureChart(@BindingParam("chart") Charts chart) {
ChartUtil.configureIncomeHistoryChart(chart, anyInfoFromVM);
}
In the zul file you can bind the configureChart
-command to any event e.g. onCreate
.
<charts onCreate="@command('configureChart', chart=self)"/>
Asked: 2021-07-16 15:57:27 +0800
Seen: 11 times
Last updated: Jul 19 '21
bug with intboxes on mobile devices
zk keikai-how to add custom button/label to formulabar?
zk-keikai- update multiple cells parallel at same time asynchronously
zk-keikai-How to auto fit column width based on text
zk-keikai-ClipboardPateEvent-called twice
Reference a spring bean from VariableResolver