Annotation Interface Chart
Applies to collections.
Example:
@Chart CollectionIt could display a chart with several bars, one for each employee, for example.employees;
In this case OpenXava tries to determine automatically whose properties identifies each entity, to use them as labels, and also try to choose numeric values from entities susceptible to be shown in the chart.
However, you can determine explicitly what properties use, like in this example:
@Chart(labelProperties = "firstName, lastName", dataProperties = "salary, bonus") CollectionIn this case the concatenation of firstName and lastName is used as label, and the salary and bonus properties as data.employees;
Since v7.5 you can also specify the type of chart to use:
@Chart(type = ChartType.LINE, labelProperties = "month", dataProperties = "sales") CollectionAvailable chart types are BAR (default), LINE and PIE.sales;
- Since:
- 7.4
- Author:
- Javier Paniza
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe property (or properties) to use to get the data of each entity to display in the chart.List of comma separated view names where this annotation applies.The property (or properties) to use as label to identify each entity shown in the chart.List of comma separated view names where this annotation does not apply.The type of chart to display.
-
Element Details
-
forViews
String forViewsList of comma separated view names where this annotation applies.Exclusive with notForViews.
If both forViews and notForViews are omitted then this annotation apply to all views.
You can use the string "DEFAULT" for referencing to the default view (the view with no name).- Default:
- ""
-
notForViews
String notForViewsList of comma separated view names where this annotation does not apply.Exclusive with forViews.
If both forViews and notForViews are omitted then this annotation apply to all views.
You can use the string "DEFAULT" for referencing to the default view (the view with no name).- Default:
- ""
-
dataProperties
String dataPropertiesThe property (or properties) to use to get the data of each entity to display in the chart.If not specified, all numeric properties except those with year, number, code or id in the name, are chosen.
It's possible to indicate several properties separated by commas.- Default:
- ""
-
labelProperties
String labelPropertiesThe property (or properties) to use as label to identify each entity shown in the chart.If not specified, if year/number(or id or code) combination exists is preferred. Otherwise, the property named title, name or description is use, with year, number, code or id as prefix if exists
As fallback the first property is used.
It's possible to indicate several properties separated by commas.- Default:
- ""
-
type
ChartType typeThe type of chart to display.If not specified, BAR is used.
- Since:
- 7.5
- Default:
- BAR
-