Class pvc.BaseChart
The BaseChart class is the abstract base class of CCC charts.
Constructor Attributes | Constructor Name and Description |
---|---|
Creates a chart, given its specification.
|
Field Attributes | Field Name and Description |
---|---|
Axes | |
The map of pvc.visual.Axis indexed by axis id.
|
|
Data | |
Gets the main data set of the chart.
|
|
DOM | |
The child charts of a multi-chart root chart.
|
|
The parent chart.
|
|
The root chart.
|
|
Panels | |
Gets the chart's base panel.
|
Method Attributes | Method Name and Description |
---|---|
Data | |
setData(dataSetSpec, optionsSpec)
Sets the main data set of the chart,
given a data set specification in CDA format.
|
|
Render | |
Gets the error of the last render operation, if one occurred, or null if not.
|
|
render(bypassAnimation, recreate, reloadData)
Renders the chart.
|
|
Re-renders the parts of a chart that represent the state of user interaction.
|
|
renderResize(width, height)
Resizes a chart given new dimensions.
|
|
Scenes | |
Gets the chart's active scene.
|
- Parameters:
- {!pvc.options.charts.BasicChart} optionsSpec
- The chart options specification.
This property is null while the chart is not created.
- See:
- #setData
This is null on a leaf chart or on a non-multi-chart root chart.
This is null for root charts.
The root chart has itself as the value of the root property.
Calling this method by itself does not update the chart. You must explicitly call #render for the chart to reflect the new data.
Example data set specification in CDA format:
var relational_01a = {
"metadata": [
{"colName": "city", "colType": "String"},
{"colName": "date", "colType": "String"},
{"colName": "quantity", "colType": "Numeric"}
}],
"resultset": [
["London", "2011-06-05", 72],
["London", "2011-06-12", 50],
["London", "2011-06-19", 20],
["London", "2011-06-26", 23],
["London", "2011-07-03", 72],
["London", "2011-07-10", 80],
["London", "2011-07-26", 23],
["London", "2011-07-31", 72],
["London", "2011-08-07", 50],
["London", "2011-08-14", 20],
["London", "2011-08-28", 20],
["Paris", "2011-06-05", 27],
["Paris", "2011-06-26", 32],
["Paris", "2011-07-03", 24],
["Paris", "2011-07-10", 80],
["Paris", "2011-07-17", 90],
["Paris", "2011-07-24", 53],
["Paris", "2011-07-31", 17],
["Paris", "2011-08-07", 20],
["Paris", "2011-08-21", 43],
["Lisbon", "2011-06-12", 30],
["Lisbon", "2011-07-03", 60],
["Lisbon", "2011-07-10", 80],
["Lisbon", "2011-07-17", 15]
]
};
- Arguments:
- {object} dataSetSpec
- The data set specification.
- {!pvc.options.charts.BasicChart} optionsSpec
- The data options specification. You can use this argument to conveniently specify data source related options such as options.charts.BasicChart#crosstabMode.
- Returns:
- {!pvc.BaseChart} The chart instance.
- See:
- #data
- Returns:
- {Error} The last render error or null.
- See:
- #render
- Arguments:
- {boolean} bypassAnimation Optional, Default: false
- Indicates that entering animations should not be performed.
- {boolean} recreate Optional, Default: false
- When the chart has already been created, forces it to be re-created. When the chart is recreated, all options are re-read and the chart is re-laid out. Data may or may not be reloaded, depending on the reloadData argument. When not recreated, rendering simply performs a full Protovis render of the existing Protovis structure, possibly performing the entering animation.
- {boolean} reloadData Optional, Default: true
- When the chart is being created or recreated, indicates that data should be reloaded. It is assumed that the new data has the same metadata as that of the first chart creation.
- Returns:
- {!pvc.BaseChart} The chart instance.
This method performs a Protovis render of only the marks that are known to represent the state of user interaction, and is thus more efficient than a full Protovis render, as would be performed by calling #render like in chart.render(true).
- Returns:
- {!pvc.BaseChart} The chart instance.
- See:
- #render
When both dimensions are nully, this method does nothing.
If the chart's previous layout, if any, had already reached its minimum size (in both directions), and the both the specified dimensions are smaller than or equal to the previous layout's requested size, then this method does nothing.
This method does not perform entering animations or reload data.
- Arguments:
- {number} width Optional
- - The new width of the chart. Ignored when nully.
- {number} height Optional
- - The new height of the chart. Ignored when nully.
- Returns:
- {!pvc.BaseChart} The chart instance.
- See:
- #render
- Returns:
- {pvc.visual.Scene} The active scene or `null`, when none is active.