FusionCharts - Configuring background color of charts in JavaScript

Created using FusionCharts Suite XT - www.fusioncharts.com

by Jithin Raj P R

HTML

<script src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.js"></script>
<script src="https://cdn.fusioncharts.com/fusioncharts/latest/themes/fusioncharts.theme.fusion.js"></script>
<!-- Configuring background color in Column2D chart using:
 Attribute: 
    # bgColor - Set to #DDDDDD
    # bgAlpha - Set to 50

Deviation from theme:
    # canvasBgAlpha - Set to 0 as the purpose of the chart to show background cosmetics. 
   
 -->
<div id="chart-container">FusionCharts will render here</div>

CSS

body {
  padding: 10px;
  background:red;
}

JavaScript

FusionCharts.ready(function() {
  var revenueChart = new FusionCharts({
    type: 'column2d',
    renderAt: 'chart-container',
    width: '500',
    height: '300',
    dataFormat: 'json',
    dataSource: {
      "chart": {
        "theme": "fusion",
        "caption": "Monthly Revenue",
        "subCaption": "Last year",
        "xAxisName": "Month",
        "yAxisName": "Amount (In USD)",
        "numberPrefix": "$",
        "canvasBgAlpha": "0",
        //Background color and alpha
        "bgColor": "rgba(0, 0, 0, 0.11)",
        "bgAlpha": "50",
        //Theme
        "theme": "fint"

      },

      "data": [{
          "label": "Jan",
          "value": "420000"
        },
        {
          "label": "Feb",
          "value": "810000"
        },
        {
          "label": "Mar",
          "value": "720000"
        },
        {
          "label": "Apr",
          "value": "550000"
        },
        {
          "label": "May",
          "value": "910000"
        },
        {
          "label": "Jun",
          "value": "510000"
        },
        {
          "label": "Jul",
          "value": "680000"
        },
        {
          "label": "Aug",
          "value": "620000"
        },
        {
          "label": "Sep",
          "value": "610000"
        },
        {
          "label": "Oct",
          "value": "490000"
        },
        {
          "label": "Nov",
          "value": "900000"
        },
        {
          "label": "Dec",
          "value": "730000"
        }
      ]
    }
  });
  

  revenueChart.render();
});