As suggested by Bruno in this thread, refactoring in charts
http://ofbiz.135035.n4.nabble.com/Charting-in-OFBiz-td2219378.html#a2219378 git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@945523 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -252,7 +252,31 @@ under the License.
|
||||
</widgets>
|
||||
</section>
|
||||
</screen>
|
||||
|
||||
|
||||
<screen name="CommonExampleChartsDecorator">
|
||||
<section>
|
||||
<actions>
|
||||
<set field="headerItem" value="ExampleCharts"/>
|
||||
<entity-condition entity-name="ExampleCountByType" list="chartData">
|
||||
<order-by field-name="exampleTypeId"/>
|
||||
</entity-condition>
|
||||
<set field="labelFieldName" value="exampleTypeId"/>
|
||||
<set field="dataFieldName" value="total"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
|
||||
<decorator-section name="pre-body">
|
||||
<include-menu name="ExampleCharts" location="component://example/widget/example/ExampleMenus.xml"/>
|
||||
</decorator-section>
|
||||
<decorator-section name="body">
|
||||
<container style="clear" />
|
||||
<include-screen name="FlotrChart" location="component://common/widget/flotrScreens.xml"/>
|
||||
</decorator-section>
|
||||
</decorator-screen>
|
||||
</widgets>
|
||||
</section>
|
||||
</screen>
|
||||
|
||||
<screen name="main">
|
||||
<!-- This is the screen for the Main page in the Example component. A common pattern
|
||||
in OFBiz is to have each component include a Main page as a starting point for
|
||||
|
||||
@@ -270,8 +270,4 @@ under the License.
|
||||
</field>
|
||||
<field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
|
||||
</form>
|
||||
<form name="ChartDataList" type="list" list-name="chartData">
|
||||
<field name="exampleTypeId"><display/></field>
|
||||
<field name="total"><display/></field>
|
||||
</form>
|
||||
</forms>
|
||||
|
||||
@@ -34,8 +34,7 @@ under the License.
|
||||
</menu-item>
|
||||
<menu-item name="ExampleGeoLocation" title="${uiLabelMap.CommonGeoLocation}"><link target="ExampleGeoLocationPointSet1"/></menu-item>
|
||||
<menu-item name="Birt" title="${uiLabelMap.Birt}"><link target="BirtMain"/></menu-item>
|
||||
<menu-item name="Barchart" title="Flotr : Bar Chart"><link target="BarChart"/></menu-item>
|
||||
<menu-item name="Piechart" title="Flotr : Pie Chart"><link target="PieChart"/></menu-item>
|
||||
<menu-item name="ExampleCharts" title="Chart examples"><link target="ExampleBarChart"/></menu-item>
|
||||
</menu>
|
||||
|
||||
<menu name="EditExample" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
|
||||
@@ -83,4 +82,8 @@ under the License.
|
||||
<menu-item name="Mail" title="${uiLabelMap.ExampleBirtMail}"><link target="Mail"/></menu-item>
|
||||
</menu>
|
||||
|
||||
<menu name="ExampleCharts" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
|
||||
<menu-item name="ExampleBarChart" title="Bar chart"><link target="ExampleBarChart"/></menu-item>
|
||||
<menu-item name="ExamplePieChart" title="Pie chart"><link target="ExamplePieChart"/></menu-item>
|
||||
</menu>
|
||||
</menus>
|
||||
|
||||
@@ -312,62 +312,27 @@ under the License.
|
||||
</section>
|
||||
</screen>
|
||||
|
||||
<screen name="ChartDataList">
|
||||
<section>
|
||||
<widgets>
|
||||
<include-form name="ChartDataList" location="component://example/widget/example/ExampleForms.xml" />
|
||||
</widgets>
|
||||
</section>
|
||||
</screen>
|
||||
<screen name="PieChart">
|
||||
<screen name="ExamplePieChart">
|
||||
<section>
|
||||
<actions>
|
||||
<set field="headerItem" value="Piecharts"/>
|
||||
<entity-condition entity-name="ExampleCountByType" list="chartData">
|
||||
<order-by field-name="exampleTypeId"/>
|
||||
</entity-condition>
|
||||
<set field="tabButtonItem" value="ExamplePieChart"/>
|
||||
<set field="chartType" value="Pie"/>
|
||||
<set field="labelFieldName" value="exampleTypeId"/>
|
||||
<set field="dataFieldName" value="total"/>
|
||||
<set field="chartId" value="pieChartDiv"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
|
||||
<decorator-section name="body">
|
||||
<screenlet title="Chart Data">
|
||||
<include-screen name="ChartDataList"/>
|
||||
</screenlet>
|
||||
<screenlet title="Flotr Pie Chart representing above data">
|
||||
<include-screen name="FlotrChart" location="component://common/widget/flotrScreens.xml"/>
|
||||
</screenlet>
|
||||
</decorator-section>
|
||||
</decorator-screen>
|
||||
<include-screen name="CommonExampleChartsDecorator" location="${parameters.mainDecoratorLocation}"/>
|
||||
</widgets>
|
||||
</section>
|
||||
</screen>
|
||||
<screen name="BarChart">
|
||||
<screen name="ExampleBarChart">
|
||||
<section>
|
||||
<actions>
|
||||
<set field="headerItem" value="Barcharts"/>
|
||||
<entity-condition entity-name="ExampleCountByType" list="chartData">
|
||||
<order-by field-name="exampleTypeId"/>
|
||||
</entity-condition>
|
||||
<set field="tabButtonItem" value="ExampleBarChart"/>
|
||||
<set field="chartType" value="Bars"/>
|
||||
<set field="labelFieldName" value="exampleTypeId"/>
|
||||
<set field="dataFieldName" value="total"/>
|
||||
<set field="chartId" value="barChartDiv"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
|
||||
<decorator-section name="body">
|
||||
<screenlet title="Chart Data">
|
||||
<include-screen name="ChartDataList"/>
|
||||
</screenlet>
|
||||
<screenlet title="Flotr Bar Chart representing above data">
|
||||
<include-screen name="FlotrChart" location="component://common/widget/flotrScreens.xml"/>
|
||||
</screenlet>
|
||||
</decorator-section>
|
||||
</decorator-screen>
|
||||
<include-screen name="CommonExampleChartsDecorator" location="${parameters.mainDecoratorLocation}"/>
|
||||
</widgets>
|
||||
</section>
|
||||
</screen>
|
||||
|
||||
Reference in New Issue
Block a user