Click or drag to resize


S# provides convenient components for charts plotting. These components are assembled in the StockSharp.Xaml.Charting namespace.

The key concept in the graphical library is a chart. Chart - is a container for other elements, which are used in the chart plotting. There are several types of charts in S#.

  • Chart - the graphical component for displaying the exchange charts.

  • ChartPanel - the advanced graphical component for displaying the exchange charts.

  • EquityCurveChart - the graphical component for displaying the equity curve.

  • BoxChart - the chart showing the volumes in a grid of numbers.

  • ClusterChart - the chart showing the volumes in the form of clusters with bar charts.

  • OptionPositionChart - the graphical component showing the positions and the options Greeks with regard to the underlying instrument. See OptionPositionChart.

Besides that, S# includes two types of charts for the volumes analysis: BoxChart and ClusterChart.

The following figure shows the basic elements of the graphical component.

Gui Chart Elements


Chart is the parent container for other elements of the graphical control. It contains methods for adding and removing the "child" elements, properties to customize the appearance of the component and the chart plotting method, as well as the method of charts drawing themselves. Chart can contain several areas (ChartArea) to plot charts (see Figure). Chart also contains the preview area OverView (see Figure). In this area, it is possible to select the chart viewing area using the sliders. In addition, it is possible to scroll and zoom in the chart by means of dragging the ChartArea field, X axis and using the mouse wheel.

The Chart basic properties and methods:


ChartArea - the plotting area, it is a container for the IChartElement elements (indicators, candles, etc.), which are drawn on the chart and chart axes (ChartAxis).

The ChartArea basic properties:


All the elements that are displayed in the chart must implement the IChartElement interface. S# has the following classes that implement this interface:

The visual elements classes have several properties to customize the appearance of the chart. It is possible to set the color, the lines thickness and the elements style. For example, using the ChartCandleElementDrawStyle property it is possible to change the appearance of the candle (candle or bar). With the ChartIndicatorElementDrawStyle property it is possible to set the indicator line style. So, to display the indicator as a histogram it is necessary to use the ChartIndicatorDrawStylesHistogram value. Properties ChartCandleElementShowAxisMarker and ChartIndicatorElementShowAxisMarker allow to enable/disable the markers display (see Figure) on the chart axes.

See Also