Available in the Full Version
Data Chart - Final Value Layer
This sample demonstrates using the Final Value Layer with the Data Chart control.
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>Final Value 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"> #sampleContainer fieldset.options label { display: unset; } .options { display: inline-block; } .options > div { display: table; } </style> <div id="chart"></div> <div> <fieldset class="options"> <legend>finalValueSelectionMode</legend> <div> <input id="autoMode" type="radio" name="finalValueSelectionMode" value="auto" /> <label for="autoMode">auto</label> </div> <div> <input id="finalVisibleMode" type="radio" name="finalValueSelectionMode" value="finalVisible" /> <label for="finalVisibleMode">finalVisible</label> </div> <div> <input id="finalVisibleInterpolatedMode" type="radio" name="finalValueSelectionMode" value="finalVisibleInterpolated" checked="checked" /> <label for="finalVisibleInterpolatedMode">finalVisibleInterpolated</label> </div> <div> <input id="finalMode" type="radio" name="finalValueSelectionMode" value="final" /> <label for="finalMode">final</label> </div> </fieldset> </div> <script> $(function () { var rus = [ { Year: 1900, Value: 67473000 }, { Year: 1910, Value: 77459000 }, { Year: 1920, Value: 93459000 }, { Year: 1930, Value: 102357000 }, { Year: 1940, Value: 108377000 }, { Year: 1950, Value: 112534000 }, { Year: 1960, Value: 117534000 }, { Year: 1970, Value: 130079000 }, { Year: 1980, Value: 137552000 }, { Year: 1990, Value: 147386000 }, { Year: 2000, Value: 145166731 }, { Year: 2010, Value: 142856836 }, { Year: 2020, Value: 151880432 } ]; var usa = [ { Year: 1900, Value: 76212168 }, { Year: 1910, Value: 92228496 }, { Year: 1920, Value: 106021537 }, { Year: 1930, Value: 123202624 }, { Year: 1940, Value: 132164569 }, { Year: 1950, Value: 151325798 }, { Year: 1960, Value: 179323175 }, { Year: 1970, Value: 203211926 }, { Year: 1980, Value: 226545805 }, { Year: 1990, Value: 248709873 }, { Year: 2000, Value: 281421906 }, { Year: 2010, Value: 308745538 }, { Year: 2020, Value: 353745538 } ]; function GenerateData() { for (var i = 0; i < usa.length; ++i) { var rusItem = rus[i]; var usaItem = usa[i]; rusItem.ValueInMln = rusItem.Value / 1000000; usaItem.ValueInMln = usaItem.Value / 1000000; } } GenerateData(); $("#chart").igDataChart({ width: "100%", height: "400px", isHorizontalZoomEnabled: true, isVerticalZoomEnabled: true, axes: [ { name: "xAxis", type: "categoryX", label: "Year", dataSource: usa }, { name: "yAxis", type: "numericY", title: "Population", labelLocation: "outsideRight", minimumValue: 0 } ], series: [ { name: "russiaPopulation", type: "line", title: "Russia", dataSource: rus, xAxis: "xAxis", yAxis: "yAxis", valueMemberPath: "ValueInMln" }, { name: "usaPopulation", type: "line", title: "USA", dataSource: usa, xAxis: "xAxis", yAxis: "yAxis", valueMemberPath: "ValueInMln" }, { name: "finalValueSeries", type: "finalValueLayer", finalValueSelectionMode: "finalVisibleInterpolated" } ] }); $("input[name=finalValueSelectionMode]").change(function(evt, ui) { var series = $("#chart").igDataChart("option", "series"); for (var i = 0; i < series.length; ++i) { if (series[i].name === "finalValueSeries") { series[i].finalValueSelectionMode = evt.currentTarget.value; $("#chart").igDataChart("option", "series", series); return; } } }); }); </script> </body> </html>