type_="bar"
Using <widget class_="chart" type_="bar">
produces a chart with
bars whose lengths represent the values in the data. (Available as of version
10.16)
Syntax
<dynamic> <widget class_="chart" type_="bar" orientation_="horizontal|vertical"> [1010data_QUERY] </widget> </dynamic>
The [1010data_QUERY] associated with the widget should result in either a single numeric column or else a column of any type followed by one or more numeric columns.
If the query results in a single numeric column, the row number is used as the category.
If the query results in a column of any type followed by one or more numeric columns, the first column specifies the categories, and the remaining ones specify separate series that are plotted as different-colored bars.
Attributes for type_="bar"
orientation_
- Determines the direction in which the bars are displayed.
horizontal
- The bars in the chart are displayed horizontally.
vertical
- The bars in the chart are displayed vertically.
The default is
horizontal
.
Example: type_="bar"
The following example uses the table pub.doc.retail.salesdetail to create a chart that displays a series of bars representing the total sales in January 2014 for each of the stores.
<dynamic> <widget class_="chart" type_="bar" base_="pub.doc.retail.salesdetail" title_="January 2014 Sales"> <sel value="yrmo(trans_date)=201401"/> <tabu label="Tabulation on Sales Detail" breaks="store"> <break col="store" sort="up"/> <tcol fun="sum" source="xsales" label="Sum of`Extended`Sales" name="sumsales"/> </tabu> <colord cols="store,sumsales"/> </widget> </dynamic>