Merge pull request #272 from demiurg/master

[view/graph][s]: Ability to extend graph options with general options - thx to @demiurg.
This commit is contained in:
Rufus Pollock
2012-11-10 00:44:05 -08:00
2 changed files with 26 additions and 3 deletions

View File

@@ -69,3 +69,18 @@ test('GraphControls basics', function () {
view.remove();
});
test('Overriding graph options', function () {
var dataset = Fixture.getDataset();
var randomWidth = Math.random();
var view = new recline.View.Graph({
model: dataset,
state: {
'graphType': 'bars',
'group': 'date',
'series': ['y', 'z'],
'graphOptions': { bars: {barWidth: randomWidth}}
}
});
equal(view.getGraphOptions('bars').bars.barWidth, randomWidth)
view.remove();
});