Available in the Full Version

Shape Chart - Using Legend

This is a basic example showing the shape chart using a legend.
X vs Y
X vs Y

This sample is designed for a larger screen size.

On mobile, try rotating your screen, view full size, or email to another device.

Code View

Copy to Clipboard
<!DOCTYPE html>
<html>
<head>
    <title></title>
	<meta charset="utf-8" />


    <!-- Ignite UI for jQuery Required Combined CSS Files -->
    <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
    <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/structure/infragistics.css" rel="stylesheet" />    

    <script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>

    <!-- Ignite UI for jQuery Required Combined JavaScript Files -->
    <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.core.js"></script>
    <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.dv.js"></script>

</head>
<body>

    <style>
        .shapeChart
        {
            display: inline-block;
            vertical-align: top;
        }
    </style>

    <div id="shapeChart" class="shapeChart"></div>
    <div id="legend" class="shapeChart"></div>

    <script>

        var list1 = [
        { "X": 20, "Y": 20 },
        { "X": 20, "Y": 40 },
        { "X": 40, "Y": 40 },
        { "X": 40, "Y": 20 }];

        var list2 = [
        { "X": 60, "Y": 20 },
        { "X": 60, "Y": 40 },
        { "X": 80, "Y": 40 },
        { "X": 80, "Y": 20 }];

        var data = [[list1], [list2]];

        $(function () {

            $("#legend").igChartLegend({});

            $("#shapeChart").igShapeChart({
                dataSource: data,
                width: "700px",
                height: "400px",
                xAxisMinimumValue: 0,
                yAxisMinimumValue: 0,
                xAxisMaximumValue: 90,
                yAxisMaximumValue: 50,
                legend: "legend",
                isHorizontalZoomEnabled: true,
                isVerticalZoomEnabled: true,
            });
        });

    </script>

</body>
</html>