Skip to content

Initialization Options

hanzo2001 edited this page May 16, 2016 · 5 revisions

Required

The mandatory items in the options for the initialization process are as follows

  • url: set the url string to the target script on the server to which the ajax call will be directed.
  • chartType: set the type of chart you want to present.

With this minimal configuration you can paint a chart as long as the data coming in is correctly formatted and the chartType is capable of handling the data.

$('#id').CreateChart({
    url : 'http://yourhost.yourdomain...',
    chartType : 'any chart type'
});

The supported types are PieChart, DonutChart, BarChart, ColumnChart, LineChart, AreaChart and ComboChart. Other types may work but many features will have undefined behavior. In addition, the underlying data structure of the other charts is not as simple as the ones documented here. For example, the Histogram is a chart type that allows two distinct data structures, one has data distributed in rows and the other is an asymmetric two-dimensional distribution with null values.

Optional

A quick rundown of available options follows.

Option Name Description
params a plain javascript object that will be passed as the data in a jQuery Ajax call.
chartOptions you may set any option available to a chart as described in the google API. Avoid using the explorer option.
preprocesses an array of objects with a specific signature (which must reference a known preprocessor method) that will be called in order and passed the raw data as context from the server.
postprocesses an array of objects with a specific signature (which must reference a known postprocessor method) that will be called in order and passed the DataView as context.
rangeStack this may be a boolean option or an object which when set to true will switch the initialization process to the special Wrap. The user can zoom into a continuous chart. There are more details and requirements [[here
features an array of names of predefined features that you wish to add to a chart once it is drawn. For example, responsiveness can be added to a chart so long as it does not have a fixed width.
dataStruct a completely optional setting that clarifies the intent of sticking to one type of data distribution. It only understands two values: 'inRows'and 'inCols'.
whenDrawn a function that will be executed when the initialization has ended, the chart triggers its first ready event and all features have been added. This function will be called every time the chart must be reconstructed so be careful not to allow this to be executed more than once. For a more thorough explanation go [[here

Extension Options

Option Name Comment
removedRowLabelFactory available if feature removeRowOnSelect is active ([[Features