Available in the Full Version
Data Chart - Transition Animation (Financial)
This sample demonstrates the animation feature that is displayed at the financial charts initialization.
This sample uses CTP (Community Technical Preview) features. The API and behavior may change when these features are released with full support.
Series type:
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> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <!-- 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.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 () { $("#chart").igDataChart({ width: "100%", height: "400px", dataSource: data, title: "Financial Chart", axes: [{ type: "categoryX", label: "Date", name: "xAxis", title: "Date" }, { type: "numericY", name: "yAxis", title: "Price" }], series: [{ type: "financial", displayType: "candlestick", isHighlightingEnabled: true, isTransitionInEnabled: true, closeMemberPath: "Close", highMemberPath: "High", lowMemberPath: "Low", openMemberPath: "Open", volumeMemberPath: "Volume", xAxis: "xAxis", yAxis: "yAxis", name: "indicatorSeries", title: "Financial Indicator Data", transitionInDuration: 1500, transitionInMode: "accordionFromValueAxisMaximum" }] }); function redrawChart() { transMode = $("#transitionInTypeSlider").val(); transType = $("#transitionInSpeedTypeSlider").val(); transEasingFunc = $("#transitionEasingFunctionSlider").val(); seriesType = $("#seriesType").val(); var thickness = 3; if (seriesType == "candlestick" || seriesType == "priceChannelOverlay" || seriesType == "bollingerBandsOverlay") { thickness = 1; } if (seriesType == "ohlc") { thickness = 2; } $("#chart").igDataChart("option", "series", [{name: "indicatorSeries",remove: true}]); if (seriesType == "ohlc" || seriesType == "candlestick") { $("#chart").igDataChart("option", "series", [{ type: "financial", isTransitionInEnabled: true, closeMemberPath: "Close", highMemberPath: "High", lowMemberPath: "Low", openMemberPath: "Open", volumeMemberPath: "Volume", xAxis: "xAxis", yAxis: "yAxis", name: "indicatorSeries", title: "Financial Indicator Data", thickness: thickness, transitionInDuration: 1500, transitionInMode: transMode, transitionInType: transType, transitionInEasingFunction: transEasingFunc, displayType: seriesType }]); } else { $("#chart").igDataChart("option", "series", [{ type: seriesType, isTransitionInEnabled: true, closeMemberPath: "Close", highMemberPath: "High", lowMemberPath: "Low", openMemberPath: "Open", volumeMemberPath: "Volume", xAxis: "xAxis", yAxis: "yAxis", name: "indicatorSeries", title: "Financial Indicator Data", transitionInDuration: 1500, transitionInMode: transMode, transitionInType: transType, transitionInEasingFunction: transEasingFunc }]); } }; $("#seriesType").change(function (e) { redrawChart(); }); $("#transitionInTypeSlider").change(function (e) { redrawChart(); }); $("#transitionInSpeedTypeSlider").change(function (e) { redrawChart(); }); $("#transitionEasingFunctionSlider").change(function (e) { redrawChart(); }); }); </script> <style type="text/css"> .selectionOptions { width: 450px; margin-top: 10px; } .selectionOptions > label { display: block; } .optionContainer { min-width: 120px; max-width: 250px; margin: 2px; padding: 2px; display: inline-block; border: 1px solid #e0e0e0; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } td { vertical-align: top; } .chartElement { padding-bottom: 20px; } .sliderBounds { width: 95px; margin: 6px 3px 6px 6px; display: inline-block; } .selectBounds { min-width: 120px; max-width: 132px; } </style> <div class="selectionOptions" > Series type: <select id="seriesType" class="selectBounds"> <option value="candlestick" selected="selected">Candlestick</option> <option value="ohlc">OHLC</option> <option value="absoluteVolumeOscillatorIndicator" >Absolute Volume Oscillator</option> <option value="averageTrueRangeIndicator">Average True Range</option> <option value="accumulationDistributionIndicator">Accumulation Distribution</option> <option value="averageDirectionalIndexIndicator">Average Directional Index</option> <option value="bollingerBandsOverlay">Bollinger Bands Overlay</option> <option value="bollingerBandWidthIndicator">Bollinger Band Width</option> <option value="chaikinOscillatorIndicator">Chaikin Oscillator</option> <option value="chaikinVolatilityIndicator">Chaikin Volatility</option> <option value="commodityChannelIndexIndicator">Commodity Channel Index</option> <option value="detrendedPriceOscillatorIndicator">Detrended Price Oscillator</option> <option value="easeOfMovementIndicator">Ease Of Movement</option> <option value="fastStochasticOscillatorIndicator">Fast Stochastic Oscillator</option> <option value="forceIndexIndicator">Force Index</option> <option value="fullStochasticOscillatorIndicator">Full Stochastic Oscillator</option> <option value="marketFacilitationIndexIndicator">Market Facilitation Index</option> <option value="massIndexIndicator">Mass Index</option> <option value="medianPriceIndicator">Median Price</option> <option value="moneyFlowIndexIndicator">Money Flow Index</option> <option value="movingAverageConvergenceDivergenceIndicator">Moving Average Convergence Divergence</option> <option value="negativeVolumeIndexIndicator">Negative Volume Index</option> <option value="onBalanceVolumeIndicator">On Balance Volume</option> <option value="percentagePriceOscillatorIndicator">Percentage Price Oscillator</option> <option value="percentageVolumeOscillatorIndicator">Percentage Volume Oscillator</option> <option value="positiveVolumeIndexIndicator">Positive Volume Index</option> <option value="priceChannelOverlay">Price Channel Overlay</option> <option value="priceVolumeTrendIndicator">Price Volume Trend</option> <option value="rateOfChangeAndMomentumIndicator">Rate Of Change And Momentum</option> <option value="relativeStrengthIndexIndicator">Relative Strength Index</option> <option value="slowStochasticOscillatorIndicator">Slow Stochastic Oscillator</option> <option value="standardDeviationIndicator">Standard Deviation</option> <option value="stochRSIIndicator">Stoch RSI</option> <option value="trixIndicator">Trix</option> <option value="typicalPriceIndicator">Typical Price</option> <option value="ultimateOscillatorIndicator">Ultimate Oscillator</option> <option value="weightedCloseIndicator">Weighted Close</option> <option value="williamsPercentRIndicator">Williams Percent R</option> </select> </div> <div id="chart" class="chartElement"></div> <div> <fieldset id="chartOptions"> <legend>Chart Options</legend> <div class="optionContainer"> Transition Types <br /> <select id="transitionInTypeSlider"> <option value="auto" selected="selected">auto</option> <option value="fromZero" >fromZero</option> <option value="accordionFromLeft">accordionFromLeft</option> <option value="accordionFromRight" >accordionFromRight</option> <option value="accordionFromTop" >accordionFromTop</option> <option value="accordionFromBottom" >accordionFromBottom</option> <option value="expand">expand</option> <option value="sweepFromLeft">sweepFromLeft</option> <option value="sweepFromRight" >sweepFromRight</option> <option value="sweepFromTop" >sweepFromTop</option> <option value="sweepFromBottom" >sweepFromBottom</option> <option value="sweepFromCenter" >sweepFromCenter</option> <option value="accordionFromCategoryAxisMinimum">accordionFromCategoryAxisMinimum</option> <option value="accordionFromCategoryAxisMaximum" >accordionFromCategoryAxisMaximum</option> <option value="accordionFromValueAxisMinimum" >accordionFromValueAxisMinimum</option> <option value="accordionFromValueAxisMaximum" >accordionFromValueAxisMaximum</option> <option value="sweepFromCategoryAxisMinimum">sweepFromCategoryAxisMinimum</option> <option value="sweepFromCategoryAxisMaximum" >sweepFromCategoryAxisMaximum</option> <option value="sweepFromValueAxisMinimum" >sweepFromValueAxisMinimum</option> <option value="sweepFromValueAxisMaximum" >sweepFromValueAxisMaximum</option> </select> </div> <div class="optionContainer"> Speed Type <br /> <select id="transitionInSpeedTypeSlider"> <option value="auto" selected="selected">auto</option> <option value="normal" >normal</option> <option value="valueScaled">valueScaled</option> <option value="indexScaled" >indexScaled</option> <option value="random" >random</option> </select> </div> <div class="optionContainer"> Easing Function <br /> <select id="transitionEasingFunctionSlider"> <option value="linear" selected="selected">linear</option> <option value="cubic" >cubic</option> </select> </div> </fieldset> </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" } ];