Make the default newOptions apply to all but the chart vis

This commit is contained in:
Arik Fraimovich 2014-02-11 11:42:37 +02:00
parent aabc912862
commit 9b7227a88b

View File

@ -79,24 +79,22 @@
'type': Visualization.prototype.TYPES.CHART,
'name': '',
'description': q.description || '',
'options': newOptions()
'options': newOptions(Visualization.prototype.TYPES.CHART)
};
}
}, true);
}
function newOptions(chartType) {
if (chartType === Visualization.prototype.TYPES.COHORT) {
// empty config at the moment
return {};
if (chartType === Visualization.prototype.TYPES.CHART) {
return {
'series': {
'type': 'column'
}
};
}
// Chart
return {
'series': {
'type': scope.seriesTypes[0]
}
};
return {};
}
scope.$watch('vis.type', function(type) {