mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
@@ -19,6 +19,8 @@ import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/theme
|
|||||||
import * as nls from 'vs/nls';
|
import * as nls from 'vs/nls';
|
||||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||||
|
|
||||||
|
declare var Chart: any;
|
||||||
|
|
||||||
export enum ChartType {
|
export enum ChartType {
|
||||||
Bar = 'bar',
|
Bar = 'bar',
|
||||||
Doughnut = 'doughnut',
|
Doughnut = 'doughnut',
|
||||||
@@ -161,11 +163,17 @@ export abstract class ChartInsight extends Disposable implements IInsightsView {
|
|||||||
protected updateTheme(e: IColorTheme): void {
|
protected updateTheme(e: IColorTheme): void {
|
||||||
let foregroundColor = e.getColor(colors.editorForeground);
|
let foregroundColor = e.getColor(colors.editorForeground);
|
||||||
let foreground = foregroundColor ? foregroundColor.toString() : null;
|
let foreground = foregroundColor ? foregroundColor.toString() : null;
|
||||||
|
let backgroundColor = e.getColor(colors.editorBackground);
|
||||||
|
let background = backgroundColor ? backgroundColor.toString() : null;
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
legend: {
|
legend: {
|
||||||
labels: {
|
labels: {
|
||||||
fontColor: foreground
|
fontColor: foreground
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
viewArea: {
|
||||||
|
backgroundColor: background
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.options = mixin({}, mixin(this.options, options));
|
this.options = mixin({}, mixin(this.options, options));
|
||||||
@@ -348,3 +356,13 @@ function isValidData(data: IInsightData): boolean {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Chart.pluginService.register({
|
||||||
|
beforeDraw: function (chart) {
|
||||||
|
if (chart.config.options.viewArea && chart.config.options.viewArea.backgroundColor) {
|
||||||
|
var ctx = chart.chart.ctx;
|
||||||
|
ctx.fillStyle = chart.config.options.viewArea.backgroundColor;
|
||||||
|
ctx.fillRect(0, 0, chart.chart.width, chart.chart.height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user