![]() |
BizForm::CallService(chartService,render)
---> chartService::render($bizform, $inputDataStr)
---> read chart xml file "bizform_chart.xml"
---> get the chart data from bizform->bizobj
---> draw chart by calling jpgraph APIs
X-Y chart has X axis and Y axis. The GraphType attribute is "XY" <Chart Name="AAA" GraphType="XY" ...>.
Pie chart does not have X axis and Y axis. The GraphType attribute is "Pie" <Chart Name="AAA" GraphType="Pie" ...>.
Many elements and attributes are easy to understand, but others need some explanation as shown in the table below.
| Attribute(s) | Description | Sample |
| <Chart Margin=""/> | Define the margin (left, right,top,bottom) of a chart | Margin="60,30,30,80" |
| <Xaxis LabelField=""/> | Define which BizObj field to provide labels of x-axis | LabelField="Donation" |
| <Xaxis LabelAngle=""/> | Define the angle of labels of x-axis | LabelAngle="30" |
| <... Font=""> | Define
the font, font style and font size. Now support Arial, Courier, Times, Verdana, Comic, Geogia |
Font="Arial,Bold,16" |
| <...
Color=""/> <... FillColor=""/> |
Define the color and fill color with Named color or HEX color code | Color="blue" FillColor="#A16BFF" |
| <Legend Position=""/> | Define the position of legend box. Format as aX,aY,aHAlign,aVAlign. aX is the fraction of graph width, aY is the fraction of graph height, aHAlign ('left','right','center') is the horizontal legend alignment, aVAlign ('bottom','top','center') is the vertical legend alignment | Position="0.05,0.1,right,top" |
| <Legend Layout=""/> | Define the layout of the legend items. HOR or VERT | Layout="VERT" |
| <Data ChartType=""/> | Define the chart type. Line, Bar, GroupBar, AccBar, Pie, Pie3D | ChartType="Line" |
| <Data Field=""/> | Define the field name of the BizObj. The chart data is from this field | Field="Donation" |
| <Data LegendField=""/> | Define which BizObj field to provide legend strings | LegendField="Name" |
| <Data Visible=""/> | Define whether this chart is displayed or not. Value is 0 or 1 | Visible="1" |
| <Data Children=""/> | Define the child chart ids. Format is Children="id1,id2". GroupBar and AccBar can have this attribute | Children="bar1,bar2" |
| <DataPie Size=""/> | If the
value specified is between 0 and 1 then it is interpreted as a a fraction
of either height or width, whatever is smallest, of the graph. If the value is >1 then it is interpreted as an absolute size in pixels. |
Size="0.3" Size="200" |
| <Data Weight=""/> | Specify the thickness of the chart in pixels | Center="0.4,0.5" |
| <DataPie Center=""/> | Set the center point for the Pie chart | Center="0.4,0.5" |
| <DataPie Height=""/> | Specify thickness of 3D pie plot | Height="15" |
| <DataPie Angle=""/> | Specify projection angle for 3D in degrees | Angle="30" |
| <DataPie LabelPos=""/> | Specify the position of the labels for each slice as a fraction of the radius | LabelPos="0.6" |
| <PointMark Type=""/> | Define the Line Point Marks types. Now support Square, Utriangle, Dtriangle, Diamond, Circle, FilledCircle, Cross, Star, X | Type="Circle" |
| <!ELEMENT BizFormChart
(ChartList) > <!ATTLIST BizFormChart Name CDATA #REQUIRED > <!ATTLIST BizFormChart BizForm CDATA #REQUIRED > <!ELEMENT ChartList (Chart+) > <!ELEMENT Chart (Title, Xaxis?, Yaxis?, DataSet, Legend) > <!ATTLIST Chart Name CDATA #REQUIRED > <!ATTLIST Chart GraphType CDATA #REQUIRED > <!ATTLIST Chart Width CDATA #REQUIRED > <!ATTLIST Chart Height CDATA #REQUIRED > <!ATTLIST Chart Margin CDATA #IMPLIED > <!ELEMENT Title EMPTY > <!ATTLIST Title Caption CDATA #REQUIRED > <!ATTLIST Title Font CDATA #IMPLIED > <!ATTLIST Title Color CDATA #IMPLIED > <!ELEMENT Xaxis EMPTY > <!ELEMENT Value EMPTY > |