From 4d9cc604b9b0038aee736065b3b2b7a346b0a53d Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Mon, 17 Sep 2018 16:37:18 -0700 Subject: [PATCH] add view area options to pick up chart background fix (#2613) --- .../query/editor/charting/insights/graphInsight.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/sql/parts/query/editor/charting/insights/graphInsight.ts b/src/sql/parts/query/editor/charting/insights/graphInsight.ts index b20a1d5e21..cc1a61735f 100644 --- a/src/sql/parts/query/editor/charting/insights/graphInsight.ts +++ b/src/sql/parts/query/editor/charting/insights/graphInsight.ts @@ -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 = { 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 + (retval).viewArea = { + backgroundColor: background + }; + return retval; }