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.
The following figure shows the basic elements of the graphical component.
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:
ChartTheme - the component theme.
IndicatorTypes - the list of indicators that can be displayed on the chart.
CrossHair - to enable/disable the crosshair.
CrossHairAxisLabels - to enable/disable the crosshair marks on the axes.
IsAutoRange - to enable/disable the X axis automatic scaling.
IsAutoScroll - to enable/disable the auto scroll on the X axis.
ShowLegend - to enable/disable the legend display.
ShowOverview - to enable/disable the OverView preview area display.
AddElement - to add an item of the data series. It has several overloads.
Reset(IEnumerableIChartElement) - to “reset" the values drawn before.
Draw(ChartDrawData) - to draw the value on the chart.
The ChartArea basic properties:
ChartCandleElement - the element to display the candles.
LineElement - the element to display the line.
ChartIndicatorElement - the element to display the indicators.
ChartOrderElement - the element to display the orders.
ChartTradeElement - the element to display the trades.
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.