Amcharts Bridge chart

Amcharts Bridge chart

by Varsha Mathukumalli

HTML

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

CSS

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

JavaScript

var chart = AmCharts.makeChart("chartdiv", {
  "type": "serial",
  "theme": "light",
  "dataProvider": [{
    "name": "Total CY",
    "open": 0,
    "close": 4113664855,
    "color": "#1c8ceb",
    "balloonValue": 4113664855
  }, {
    "name": "C-Undefined",
    "open": 3966795855,
    "close": 4113664855,
    "color": "#54cb6a",
    "balloonValue": 146869000
  }, {
    "name": "C-Area Moscow",
    "open": 4796934090,
    "close": 3966795855,
    "color": "#d55374",
    "balloonValue": 830138235
  }, {
    "name": "C-Area Centre",
    "open": 5360824451,
    "close": 4796934090,
    "color": "#d55374",
    "balloonValue": 563890361
  }, {
    "name": "C-Area North",
    "open": 6201892268,
    "close": 5360824451,
    "color": "#d55374",
    "balloonValue": 841067817
  }, {
    "name": "C-Area South",
    "open": 6883940218,
    "close": 6201892268,
    "color": "#d55374",
    "balloonValue": 682047950
  }, {
    "name": "C-Area East",
    "open": 8549453015,
    "close": 6883940218,
    "color": "#d55374",
    "balloonValue": 1665512797
  }, {
    "name": "Total PY",
    "open": 0,
    "close": 8549453015,
    "color": "#1c8ceb",
    "balloonValue": 8549453015
  }],
  "valueAxes": [{
    "axisAlpha": 0,
    "gridAlpha": 0.1,
    "position": "left"
  }],
  "rotate": true,
  "startDuration": 1,
  "graphs": [{
    "balloonText": "<span style='color:[[color]]'>[[category]]</span><br><b>$[[balloonValue]] Mln</b>",
    "colorField": "color",
    "fillAlphas": 0.8,
    "labelText": "[[balloonValue]]",
    "lineColor": "#BBBBBB",
    "openField": "open",
    "type": "column",
    "valueField": "close"
  }],
  "trendLines": [{
    "dashLength": 3,
    "finalCategory": "Income B",
    "finalValue": 11.13,
    "initialCategory": "Income A",
    "initialValue": 11.13,
    "lineColor": "#888888"
  }, {
    "dashLength": 3,
    "finalCategory": "Expenses A",
    "finalValue": 15.81,
    "initialCategory": "Income B",
    "initialValue": 15.81,
    "lineColor": "#888888"
  },...