Class charts.BaseChart
A base class of all visualization charts.
Defined in: BaseChart.js.
Constructor Attributes | Constructor Name and Description |
---|---|
charts.BaseChart(container)
A base class of all visualization charts.
|
Field Attributes | Field Name and Description |
---|---|
The reference to HTML chart container.
|
|
<static> |
charts.BaseChart.DEFAULT_COLORS
List of default colors.
|
Defaults chart options.
|
|
Instance of
charts.Tooltip . |
Method Attributes | Method Name and Description |
---|---|
draw(data, opt_options)
Draws the chart based on
data and opt_options . |
|
drawContent(content, opt_width, opt_height)
Draws content into
this.container as innerHTML . |
|
getDataColumns(data)
Extracts columns from
data . |
|
getDataRange(data, opt_column)
Gets data range with min and max values.
|
|
getDataRows(data)
Extracts rows from
data . |
|
getMaxValue(data)
Gets max value.
|
|
getMinValue(data)
Gets min value.
|
|
getOptions(opt_options)
Gets chart's options merged with defaults chart's options.
|
Class Detail
charts.BaseChart(container)
A base class of all visualization charts.
- Parameters:
- {string|Element} container
- The HTML container.
- Requires:
- charts.Tooltip
- util.Object
Field Detail
container
The reference to HTML chart container.
<static>
charts.BaseChart.DEFAULT_COLORS
List of default colors.
defaults
Defaults chart options.
{
'font': {'family': 'Arial', 'size': 13},
'opacity': 0.8,
'colors': [list of colors]
}
tooltip
Instance of
charts.Tooltip
.
- See:
- charts.Tooltip
Method Detail
draw(data, opt_options)
Draws the chart based on
data
and opt_options
.
Abstract method, should be overwritten in nested classes.
All overwritten methods should be exported for closure compiler.
- Parameters:
-
{!Array.
} data - A chart data.
- {Object=} opt_options
- A optional chart's configuration options.
drawContent(content, opt_width, opt_height)
Draws content into
this.container
as innerHTML
.
- Parameters:
- {string} content
- SVG or VML markup content.
- {number=} opt_width
- Optional chart width.
- {number=} opt_height
- Optional chart height.
{!Array.}
getDataColumns(data)
Extracts columns from
data
.
- Parameters:
-
{Array.
} data - The chart data.
- Returns:
- {!Array.
} Returns data columns.
{!Array.}
getDataRange(data, opt_column)
Gets data range with min and max values.
- Parameters:
-
{Array.
} data - The chart data.
- {number=} opt_column
- Optional columns index starting from.
- Returns:
- {!Array.
} Returns range as[min, max]
array.
{!Array.}
getDataRows(data)
Extracts rows from
data
.
- Parameters:
-
{Array.
} data - The chart data.
- Returns:
- {!Array.
} Returns cloneddata
rows.
{number}
getMaxValue(data)
Gets max value.
- Parameters:
-
{Array.
} data - The chart data.
- Returns:
- {number} Returns max value.
{number}
getMinValue(data)
Gets min value.
- Parameters:
-
{Array.
} data - The chart data.
- Returns:
- {number} Returns min value.
{!Object.}
getOptions(opt_options)
Gets chart's options merged with defaults chart's options.
- Parameters:
-
{Object.
=} opt_options - Options map.
- Returns:
- {!Object.
} A map of name/value pairs.