Transparency on amCharts

by cristiscu

HTML

<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
<div id="chartdiv"></div>

CSS

#chartdiv {
  width: 100%;
  height: 500px;
}

JavaScript

var chart = AmCharts.makeChart("chartdiv", {
  depth3D: 20, // transparency not applied when 3D on
  angle: 30,
  type: "serial",
  marginRight: 70,
  categoryField: "country",
  dataProvider: [{
    country: "USA",
    visits: 2025,
    color: "rgba(255,0,0,0.1)"
  }, {
    country: "China",
    visits: 1882,
    color: "rgba(255,0,0,0.4)"
  }, {
    country: "Japan",
    visits: 1809,
    color: "rgba(255,0,0,0.8)"
  }],
  graphs: [{
    fillColorsField: "color",
    fillAlphas: 1,
    lineAlpha: 0.2,
    type: "column",
    valueField: "visits"
  }],
});