Add an option to disable chart legend.

A user can disable it if he has tons of series.
Now that we explicitly enable it, it's also visible for a single series.
This commit is contained in:
Alon Horev
2015-12-07 19:07:04 +02:00
parent 0f82d4e17b
commit 135ffd693a
3 changed files with 16 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
var defaultOptions = {
globalSeriesType: 'column',
sortX: true,
legend: {enabled: true},
yAxis: [{type: 'linear'}, {type: 'linear', opposite: true}],
xAxis: {type: 'datetime', labels: {enabled: true}},
series: {stacking: null},
@@ -180,6 +181,10 @@
}
});
if (!_.has(scope.options, 'legend')) {
scope.options.legend = {enabled: true};
}
if (scope.columnNames)
_.each(scope.options.columnMapping, function(value, key) {
if (scope.columnNames.length > 0 && !_.contains(scope.columnNames, key))