MAChartView properties for the chart name and title, queries, categories, series, values, and what-if columns.
Chart setting properties are divided into several sections. You can show and hide each section individually, or all together by clicking Expand All or Collapse All.
Properties vary for each chart view type (specified in the General page).
For views that display multiple charts, the Chart Setting page displays properties for each chart in a separate tab:
Property | Description |
---|---|
Name | A label identifying the drilldown chart. |
To display and set the remaining properties, define a zooming hierarchy of charts. To add a chart and create a new tab, each chart, click Add and choose a type (either Simple Chart or Zooming Chart). Tabs are named in the order that you add them (Level 1, Level 2, and so on). Each tab contains properties for the chart.
if (chartName === 'One') { hwc.navigateForward('TestScreen1'); } else if (chartName === 'Two') { hwc.navigateForward('TestScreen2'); }
Property | Description |
---|---|
Name | A text identifier for the chart. In the generated
HTML, the id of the chart div includes the name. For example, the id
of this div is based on the name
chart1:<div id="chart1Contents"> <div id="chart1" class="chart"></div> </div> |
Chart Type | Specifies one of the available chart types:
|
Chart Title | The label that identifies the chart on the screen. |
MAKit Query | The name of a query
(for example, RevenueByYear) that is defined
in Custom.js, using the MAKit Query API, to
retrieve data from data source. For information about MAKit APIs, see Mobile Analytics Kit (MAKit) Developer Guides: HTML5. In this example, if customBeforeExecuteMAQuery returns true, then customAfterExecuteMAQuery is called with the query name you specify. That name is used to determine what data source table to load for the MAKit data: { var dataTable; if (name == "DeptSalary") dataTable = getDeptSalary(); else if (name == "SalesOrder") dataTable = getSalesOrderSummary(); chartObj.setDataTable(dataTable); } function getDeptSalary(){ var dataTable = new $MA.FileDataTable(); dataTable.addColumn("Department", "string"); dataTable.addColumn("Sex", "string"); dataTable.addColumn("Salary", "number"); dataTable.setData("csv","datafiles/basic/DeptSalary.csv"); return dataTable; } Note: For
zooming charts, MAKit Query is specified in the Category
definition dialog.
|
In an XY chart, a category typically represents the X axis. The Category section is different for simple and zooming chart view types:
Property | Description |
---|---|
Column | The column in the chart that the category is mapped to. |
Format | Specifies the data
format. For example, Format=”WeekDay” converts a
date to a weekday name in the chart. Available formats are:
|
Display Name | The label on the column in the chart. The display name does not have to be unique. |
Property | Description |
---|---|
Format | The data format of all the categories in the chart. |
Level | A number identifying the category's location in the zoom sequence. The level is assigned when you create the category in the Category dialog. |
Title | A label identifying the category in the chart. |
MAKit Query | The name of a query (for example, RevenueByYear) that is defined in Custom.js, using the MAKit Query API, to retrieve data from data source. |
Column | The column in the chart where the category is mapped. |
For bubble charts, user fewer than 100 categories, to avoid filling the chart with bubbles.
In addition to categories, you can use one or more series to filter a chart. For example, in a table that shows the number of employees year by year, the year can be a category, gender can be the series, and the number of employees can be the value.
A series specifies the chart's z-axis, but because charts are not three-dimensional, MAKit maps series to columns that are added after the category columns. In a single-series chart (such as a pie chart), the series is mapped to a single column; in a multiple-series chart, you must define the define the column mapping for each series.
Property | Description |
---|---|
Column | The unique name of the column to use for the series. |
Format | Specifies the data
format. For example, Format=”WeekDay” converts a
date to a weekday name in the chart. Available formats are:
|
Display Name | The label on the column in the chart. The display name does not have to be unique. |
The value defines the data that is represented in the chart. For bubble charts only, a second tab, Bubble Size, specifies the diameter of the bubble.
Property | Description |
---|---|
Expression | A combination of functions, variables, and column
names that is evaluated and resolved in the chart. For values, you
can specify an expression that lets you select the data to be used
in the chart, and how it should appear. You can manually enter an expression, or click Edit and use the Expression dialog to define the expression. The expression can be as simple as a column name from the data source, or more complex, for example, combining a column and variable. Examples: Col1+Col2*Col3+2.2 (where Col1, Col2, and Col3 are column names) 'mystring' + Col1 (concatenates mystring to the contents of Col1) Sqrt(Col2) (Square root of Col2 value on each row) |
Format | Specifies the data
format. For example, Format=”WeekDay” converts a
date to a weekday name in the chart. Available formats are:
|
Display Name | The label on the column in the chart. The display name does not have to be unique. |
The Expression dialog lets you define or modify an expression in the Values section. To open the Expression dialog, click Edit in the Values section of the Chart Setting page.
Property | Description |
---|---|
Global Variables | A list of variables that have been defined in the Variables page of the Properties view. Clicking an item in the list inserts a reference to the variable in the Expression Definition area. |
Expression Definition | The expression to be included in the Value property. You can type any part of your expression, and you can click items in the Global Variables and Available Functions lists to insert them in your expression. |
Available Functions | A list of available function templates. To use a function, click an item in the list to insert the template code in the Expression Definition area, and edit the code to complete the function. For example, in the String(column) template, substitute the actual name of a column. |
What-if analysis enables chart users to examine "what-if" scenarios by changing input data in the what-if column. The values are recomputed and the chart is refreshed based on the new value. To use a what-if column after defining it, reference it by name in a value expression.
Semantic zooming charts do not support what-if analysis.
You can add, delete, modify, and reorder what-if columns using the buttons on the page. Clicking Add or Edit opens the What-If definition dialog, where these properties are required for all variables:
Property | Description |
---|---|
Name | A unique name for the column. The name must be used in a value expression. |
Display Name | The label on the column in the chart. The display name does not have to be unique. |
Type | The datatype: either Float or Integer. |
Value | A computed expression (not a column name) that defines the data to be shown in the chart. |
Min, Max | The smallest and largest valid values that application users can specify. For example, 0 and 100 for an integer variable; 0.0 and 100.0 for a float. The range between Min and Max must include the specified value property. |