Available in the Full Version
Data Chart - Charts - Financial Indicators
This sample shows the variety of financial indicators that are supported by the chart control. Financial indicators are exposed as separate chart series types and they complement the financial chart series. Financial indicators provide additional information about stocks prices and trends.
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 xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Financial Indicators</title> <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 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" /> <!-- 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.lob.js"></script> <script src="http://cdn-na.infragistics.com/igniteui/2024.1/latest/js/infragistics.dv.js"></script> </head> <body> <script type="text/javascript" src="/data-files/financial-indicators.js"></script> <script type="text/javascript" src="/data-files/financial-data.js"></script> <script type="text/javascript"> $(function () { $("#priceChart").igDataChart({ width: "450px", height: "400px", dataSource: data, title: "Microsoft Stock (MSFT)", subtitle: "Data over two months", axes: [{ type: "categoryX", label: "Date", name: "xAxis", interval: 10, title: "Date" }, { type: "numericY", name: "yAxis", title: "Price" }], series: [{ type: "financial", isTransitionInEnabled: true, closeMemberPath: "Close", highMemberPath: "High", lowMemberPath: "Low", openMemberPath: "Open", volumeMemberPath: "Volume", xAxis: "xAxis", yAxis: "yAxis", name: "priceSeries", title: "Price Data" }] }); $("#indicatorChart").igDataChart({ width: "450px", height: "400px", dataSource: data, title: "Financial Chart", axes: [{ type: "categoryX", label: "Date", name: "xAxis", interval: 10, title: "Date" }, { type: "numericY", name: "yAxis", title: "Price" }], series: [{ type: "moneyFlowIndexIndicator", isTransitionInEnabled: true, closeMemberPath: "Close", highMemberPath: "High", lowMemberPath: "Low", openMemberPath: "Open", volumeMemberPath: "Volume", xAxis: "xAxis", yAxis: "yAxis", name: "indicatorSeries", title: "Financial Indicator Data" }] }); $.each(indicators, function (index, item) { $('#indicatorTypes').append($('<option></option>').val(item.key).html(item.text)); }); $("#indicatorTypes").change(function () { changeIndicator($(this).val()); }); }); function changeIndicator(newIndicator) { $("#indicatorChart").igDataChart("option", "series", [{ name: "indicatorSeries", remove: true }]); $("#indicatorChart").igDataChart("option", "series", [{ type: newIndicator, name: "indicatorSeries", title: "Financial Indicator Data", xAxis: "xAxis", yAxis: "yAxis", closeMemberPath: "Close", highMemberPath: "High", lowMemberPath: "Low", openMemberPath: "Open", volumeMemberPath: "Volume" }]); }; </script> <style type="text/css"> #priceChart, #indicatorChart { margin: 10px 0px 10px 0px; } .selectionOptions { width: 450px; margin-top: 10px; } .selectionOptions > label { display: block; } </style> <div id="priceChart"></div> <div id="indicatorChart"></div> <div class="selectionOptions"> <label>Select Indicator:</label> <select id="indicatorTypes"></select> </div> <div class="selectionOptions" style="display: inline-block"> <label>Stock data from: <a href="http://www.quandl.com/" target="_blank">Quandl</a> </label> </div> </body> </html>
var indicators = [ { key: "absoluteVolumeOscillatorIndicator", text: "Absolute Volume Oscillator" }, { key: "averageTrueRangeIndicator", text: "Average True Range" }, { key: "accumulationDistributionIndicator", text: "Accumulation Distribution" }, { key: "averageDirectionalIndexIndicator", text: "Average Directional Index" }, { key: "bollingerBandsOverlay", text: "Bollinger Bands Overlay" }, { key: "bollingerBandWidthIndicator", text: "Bollinger Bandwidth" }, { key: "chaikinOscillatorIndicator", text: "Chaikin Oscillator" }, { key: "chaikinVolatilityIndicator", text: "Chaikin Volatility" }, { key: "commodityChannelIndexIndicator", text: "Commodity Channel Index" }, { key: "detrendedPriceOscillatorIndicator", text: "Detrended Price Oscillator" }, { key: "easeOfMovementIndicator", text: "Ease Of Movement" }, { key: "fastStochasticOscillatorIndicator", text: "Fast Stochastic Oscillator" }, { key: "forceIndexIndicator", text: "Force Index" }, { key: "fullStochasticOscillatorIndicator", text: "Full Stochastic Oscillator" }, { key: "marketFacilitationIndexIndicator", text: "Market Facilitation Index" }, { key: "massIndexIndicator", text: "Mass Index" }, { key: "medianPriceIndicator", text: "Median Price" }, { key: "moneyFlowIndexIndicator", text: "Money Flow Index" }, { key: "movingAverageConvergenceDivergenceIndicator", text: "Moving Average Convergence Divergence" }, { key: "negativeVolumeIndexIndicator", text: "Negative Volume Index" }, { key: "onBalanceVolumeIndicator", text: "On Balance Volume" }, { key: "percentagePriceOscillatorIndicator", text: "Percentage Price Oscillator" }, { key: "percentageVolumeOscillatorIndicator", text: "Percentage Volume Oscillator" }, { key: "positiveVolumeIndexIndicator", text: "Positive Volume Index" }, { key: "priceChannelOverlay", text: "Price Channel Overlay" }, { key: "priceVolumeTrendIndicator", text: "Price Volume Trend" }, { key: "rateOfChangeAndMomentumIndicator", text: "Rate Of Change And Momentum" }, { key: "relativeStrengthIndexIndicator", text: "Relative Strength Index" }, { key: "slowStochasticOscillatorIndicator", text: "Slow Stochastic Oscillator" }, { key: "standardDeviationIndicator", text: "Standard Deviation" }, { key: "stochRSIIndicator", text: "Stoch RSI" }, { key: "trixIndicator", text: "Trix" }, { key: "typicalPriceIndicator", text: "Typical Price" }, { key: "ultimateOscillatorIndicator", text: "Ultimate Oscillator" }, { key: "weightedCloseIndicator", text: "Weighted Close" }, { key: "williamsPercentRIndicator", text: "Williams Percent R" } ];