ui.igSparkline

ui.igSparkline_image

The Sparkline control is a data-intense, design-simple graphic that allows end users to spot trends, variations and patterns in data in a clear and compact representation. It supports the following chart types: line, column, area, and win-loss, and displays more details using markers, tooltips, normal ranges, and trend lines.

Further information regarding the classes, options, events, methods and themes of this API are available under the associated tabs above.

The following code snippet demonstrates how to initialize the igSparkline control.

For details on how to reference the required scripts and themes for the igSparkline control read, Using JavaScript Resources in Ignite UI and Styling and Theming Ignite UI.

Code Sample

<!DOCTYPE html>
<html>
<head>
        <title></title>
 
        <!-- Ignite UI Required Combined CSS Files -->
        <link href="/infragistics/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
        <link href="/infragistics/css/structure/infragistics.css" rel="stylesheet" />
 
        <script src="/js/modernizr.min.js"></script>
        <script src="/js/jquery.min.js"></script>
        <script src="/js/jquery-ui.min.js"></script>
 
        <!-- Ignite UI Required Combined JavaScript Files -->
        <script src="/infragistics/js/infragistics.core.js"></script>
        <script src="/infragistics/js/infragistics.dv.js"></script>
 
</head>
<body>
 
        <!-- Target element for the igSparkline -->
        <div id="sparkline"></div>
 
        <script>
 
                $(function () {
 
                        var invoiceData = [
                                { "OrderDate": "\/Date(836452800000)\/", "ExtendedPrice": 168.0000, "Freight": 32.3800 },
                                { "OrderDate": "\/Date(836452800000)\/", "ExtendedPrice": 98.0000, "Freight": 32.3800 },
                                { "OrderDate": "\/Date(836452800000)\/", "ExtendedPrice": 174.0000, "Freight": 32.3800 },
                                { "OrderDate": "\/Date(836539200000)\/", "ExtendedPrice": 167.4000, "Freight": 11.6100 },
                                { "OrderDate": "\/Date(836539200000)\/", "ExtendedPrice": 1696.0000, "Freight": 11.6100 },
                                { "OrderDate": "\/Date(836798400000)\/", "ExtendedPrice": 77.0000, "Freight": 65.8300 },
                                { "OrderDate": "\/Date(836798400000)\/", "ExtendedPrice": 1261.4000, "Freight": 65.8300 },
                                { "OrderDate": "\/Date(836798400000)\/", "ExtendedPrice": 214.2000, "Freight": 65.8300 },
                                { "OrderDate": "\/Date(836798400000)\/", "ExtendedPrice": 95.7600, "Freight": 41.3400 },
                                { "OrderDate": "\/Date(836798400000)\/", "ExtendedPrice": 222.3000, "Freight": 41.3400 },
                                { "OrderDate": "\/Date(836798400000)\/", "ExtendedPrice": 336.0000, "Freight": 41.3400 },
                                { "OrderDate": "\/Date(836884800000)\/", "ExtendedPrice": 2462.4000, "Freight": 51.3000 },
                                { "OrderDate": "\/Date(836884800000)\/", "ExtendedPrice": 47.5000, "Freight": 51.3000 },
                                { "OrderDate": "\/Date(836884800000)\/", "ExtendedPrice": 1088.0000, "Freight": 51.3000 },
                                { "OrderDate": "\/Date(836971200000)\/", "ExtendedPrice": 200.0000, "Freight": 58.1700 },
                                { "OrderDate": "\/Date(836971200000)\/", "ExtendedPrice": 604.8000, "Freight": 58.1700 },
                                { "OrderDate": "\/Date(836971200000)\/", "ExtendedPrice": 640.0000, "Freight": 58.1700 },
                                { "OrderDate": "\/Date(837057600000)\/", "ExtendedPrice": 45.9000, "Freight": 22.9800 },
                                { "OrderDate": "\/Date(837057600000)\/", "ExtendedPrice": 342.7200, "Freight": 22.9800 },
                                { "OrderDate": "\/Date(837057600000)\/", "ExtendedPrice": 168.0000, "Freight": 22.9800 },
                                { "OrderDate": "\/Date(837144000000)\/", "ExtendedPrice": 304.0000, "Freight": 148.3300 },
                        ];
 
                        $("#sparkline").igSparkline({
                                dataSource: invoiceData,
                                height: "100px",
                                width: "300px",
                                valueMemberPath: 'ExtendedPrice',
                                labelMemberPath: 'OrderDate'
                        });
 
                });
        </script> 
 
</body>
</html>
        

Related Samples

Related Topics

Dependencies

jquery.js
jquery-ui.js
infragistics.util.js
infragistics.util.jquery.js
infragistics.datasource.js
infragistics.templating.js
infragistics.dv_jquerydom.js
infragistics.ui.widget.js
infragistics.ext_core.js
infragistics.ext_collections.js
infragistics.dv_core.js
infragistics.dv_interactivity.js
infragistics.ext_ui.js
infragistics.ui.basechart.js
infragistics.sparkline.js

Inherits

Copyright © 1996 - 2025 Infragistics, Inc. All rights reserved.