Overview
FancyCandles WPF library lets you add professional candlestick charts to your applications. A wide variety of settings are available for fine tuning. Traditionally candlesticks are used for visualizing a price history of any financial instruments - stocks, currency pairs or futures. But you can utilize candlestick charts for plotting any time series that contain OHLC (t) components: {t - time, O - Open, H - High, L - Low, C - Close}.
Main constituents
The CandleChart control consists of the following main components:
Price chart
The price chart is a central component of the CandleChart control.
Some related properties: ChartAreaBackground, PriceChartBottomMargin, PriceChartTopMargin, BullishCandleBrush, BearishCandleBrush, CandleWidth, InitialCandleWidth, GapBetweenCandles, InitialGapBetweenCandles.
Volume histogram
The volume histogram is optional and could be hidden.
Some related properties: ChartAreaBackground, IsVolumePanelVisible, VolumeBarWidthToCandleWidthRatio, VolumeHistogramBottomMargin, VolumeHistogramTopMargin, BullishVolumeBarBrush, BearishVolumeBarBrush.
Time axis
The time axis contain ticks and its labels for time and date values. Starting from daily timeframe (and higher), the time axis contains only the ticks of date, and no of time.
Some related properties: TimeTickFontSize, TimeAxisHeight.
Price axis
The price axis contain ticks and its labels for price and volume (if the volume histogram is visible) values. Since the volume labels locate inside the price axis area, their appearance is defined by the same properties as for the price labels. You can regulate the density of the labels by setting the GapBetweenPriceTickLabels property.
Some related properties: PriceTickFontSize, PriceAxisWidth.
Scrollbar
The scrollbar is bound to the VisibleCandlesRange property and changes its Start_i field. You can tune an appearance of the scrollbar.
Some related properties: ScrollBarHeight, ScrollBarBackground.
Gridlines
The horizontal and vertical gridlines are bound to the ticks of the price axis and of the time axis respectively. You can hide the gridlines and tune their appearance.
Some related properties: IsHorizontalGridlinesEnabled, IsVerticalGridlinesEnabled, HideMinorVerticalGridlines, HorizontalGridlinesPen, VerticalGridlinesPen.
Legend
The Legend contains any text, describing this chart. You set it by your own, but usually it contains a ticker symbol (a name of the security) and a timeframe. For example: "AAPL", "GOOGL, M5", "BTC/USD, D" etc. The legend locates in the price chart area and could be horizontally and vertically aligned.
Some related properties: LegendText, LegendFontSize, LegendFontWeight, LegendForeground, LegendHorizontalAlignment, LegendVerticalAlignment, LegendMargin.
Cross
The cross helps you visualize the current position of the mouse pointer, the correspondent time and price levels. You can separately disable or enable the cross lines and the cross price label on the price axis.
Some related properties: CrossLinesBrush, CrossPriceBackground, CrossPriceForeground, IsCrossLinesVisible, IsCrossPriceVisible.
Candles source and visible candles
The CandlesSource property defines the candles data source of your chart. In most cases a chart window accommodates only a part of all candles. The VisibleCandlesRange property defines the range of indexes of the candles that are currently shown in the chart window. This property is changed every time you scroll through the candles via the scrollbar, resize the chart window or change the number of visible candles via mouse wheel. But you can set it up directly via the property setter or via some special methods - SetVisibleCandlesRangeCenter() or SetVisibleCandlesRangeBounds().
Besides scrollbar, you can use mouse wheel in conjunction with certain modifier key (defined by the MouseWheelModifierKeyForScrollingThroughCandles property) to scroll through the collection of candles. And you can use mouse wheel in conjunction with another modifier key (defined by the MouseWheelModifierKeyForCandleWidthChanging property) to change the amount of candles currently visible in the chart window. The default values for this properties are ModifierKeys.Control and ModifierKeys.None respectively, i.e. you need to roll a mouse wheel with Ctrl to scroll through the candles, and to roll a wheel with no modifier to change the amount of visible candles. You can set up this modifier keys as you like.
See also: CandlesSource, VisibleCandlesRange.
Disabled mode
Disabling (the isEnabled property is set to false) is essential for situations when your chart is waiting for some lengthy asynchronous operation, eg loading a new candles data collection from the internet, and you need to visualize this process by shading the chart and showing up some external busy indicator. You can set up the color and transparency of the covering shading layer for the whole control for the disabled mode.
See also: DisabledFill.