Available in the Full Version

Category Chart - Data Binding

This is a basic example showing databinding in the category chart.

This sample is designed for a larger screen size.

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

This is a basic example showing databinding in the category chart.

Code View

Copy to Clipboard
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Category Chart Data Binding</title>

    <!-- 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>
    <script type="text/javascript">
        // CODE SNIPPET
        var tabularData = [
            { "Year": "1995", "Brazil": 161, "Indonesia": 197, "United States": 266, "India": 920, "China": 1297 },
            { "Year": "2005", "Brazil": 186, "Indonesia": 229, "United States": 295, "India": 1090, "China": 1216 },
            { "Year": "2015", "Brazil": 204, "Indonesia": 256, "United States": 322, "India": 1251, "China": 1361 },
            { "Year": "2025", "Brazil": 218, "Indonesia": 277, "United States": 351, "India": 1396, "China": 1394 }];
        // excluding data columns on data source
        tabularData.__dataIntents = new Array();
        tabularData.__dataIntents["Brazil"] = ["DontPlot"];

        $(function () {
            $("#chart").igCategoryChart({
                dataSource: tabularData,
                // excluding data columns on CategoryChart
                excludedProperties: ["Indonesia"], 
            });

            $("#chart").igCategoryChart({ title: "A comparison of population over time" });
            $("#chart").igCategoryChart({ subtitle: "A comparison of the population of Brazil, Indonesia, United States, India and China" });
        });

        // CODE SNIPPET
    </script>

    <div id="chart" style="width:800px;height:400px"></div>
</body>
</html>