更改背景颜色

问题描述:

我怎样才能改变angular2-highcharts的背景颜色? 我我的分量,我有:更改背景颜色

chart: any; 
saveChart(chart) { 
    this.chart = chart; 
} 

    constructor(
private eventManager: EventManager, 
private locationService: LocationService, 
private route: ActivatedRoute, 
private alertService: AlertService 

){

this.options = { 
    title: { text: 'Senaste dygnet' }, 
    xAxis: { 
    type: 'datetime', 

    title: { 
     text: 'Tid' 
    } 
    }, 
    yAxis: { 
    title: { 
     text: 'Temperatur' 
    } 
    }, 
    series: [{ 
    name: 'Vattentemperatur', 
    data: [] 
    }] 
}; 

}

模板:

<chart [options]="options" (load)="saveChart($event.context)"></chart> 

当我这样做this.chart.backgroundColor = “#000000” ; 没有任何反应。

我从一位同事一些帮助,现在这对我的作品。

saveChart(chart) { 
    this.chart = chart; 
    this.chart.chartBackground.css({ 
     color: 'rgba(225, 225, 225, 0.7)', 
     fontSize: '16px' 
    }); 
} 

图:{ “事件”:{ “明细”:drillDownCallBack }, “plotBackgroundColor”: “黑”, “plotBorderWidth”:空, “plotShadow”:假的, “类型“:‘馅饼’ }

你可以通过‘plotBackgroundColor’:‘黑’,背景色下面是一个例子检查该

+0

https://jsfiddle.net/gourav012/4ueLkze9/4/ – Gourav