0

3D Options for ZK Charts

asked 2015-09-07 10:23:23 +0800

ifmis gravatar image ifmis
1 2

Hey to all,

I have to design a simple template to be used on many charts for my projects. I designed a control page:

<div id="config" style="float:right; font-size: smaller;">

            <checkbox label="3D" onCheck="@command('enable3D')" 
                value="@load(vm.enable3D)" checked="@bind(vm.enable3D)" />

            <space />

            <combobox id="type" value="@load(vm.type)" readonly="true"
                width="80px" visible="true" tooltiptext="Change type"
                onChange="@command('configChanged',type=self.selectedItem.value)">
                <comboitem label="Bar" value="bar" />
                <comboitem label="Column" value="column" />
                <comboitem label="Column Range" value="columnrange" />
                <comboitem label="Pie" value="pie" />
                <comboitem label="Line" value="line" />
                <comboitem label="Spline" value="spline" />
            </combobox>

            <space />

            <combobox id="selectedtheme" model="@load(vm.themes)"
                width="100px" value="@load(c:toLowerCase(vm.theme))" readonly="true"
                tooltiptext="Change theme"
                onChange="@command('configChanged',theme=self.selectedItem.value)">
                <template name="model">
                    <comboitem label="@load(c:toLowerCase(each))" />
                </template>
            </combobox>
        </div>
        <div style="clear: both;"></div>

    </div>

then in a every page/window containing a chart:

<window vflex="1" hflex="1"
    apply="org.zkoss.bind.BindComposer, rw.gov.gif.charts.TaxTypeNumbersChartController"
    viewModel="@id('vm') @init('rw.gov.gif.charts.TaxTypeNumbersChartController')">

    <div sclass="1-chart" align="center" hflex="1">
        <include src="/ctrl.zul" visible="true" />
        <charts id="chart" type="@bind(vm.type)"
            title="Tax declaration Number" theme="@bind(vm.theme)" width="400" height="250" />
    </div>

</window>

For theme and type configuration change, it works perfectly. Now the challenge is on 3D options checkbox as that command changes only the values but doesn't reflect on the chart as for the theme and type.

May someone has to suggest me a better way to achieve this.

Thanks in advance.

Emma

delete flag offensive retag edit
Be the first one to answer this question!
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-09-07 10:23:23 +0800

Seen: 32 times

Last updated: Sep 07 '15

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