更改HighCharts背景颜色? [英] Changing HighCharts background color?

查看:500
本文介绍了更改HighCharts背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的不知道该怎么做。

I don't really know how to do this.

我需要更改此Highcharts图表的背景颜色:

I need to change background color of this highcharts chart:

http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/polar-spider/

但我似乎不能这样做 - 似乎没有任何明确的地方放置背景颜色设置?

But I don't seem to be able to do so - there doesn't seem to be any clear place to put the background color setting?

我已尝试在此部分中写入许多不同的值:

I've tried to write many different values in this section:


图表:{

chart: {

      polar: true,
      type: 'line'

  },


但它没有做任何事情)。

But it didn't do anything ( it occasionally broke this script ).

我需要在包含的.js文件中更改它吗?或者可以从这个加载的脚本的级别完成?

Do I need to change it somewhere in the included .js files? Or can it be done from the level of this loaded script?

JS真的很混乱。谁能帮助我?

JS is really confusing. Can anyone help me?

推荐答案

在这里查看Highcharts API: http://api.highcharts.com/highcharts#chart--backgroundColor ,您将看到它是图表对象的属性,可以采用纯色:

Take a look at the Highcharts API here: http://api.highcharts.com/highcharts#chart--backgroundColor and you will see it's a property of the chart object that can take a solid color:

{
  chart: {
     backgroundColor: '#FCFFC5',
     polar: true,
     type: 'line'
  }
}

Gradiant:

{
  chart: {
    backgroundColor: {
       linearGradient: [0, 0, 500, 500],
       stops: [
         [0, 'rgb(255, 255, 255)'],
         [1, 'rgb(200, 200, 255)']
       ]
     },
     polar: true,
     type: 'line'
  }
}

这篇关于更改HighCharts背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆