add view area options to pick up chart background fix (#2613)

This commit is contained in:
Anthony Dresser
2018-09-17 16:37:18 -07:00
committed by GitHub
parent 1dc76fa171
commit 4d9cc604b9

View File

@@ -149,6 +149,8 @@ export class Graph implements IInsight {
let foreground = foregroundColor ? foregroundColor.toString() : null;
let gridLinesColor = this._theme.getColor(editorLineNumbers);
let gridLines = gridLinesColor ? gridLinesColor.toString() : null;
let backgroundColor = this._theme.getColor(colors.editorBackground);
let background = backgroundColor ? backgroundColor.toString() : null;
if (options) {
retval.scales = {};
@@ -187,12 +189,20 @@ export class Graph implements IInsight {
}];
}
retval.legend = {
retval.legend = <ChartJs.ChartLegendOptions>{
position: options.legendPosition as ChartJs.PositionType,
display: options.legendPosition !== LegendPosition.None
display: options.legendPosition !== LegendPosition.None,
labels: {
fontColor: foreground
}
};
}
// these are custom options that will throw compile errors
(<any>retval).viewArea = {
backgroundColor: background
};
return retval;
}