Available in the Full Version
Data Chart - Item Tooltip Layer
This sample demonstrates the Item Tooltip Layer that displays tooltips for all target series individually. The sample options pane allows you to edit the properties of the layer, such as changing the transition duration.
This sample uses CTP (Community Technical Preview) features. The API and behavior may change when these features are released with full support.
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>Item Tooltip Layer</title> <!-- Ignite UI for jQuery Required Combined CSS Files --> <link href="http://cdn-na.infragistics.com/igniteui/2024.1/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" /> <link href="http://cdn-na.infragistics.com/igniteui/2024.1/latest/css/structure/infragistics.css" rel="stylesheet" /> <!--CSS file specific for chart styling --> <link href="http://cdn-na.infragistics.com/igniteui/2024.1/latest/css/structure/modules/infragistics.ui.chart.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.1/latest/js/infragistics.core.js"></script> <script src="http://cdn-na.infragistics.com/igniteui/2024.1/latest/js/infragistics.dv.js"></script> </head> <body> <style type="text/css"> .sliderBounds { width: 95px; margin: 6px 3px 6px 6px; display: inline-block; } .optionContainer { width: 200px; margin: 2px; padding: 2px; display: inline-block; border: 1px solid #e0e0e0; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } .selectBounds { min-width: 120px; max-width: 132px; } </style> <div id="chart"></div> <br/> <div> <fieldset id="chartOptions"> <legend>Category Item Highlight Options</legend> <div class="optionContainer"> Transition Duration <br /> <div id="transitionDurationSlider" class="sliderBounds"></div> <label id="transitionDurationLabel">500</label> </div> <div class="optionContainer"> <input type="checkbox" id="useInterpolationCheckBox" />Use Interpolation<br /> </div> </fieldset> </div> <br/> <div class="USCensus-attribution"> Population data from:<br /> <a href="http://www.census.gov/" target="_blank">U.S. Census Bureau</a> </div> <script> $(function () { var data = [ { "Year": 1960, "China": 667, "India": 449, "US": 181 }, { "Year": 1965, "China": 715, "India": 498, "US": 194 }, { "Year": 1970, "China": 818, "India": 554, "US": 205 }, { "Year": 1975, "China": 916, "India": 621, "US": 216 }, { "Year": 1980, "China": 981, "India": 697, "US": 227 }, { "Year": 1985, "China": 1051, "India": 782, "US": 238 }, { "Year": 1990, "China": 1135, "India": 870, "US": 250 }, { "Year": 1995, "China": 1205, "India": 960, "US": 266 }, { "Year": 2000, "China": 1263, "India": 1053, "US": 282 }, { "Year": 2005, "China": 1304, "India": 1144, "US": 296 }, { "Year": 2010, "China": 1338, "India": 1231, "US": 309 }, { "Year": 2015, "China": 1371, "India": 1309, "US": 321 }, ]; $("#chart").igDataChart({ width: "100%", height: "400px", title: "Population per Country", horizontalZoomable: true, verticalZoomable: true, dataSource: data, axes: [ { name: "xAxis", type: "categoryX", label: "Year", interval: 1 }, { name: "yAxis", type: "numericY", minimumValue: 0, maximumValue: 2000, title: "Millions of People", } ], series: [ { type: "line", name: "PopIndia", title: "India", xAxis: "xAxis", yAxis: "yAxis", valueMemberPath: "India", showTooltip: true, markerType: "circle" }, { type: "line", name: "PopChina", title: "China", xAxis: "xAxis", yAxis: "yAxis", valueMemberPath: "China", showTooltip: true, markerType: "circle" }, { type: "line", name: "PopUS", title: "United States", xAxis: "xAxis", yAxis: "yAxis", valueMemberPath: "US", showTooltip: true, markerType: "circle" }, { name: "itemToolTipLayer", title: "itemToolTip", type: "itemToolTipLayer", useInterpolation: false, transitionDuration: 250 }] }); //Transiton Duration Slider $("#transitionDurationSlider").slider({ min: 0, max: 1000, value: 250, slide: function (event, ui) { $("#transitionDurationLabel").text(ui.value); $("#chart").igDataChart("option", "series", [ { name: "itemToolTipLayer", transitionDuration: ui.value } ]); } }); //Use Interpolation $("#useInterpolationCheckBox").click(function (e) { var useInterpolationResult = $("#useInterpolationCheckBox").is(":checked") ? true : false; $("#chart").igDataChart("option", "series", [{ name: "itemToolTipLayer", useInterpolation: useInterpolationResult }]); }); }); </script> </body> </html>