Class charts.BarChart
Extends
charts.BaseChart.
Simple horizontal bar chart implementation.
Defined in: BarChart.js.
Constructor Attributes | Constructor Name and Description |
---|---|
charts.BarChart(container)
BarChart constructor.
|
- Fields borrowed from class charts.BaseChart:
- container, defaults, 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 . |
- Methods borrowed from class charts.BaseChart:
- getDataColumns, getDataRange, getDataRows, getMaxValue, getMinValue, getOptions
Class Detail
charts.BarChart(container)
BarChart constructor.
var chart = new charts.BarChart('container_id'); chart.draw([['Year', 'Sales', 'Expenses', 'Profit'], [2011, 80, 30, 45], [2012, 65, 130, 90], [2013, 45, 100, 60]]);
- Parameters:
- {string|Element} container
- The HTML container.
- Requires:
- animation
- charts.Grid
- formatters.NumberFormatter
Method Detail
draw(data, opt_options)
Draws the chart based on
data
and opt_options
.
options: { 'stroke': 1, 'font': {'size': 11}, 'flip': false }
- 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
- The HTML markup content.
- {number=} opt_width
- Optional chart width.
- {number=} opt_height
- Optional chart height.