var data = [{ x: 1, y: 1 }, { x: 2, y: 3 }, { x: 3, y: 2 },
{ x: 4, y: 4 }, { x: 5, y: 3 }, { x: 6, y: 5 }];
var xScale = new Plottable.Scales.Linear();
var yScale = new Plottable.Scales.Linear();
var plot = new Plottable.Plots.Bar()
.addDataset(new Plottable.Dataset(data))
.x(function(d) { return d.x; }, xScale)
.y(function(d) { return d.y; }, yScale)
.animated(true)
.renderTo("svg#example");
window.addEventListener("resize", function() {
plot.redraw();
});
.baselineValue()
/.baselineValue(value)
Gets or sets the baseline value. This is the value at which bars are drawn from.
.entitiesAt(point)
Gets the Entities at a particular point.
.entitiesIn(bounds)
/.entitiesIn(xRange, yRange)
Gets the Entities that intersect the area defined by the bounds or by the xRange and yRange collectively.
.entityNearest(point)
Returns the PlotEntity nearest to the query point according to the following algorithm:
.labelsEnabled()
/.labelsEnabled(flag)
Gets or sets whether bar labels are enabled or not.
.labelFormatter()
/.labelFormatter(formatter)
Gets or sets the Formatter
for the labels.
.orientation()
Gets the orientation of the plot. Can be either "horizontal" or "vertical".