Kagi Chart

This chart type belongs to PowerCharts XT.

Developed by the Japanese in the 1870s, the Kagi chart uses a series of vertical lines to illustrate general levels of supply and demand for certain assets. Thick lines are drawn when the price of the underlying asset breaks above the previous high price and is interpreted as an increase in demand for the asset. Thin lines are used to represent increased stock when the price falls below the previous low.

Let's create a Kagi chart which will show a series of connecting vertical lines. The thickness and direction of the lines will be dependent on the price. The line will extend until the prices are moving in the same direction. Once the prices reverse by a negative amount, a new Kagi line is drawn in a new column. When prices enter a previous high or low, the thickness of the kagi line changes.

To create a Kagi chart, follow the steps given below:

  • In the JSON data, set the attributes and their corresponding values in "<attributeName>": "<value>" format.

  • Specify the chart type using the type attribute. To render a kagi chart, set kagi.

  • Set the container object using renderAt attribute.

  • Specify the dimension of the chart using width and height attributes.

  • Set the type of data (JSON/XML) you want to pass to the chart object using dataFormat attribute.

  • Depending on the value passed to the dataFormat attribute, set the dataSource attribute(JSON/XML) from where the data will be fetched.

  • Specify the value for a data item using the value attribute within the data object.

For a detailed list of attributes, refer to the chart attributes page of kagi chart.

A simple Kagi chart looks like:

FusionCharts will load here..
{
    "chart": {
        "theme": "fusion",
        "caption": "Stock Price HRYS",
        "subCaption": "Last 2 months",
        "numberPrefix": "$",
        "xAxisName": "Day",
        "yAxisName": "Amount (In USD)",
        "labelDisplay": "Rotate",
        "reversalPercentage": "5",
        "axisLineAlpha": "40",
        "rallythickness": "3",
        "declinethickness": "3"
    },
    "data": [
        {
            "label": "Day 60",
            "value": "18.99"
        },
        {
            "label": "Day 59",
            "value": "18.82"
        },
        {
            "label": "Day 58",
            "value": "18.65"
        },
        {
            "label": "Day 57",
            "value": "19.4"
        },
        {
            "label": "Day 56",
            "value": "19.92"
        },
        {
            "label": "Day 55",
            "value": "20.16"
        },
        {
            "label": "Day 54",
            "value": "20.48"
        },
        {
            "label": "Day 53",
            "value": "20.15"
        },
        {
            "label": "Day 52",
            "value": "20.22"
        },
        {
            "label": "Day 51",
            "value": "19.44"
        },
        {
            "label": "Day 50",
            "value": "19.22"
        },
        {
            "label": "Day 49",
            "value": "19.24"
        },
        {
            "label": "Day 48",
            "value": "18.95"
        },
        {
            "label": "Day 47",
            "value": "18.97"
        },
        {
            "label": "Day 46",
            "value": "18.7"
        },
        {
            "label": "Day 45",
            "value": "19.05"
        },
        {
            "label": "Day 44",
            "value": "19.33"
        },
        {
            "label": "Day 43",
            "value": "18.52"
        },
        {
            "label": "Day 42",
            "value": "18.26"
        },
        {
            "label": "Day 41",
            "value": "18.51"
        },
        {
            "label": "Day 40",
            "value": "18.66"
        },
        {
            "label": "Day 39",
            "value": "19.2"
        },
        {
            "label": "Day 38",
            "value": "19.33"
        },
        {
            "label": "Day 37",
            "value": "19.27"
        },
        {
            "label": "Day 36",
            "value": "19.77"
        },
        {
            "label": "Day 35",
            "value": "19.88"
        },
        {
            "label": "Day 34",
            "close": "19.63"
        },
        {
            "label": "Day 33",
            "value": "20.65"
        },
        {
            "label": "Day 32",
            "value": "21.33"
        },
        {
            "label": "Day 31",
            "value": "20.56"
        },
        {
            "label": "Day 30",
            "value": "20.36"
        },
        {
            "label": "Day 29",
            "value": "20.03"
        },
        {
            "label": "Day 28",
            "value": "19.88"
        },
        {
            "label": "Day 27",
            "value": "19.9"
        },
        {
            "label": "Day 26",
            "value": "19.5"
        },
        {
            "label": "Day 25",
            "value": "19.43"
        },
        {
            "label": "Day 24",
            "value": "19.41"
        },
        {
            "label": "Day 23",
            "value": "19.83"
        },
        {
            "label": "Day 22",
            "value": "21"
        },
        {
            "label": "Day 21",
            "value": "20.44"
        },
        {
            "label": "Day 20",
            "value": "20.3"
        },
        {
            "label": "Day 19",
            "value": "21.63"
        },
        {
            "label": "Day 18",
            "value": "23.28"
        },
        {
            "label": "Day 17",
            "value": "23.94"
        },
        {
            "label": "Day 16",
            "value": "23.48"
        },
        {
            "label": "Day 15",
            "value": "22.74"
        },
        {
            "label": "Day 14",
            "value": "22.24"
        },
        {
            "label": "Day 13",
            "value": "22.42"
        },
        {
            "label": "Day 12",
            "value": "22.68"
        },
        {
            "label": "Day 11",
            "value": "23.46"
        },
        {
            "label": "Day 10",
            "value": "23.6"
        },
        {
            "label": "Day 9",
            "value": "24.15"
        },
        {
            "label": "Day 8",
            "value": "24.1"
        },
        {
            "label": "Day 7",
            "value": "23.47"
        },
        {
            "label": "Day 6",
            "value": "23.76"
        },
        {
            "label": "Day 55",
            "value": "23.66"
        },
        {
            "label": "Day 5",
            "value": "23.79"
        },
        {
            "label": "Day 4",
            "value": "23.39"
        },
        {
            "label": "Day 3",
            "value": "23.88"
        },
        {
            "label": "Day 2",
            "value": "23.01"
        },
        {
            "label": "Yesterday",
            "value": "23.32"
        }
    ]
}
<chart theme="fusion" caption="Stock Price HRYS" subcaption="Last 2 months" numberprefix="$" xaxisname="Day" yaxisname="Amount (In USD)" labeldisplay="Rotate" reversalpercentage="5" axislinealpha="40" rallythickness="3" declinethickness="3">
    <set label="Day 60" value="18.99" />
    <set label="Day 59" value="18.82" />
    <set label="Day 58" value="18.65" />
    <set label="Day 57" value="19.4" />
    <set label="Day 56" value="19.92" />
    <set label="Day 55" value="20.16" />
    <set label="Day 54" value="20.48" />
    <set label="Day 53" value="20.15" />
    <set label="Day 52" value="20.22" />
    <set label="Day 51" value="19.44" />
    <set label="Day 50" value="19.22" />
    <set label="Day 49" value="19.24" />
    <set label="Day 48" value="18.95" />
    <set label="Day 47" value="18.97" />
    <set label="Day 46" value="18.7" />
    <set label="Day 45" value="19.05" />
    <set label="Day 44" value="19.33" />
    <set label="Day 43" value="18.52" />
    <set label="Day 42" value="18.26" />
    <set label="Day 41" value="18.51" />
    <set label="Day 40" value="18.66" />
    <set label="Day 39" value="19.2" />
    <set label="Day 38" value="19.33" />
    <set label="Day 37" value="19.27" />
    <set label="Day 36" value="19.77" />
    <set label="Day 35" value="19.88" />
    <set label="Day 34" close="19.63" />
    <set label="Day 33" value="20.65" />
    <set label="Day 32" value="21.33" />
    <set label="Day 31" value="20.56" />
    <set label="Day 30" value="20.36" />
    <set label="Day 29" value="20.03" />
    <set label="Day 28" value="19.88" />
    <set label="Day 27" value="19.9" />
    <set label="Day 26" value="19.5" />
    <set label="Day 25" value="19.43" />
    <set label="Day 24" value="19.41" />
    <set label="Day 23" value="19.83" />
    <set label="Day 22" value="21" />
    <set label="Day 21" value="20.44" />
    <set label="Day 20" value="20.3" />
    <set label="Day 19" value="21.63" />
    <set label="Day 18" value="23.28" />
    <set label="Day 17" value="23.94" />
    <set label="Day 16" value="23.48" />
    <set label="Day 15" value="22.74" />
    <set label="Day 14" value="22.24" />
    <set label="Day 13" value="22.42" />
    <set label="Day 12" value="22.68" />
    <set label="Day 11" value="23.46" />
    <set label="Day 10" value="23.6" />
    <set label="Day 9" value="24.15" />
    <set label="Day 8" value="24.1" />
    <set label="Day 7" value="23.47" />
    <set label="Day 6" value="23.76" />
    <set label="Day 55" value="23.66" />
    <set label="Day 5" value="23.79" />
    <set label="Day 4" value="23.39" />
    <set label="Day 3" value="23.88" />
    <set label="Day 2" value="23.01" />
    <set label="Yesterday" value="23.32" />
</chart>
<html>
<head>
	<title>My first chart using FusionCharts Suite XT</title>
	<script type="text/javascript" src="https://cdn.fusioncharts.com/fusioncharts/latest/fusioncharts.js"></script>
	<script type="text/javascript" src="https://cdn.fusioncharts.com/fusioncharts/latest/themes/fusioncharts.theme.fusion.js"></script>
	<script type="text/javascript">
		FusionCharts.ready(function(){
			var chartObj = new FusionCharts({
    type: 'kagi',
    renderAt: 'chart-container',
    width: '680',
    height: '390',
    dataFormat: 'json',
    dataSource: {
        "chart": {
            "theme": "fusion",
            "caption": "Stock Price HRYS",
            "subCaption": "Last 2 months",
            "numberPrefix": "$",
            "xAxisName": "Day",
            "yAxisName": "Amount (In USD)",
            "labelDisplay": "Rotate",
            "reversalPercentage": "5",
            "axisLineAlpha": "40",
            "rallythickness": "3",
            "declinethickness": "3"
        },
        "data": [{
            "label": "Day 60",
            "value": "18.99"
        }, {
            "label": "Day 59",
            "value": "18.82"
        }, {
            "label": "Day 58",
            "value": "18.65"
        }, {
            "label": "Day 57",
            "value": "19.4"
        }, {
            "label": "Day 56",
            "value": "19.92"
        }, {
            "label": "Day 55",
            "value": "20.16"
        }, {
            "label": "Day 54",
            "value": "20.48"
        }, {
            "label": "Day 53",
            "value": "20.15"
        }, {
            "label": "Day 52",
            "value": "20.22"
        }, {
            "label": "Day 51",
            "value": "19.44"
        }, {
            "label": "Day 50",
            "value": "19.22"
        }, {
            "label": "Day 49",
            "value": "19.24"
        }, {
            "label": "Day 48",
            "value": "18.95"
        }, {
            "label": "Day 47",
            "value": "18.97"
        }, {
            "label": "Day 46",
            "value": "18.7"
        }, {
            "label": "Day 45",
            "value": "19.05"
        }, {
            "label": "Day 44",
            "value": "19.33"
        }, {
            "label": "Day 43",
            "value": "18.52"
        }, {
            "label": "Day 42",
            "value": "18.26"
        }, {
            "label": "Day 41",
            "value": "18.51"
        }, {
            "label": "Day 40",
            "value": "18.66"
        }, {
            "label": "Day 39",
            "value": "19.2"
        }, {
            "label": "Day 38",
            "value": "19.33"
        }, {
            "label": "Day 37",
            "value": "19.27"
        }, {
            "label": "Day 36",
            "value": "19.77"
        }, {
            "label": "Day 35",
            "value": "19.88"
        }, {
            "label": "Day 34",
            "close": "19.63"
        }, {
            "label": "Day 33",
            "value": "20.65"
        }, {
            "label": "Day 32",
            "value": "21.33"
        }, {
            "label": "Day 31",
            "value": "20.56"
        }, {
            "label": "Day 30",
            "value": "20.36"
        }, {
            "label": "Day 29",
            "value": "20.03"
        }, {
            "label": "Day 28",
            "value": "19.88"
        }, {
            "label": "Day 27",
            "value": "19.9"
        }, {
            "label": "Day 26",
            "value": "19.5"
        }, {
            "label": "Day 25",
            "value": "19.43"
        }, {
            "label": "Day 24",
            "value": "19.41"
        }, {
            "label": "Day 23",
            "value": "19.83"
        }, {
            "label": "Day 22",
            "value": "21"
        }, {
            "label": "Day 21",
            "value": "20.44"
        }, {
            "label": "Day 20",
            "value": "20.3"
        }, {
            "label": "Day 19",
            "value": "21.63"
        }, {
            "label": "Day 18",
            "value": "23.28"
        }, {
            "label": "Day 17",
            "value": "23.94"
        }, {
            "label": "Day 16",
            "value": "23.48"
        }, {
            "label": "Day 15",
            "value": "22.74"
        }, {
            "label": "Day 14",
            "value": "22.24"
        }, {
            "label": "Day 13",
            "value": "22.42"
        }, {
            "label": "Day 12",
            "value": "22.68"
        }, {
            "label": "Day 11",
            "value": "23.46"
        }, {
            "label": "Day 10",
            "value": "23.6"
        }, {
            "label": "Day 9",
            "value": "24.15"
        }, {
            "label": "Day 8",
            "value": "24.1"
        }, {
            "label": "Day 7",
            "value": "23.47"
        }, {
            "label": "Day 6",
            "value": "23.76"
        }, {
            "label": "Day 55",
            "value": "23.66"
        }, {
            "label": "Day 5",
            "value": "23.79"
        }, {
            "label": "Day 4",
            "value": "23.39"
        }, {
            "label": "Day 3",
            "value": "23.88"
        }, {
            "label": "Day 2",
            "value": "23.01"
        }, {
            "label": "Yesterday",
            "value": "23.32"
        }]
    }
}
);
			chartObj.render();
		});
	</script>
	</head>
	<body>
		<div id="chart-container">FusionCharts XT will load here!</div>
	</body>
</html>

Click here to edit the kagi chart.

These charts are independent of time and only change direction once a predefined reversal amount is reached. This reversal value could be configured either as a percentage of range value or absolute value.

Anchors can also be plotted at each data point to show the data points individually. They can be configured to be shown or to be hidden.