Chart Setting Properties

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).

Tabbed Views

For views that display multiple charts, the Chart Setting page displays properties for each chart in a separate tab:

DrillDown Chart – for drilldown charts, only one property is initially visible in the Chart Setting page:
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.

Split View – at the top of the Chart Setting page is tab for each row and column that you specify for the grid. Each tab contains properties for a simple chart. For example, if you define a split view with two columns and two rows, the page has four tabs where you define the properties for each chart.
Note: To enable the Expander control in a split view chart, edit Custom.js as follows:
  • Make sure that hwc.customBeforeMaximizeMASplitChart returns true.
  • In hwc.customAfterMaximizeMASplitChart, define the action of the expander control when clicked. In this example, the value of chartName is the name of a chart defined in the General section:
    if (chartName === 'One') { 
      hwc.navigateForward('TestScreen1'); 
    } 
    else if (chartName === 'Two') {
      hwc.navigateForward('TestScreen2'); 
    }

General Section

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:
  • Bar
  • Line
  • Pie
  • Horizontal Bar
  • Bubble
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.

Category Section

In an XY chart, a category typically represents the X axis. The Category section is different for simple and zooming chart view types:

Simple charts – have only one category, represented in a single column in the chart, and the Category section contains its properties.
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:
  • Month
  • ShortMonth
  • WeekDay
  • ShortWeekDay
  • ShortDate
  • LongDate
  • Currency
  • Percent
  • Rounded{0} through Rounded{0}
Display Name The label on the column in the chart. The display name does not have to be unique.
Zooming charts – have multiple categories, each one mapped to a different column in the chart. All the categories in a chart have the same format, which you specify at the top of the view. Under the format, the Category section lists existing categories, and buttons for managing and ordering them.
To add a category, click Add and define its properties in the Category definition dialog.
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.
Note: For bar charts and horizontal bar charts, use fewer than 1000 categories, to optimize scrolling.

For bubble charts, user fewer than 100 categories, to avoid filling the chart with bubbles.

Series Section

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:
  • Month
  • ShortMonth
  • WeekDay
  • ShortWeekDay
  • ShortDate
  • LongDate
  • Currency
  • Percent
  • Rounded{0} through Rounded{0}
Display Name The label on the column in the chart. The display name does not have to be unique.

Values Section

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:
  • Month
  • ShortMonth
  • WeekDay
  • ShortWeekDay
  • ShortDate
  • LongDate
  • Currency
  • Percent
  • Rounded{0} through Rounded{0}
Display Name The label on the column in the chart. The display name does not have to be unique.

Expression Dialog

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 Columns Section

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.