# LightningChart .NET developer documentation
> The 1 stop developer guide for all things in LightningChart .NET
This file contains all documentation content in a single document following the llmstxt.org standard.
## Visual Studio
### Adding LightningChart components to Visual Studio Toolbox
:::danger[Warning]
Applies to **.NET Framework only**. Currently Visual Studio (2026 18.5) does not support Controls/Toolbox Deployment through DLL-reference for .NET (5, 6, 7, 8, 10) projects. Therefore, LightningChart .NET Core (e.g. 6, 8 or 10.0) controls cannot be installed to the toolbox the same way as for .NET Framework. This is not LightningChart specific, and affects any custom-control.
However, this limitation does not prevent LightningChart control usage. The references can be added manually, and the chart created [in the code](chart-in-code.md).
:::
During installation ***LightningChart*** components automatically added Visual Studio Toolbox. Once you open/create **.NET Framework** application (WinForms and WPF) Visual Studio Toolbox will show controls which could be used in the project. However, dragging and dropping from Toolbox is not required - the chart could be created and configured in code (as demonstrated in our Interactive Examples App and **[code sample](chart-in-code.md)**).
Note, LightningChart will not appear in Visual Studio toolbox for projects targeting .NET Core 3 or higher (e.g. .NET 10.0, see warning above).
If for some reason LightningChart .NET control was not added in the Visual Studio toolbox (for **.NET Framework** application) or user wants to add it manually, then following paragraph will explain how to do it.
#### Winforms
1. Open Visual studio. Create a new **WinForms** project. Right-click on Toolbox, select **Add Tab** and
give name "LightningChart"
2. Right-click on *LightningChart* tab, and select **Choose items...**
3. In **Choose Toolbox items** window, Select **.NET Framework Components** page. Click **Browse...**
Browse **LightningChart.WinForms.Charting.NET4.dll** and
**LightningChart.WinForms.SignalTools.NET4.dll**, from the folder the components were
installed on, typically **C:\Program Files\LightningChart\LightningChart .NET SDK v.12\LibNET4**, and
click open. The components can now be found in the toolbox.
#### WPF
1. Open Visual studio. Create a new **WPF** project. Right-click on Toolbox, select **Add Tab** and give
name "LightningChart"
2. Right-click on *LightningChart* tab, and select **Choose items...**
3. In **Choose Toolbox items** window, Select **WPF Components** page. Click **Browse...**
Browse **LightningChart.WPF.Charting.NET4.dll**, **LightningChart.WPF.ChartingMVVM.NET4**,
and **LightningChart.WPF.SignalTools.NET4.dll**, from the folder the components were installed
to, typically **C:\Program Files\LightningChart\LightningChart .NET SDK v.12\LibNET4**, and click
open. The components can be now found in the toolbox.
### Configuring Visual Studio 2010-2022 help manually
This chapter gives the information how to install LightningChart® .NET help content manually. This
information is needed if Visual Studio 2010-2022 does not have any local help content installed. When
installing LightningChart® .NET and there isn’t any *local help content installed*, LightningChart® .NET’s
help will not be added.
These steps allow to view LightningChart® .NET’s help from Visual Studio 2010-2022. Either press F1 on
LightningChart’s classes, properties etc. or use Microsoft Help Viewer to browse the help content.
#### Visual Studio 2010
Follow these steps to manually install LightningChart® .NET help content on Visual Studio 2010:
1. Open Visual Studio 2010.
2. Select **Help -> Manage Help Settings.**
3. On Help Library Manager, click **Settings** link.
4. Make sure that **I want to use local help** is selected.
5. If **I want to use local help** is selected, click **Cancel** to go back to Help Library Manager. Otherwise click **OK**.
6. Click **Install content from disk** link.
7. Click **Browse** button and go to the folder where LightningChart® .NET is installed, by default the path is **C:\Program Files\LightningChart\LightningChart .NET SDK v.12\MSHelpViewer**.
8. Select **HelpContentSetup.msha** and click **Open** button.
9. Click **Next** button.
10. Next to LightningChart® .NET Help there is Add link. Click it and make sure that Status column value changes to Update Pending.
11. Click **Update** button. If Help Library Manager asks if you want to proceed, click **Yes** button. Help library update begins.
12. After help library is updated, click **Finish** button to close Help Library Manager.
#### Visual Studio 2012-2022
Follow these steps to manually install LightningChart® .NET help content on Visual Studio 2012-
2022:
1. Open Visual Studio 2012, 2013, 2015, 2017, 2019 or 2022.
2. Select **HELP -> Add and Remove Help Content**
3. After Microsoft Help Viewer starts, select **Manage Content.**
4. Select **Disk** under **Installation source.**
5. Click the button with three dots to browse files.
6. Go to the folder where LightningChart® .NET is installed, by default the path is **C:\Program Files\LightningChart\LightningChart .NET SDK v.12\MSHelpViewer**
7. Select HelpContentSetup.msha and click Open button.
8. Next to LightningChart® .NET Help there is Add link. Click it and make sure that Status
column value changes to Add pending.

*Adding LightningChart help*
9. Click **Update** button. If Help Library Manager asks if you want to continue, click **Yes** button.
Help library update begins.
10. After help library is updated, Microsoft Help Viewer can be closed.
11. In Visual Studio Menu / Help, select Set **Help Preference : Launch in Help Viewer.**
### Code parameters and tips by Visual Studio IntelliSense
IntelliSense may not show code hints when typing LightningChart related code, if the LightningChart.dll file is referenced from Global Assembly Cache and the controls are not installed by the automatic toolbox installer. Remove the LightningChart.dll file from References list of the project. Then add it again by browsing from the install directory (typically **C:\Program Files\LightningChart\LightningChart .NET SDK v.12\LibNETFramework** or **LibNET**).
### Using LightningChart® .NET libraries
In order to use ***LightningChart® .NET*** components, LightningChart .dll -files have to be added to references. These can be found in the installation folder. The following assemblies are required when developing an application:
| Winforms | LightningChart.WinForms.Charting.NET4.dll.|
| :-------- | ----------------------------------------- |
| WPF Non-bindable | LightningChart.Wpf.Charting.NET4.dll LightningChart.DirectX.dll |
| WPF Bindable | LightningChart.Wpf.ChartingMVVM.NET4.dll LightningChart.DirectX.dll |
| UWP Chart | LightningChart.Uwp.ChartingMVVM.dll |
| If using SignalTools | LightningChart.WinForms.SignalTools.NET4.dll or LightningChart.Wpf.SignalTools.NET4.dll or LightningChart.UWP.SignalTools.dll |
When using .NET10 assemblies, NET4 is changed to NET10. Otherwise, the names are the same.
If the above references are added, building the project will automatically copy all the required assemblies to the output folder. [Page](/docs/beginners%20guide/deploymentV11.md) shows what assemblies are needed when deploying a LightningChart application.
*LightningChart.DirectXFilesNET.dll* is not automatically included as reference, as it is a large file which can increase the initialization time. It is only needed when there are no correct DirectX assemblies already in the system. LightningChart.DirectXInitNET.dll routines check the existing dlls and loads them when necessary. When loaded once, it writes the DirectX-dlls into Windows temp folder where LightningChart can access them in the future, thus making the initialization fast.
We recommend not to include *LightningChart.DirectXFilesNET.dll* as a reference, instead, copy it next to your exe.
---
## Overview of API
LightningChart® .NET control has 1500+ properties and hundreds of public methods and event handlers. Those help to adjust charts smallest delays (color, size, pattern etc.) and fine tune behavior to user's liking.
The complete collection of classes, properties, methods and delegates could be found online:
* [API documentation](https://lightningchart.com/net-charts/api-documentation/index.html)
Help files are also copied during SDK installation to:
**C:\Program Files\LightningChart\LightningChart .NET SDK v.12\Documents** folder, files **LightningChartNET.chm** or **LightningChartNETUWP.chm**. You can open help file from Start Menu or by clicking DevCenter *Local help file* button.
:::warning[previous version]
In version 10.x, the local help file could be found in
**C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10\Documents** folder, files **LightningChartNET.chm** or **LightningChartNETUWP.chm**.
:::
One easy way to test properties on-fly is to use Interactive Examples App's (Demo) feature Properties Editor. It allows to change most of the properties in selected example and see the effect instantly.

*Properties tab in Interactive Examples.*
...
---
## Creating chart in code
***LightningChart*** component can be added by either dragging it from the toolbox (.NET Framework 4.x projects) or by creating it completely in code behind. Creating the chart object in code has the advantage of allowing easier version updates. Furthermore, it can avoid some (de)serialization related issues.
### WPF non-bindable
The following demonstrates one way to create a WPF non-bindable chart in code behind (*.xaml.cs -file).
```csharp
using LightningChartLib.WPF.Charting
namespace ExampleApp
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
private LightningChart _chart = null;
public MainWindow()
{
InitializeComponent();
CreateChart();
}
private void CreateChart()
{
_chart = new LightningChart();
// Add Chart control into the parent container.
(Content as Grid).Children.Add(_chart);
// Disable rendering until the whole chart is set up correctly.
_chart.BeginUpdate();
// Configure chart here.
// Allow rendering the chart.
_chart.EndUpdate();
}
}
}
```
### WinForms / Windows Forms
The following demonstrates one way to create a WinForms chart in code behind (*.cs -file).
```csharp
using LightningChartLib.WinForms.Charting;
namespace WinFormsApp1
{
public partial class Form1 : Form
{
//Chart
private LightningChart _chart = null;
public Form1()
{
InitializeComponent();
CreateChart();
}
private void CreateChart()
{
_chart = new LightningChart();
//Disable rendering, strongly recommended before updating chart properties
_chart.BeginUpdate();
//Chart parent must be set
_chart.Parent = this;
//Fill parent area with chart
_chart.Dock = DockStyle.Fill;
// Configure chart here.
//Allow chart rendering
_chart.EndUpdate();
}
}
}
```
---
## Configuring appearance / performance settings
***ChartRenderOptions*** (***RenderOptions*** in WinForms) contain properties for configuring appearance and performance.

*RenderOptions properties*
### DeviceType
***DeviceType*** property controls which rendering device is used.
```csharp
// Changing the rendering device in code
chart.ChartRenderOptions.DeviceType = RendererDeviceType.Auto;
```
***DeviceType*** has the following options available:
Auto is an alias to AutoPreferD11 option. This is the default setting.
AutoPreferD9 prefers DirectX9 hardware rendering, and automatically selects device in this order: HW9 -> HW11 -> SW11 -> SW9 based on availability. Falls back to WARP (SW11) software rendering when hardware is not available.
AutoPreferD11 prefers DirectX11 hardware rendering, and automatically selects device in this order: HW11 -> HW9 -> SW11 -> SW9 based on availability. Falls back to WARP (SW11) software rendering when hardware is not available. **Use this as a general high-performance and best appearance setting.** Visual appearance is better than with DirectX9 renderer.
HardwareOnlyD9 uses hardware 9 rendering only.
HardwareOnlyD11 uses hardware 11 rendering only.
SoftwareOnlyD11 uses DirectX11 [WARP](https://learn.microsoft.com/en-us/windows/win32/direct3darticles/directx-warp) (very fast when compared to DirectX9 reference rasterizer, but slower than hardware options)
SoftwareOnlyD9 uses DirectX9 reference rasterizer (very slow).
None if chart is hidden, or inactive in background, setting DeviceType to None will free graphics resources to other charts.
### GPUPreference
A selection applicable to machines with dual graphics adapter systems, mainly laptops having integrated low-performance Graphics Processing Unit (GPU) in the CPU/chipset, and higher performance graphics GPU (e.g. AMD or Nvidia).
```csharp
chart.ChartRenderOptions.GPUPreference = GPUPreference.SystemSetting;
```
***GPUPreference*** has the following options available:
SystemSetting uses options selected in the graphics settings of Windows, or AMD / Nvidia control panel.
PreferHighPerformanceGraphics (Default) uses high-performance GPU if it exists in the system. Gives better performance in general but may lead into higher energy consumption.
PreferLowPowerGraphics uses slower integrated GPU, even if high-performance GPU has been installed on the system.
By default, *PreferHighPerformanceGraphics* is the preferred option. Keep it selected to get the best performance.
### FontsQuality
```csharp
chart.ChartRenderOptions.FontsQuality = FontsRenderingQuality.High;
```
***FontsQuality*** has the following options available:
Low gives best performance, the fonts are not anti-aliased. Select font typeface carefully to get acceptable appearance.
Mid gives almost similar performance than *Low*. Has simple anti-aliasing around the fonts. This is the default setting.
High gives best appearance but has a significant performance hit.
:::tip[Note]
Transparent background is not applicable for DirectX 11 rendering with **High** quality setting. For DirectX9 it works. This is a rendering technology limitation.
:::
### AntiAliasLevel
```csharp
chart.ChartRenderOptions.AntiAliasLevel = 1;
```
The overall scene anti-aliasing factor. Availability depends on the hardware. Higher values give better appearance, but with reduced performance. Set 0 or 1 to maximize the performance. See for more information on available [anti-aliasing](/docs/inDetail/anti-aliasing.md) settings.
### LineAAType2D / LineAAType3D
Anti-aliasing type of single pixel width anti-aliased lines. Applicable only on DX11 and when AntiAliasLevel is above 1. Lines thicker than 1 pixel are rendered using triangles, and use triangle drawing AA system. ALAA option produces generally best looking line and is faster than QLAA. There is some problems with ALAA with Warp though. For example,
```csharp
chart.ChartRenderOptions.LineAAType2D = LineAntiAliasingType.ALAA;
```
### WaitForVSync
```csharp
chart.ChartRenderOptions.WaitForVSync = true;
```
**Recommendation: keep as default value (False).** When enabled, holds rendering until display's next refresh is taking place (e.g. next multiple of 1/60 s). Only recommended temporarily e.g. when synchronization with external screen capture application is used to prevent striping, or when image on the screen in top of the screen is not in sync with bottom of the screen. It may show as broken waveform data. Significant performance hit when enabled, especially in WPF.
### UpdateType
```csharp
chart.ChartRenderOptions.UpdateType = ChartUpdateTypes.Sync;
```
***UpdateType*** has the following options available:
Sync (default): Chart is updated synchronously. Chart gets updated either after the last ***EndUpdate()*** call, or when setting a property (or calling a method) causes some changes in the Chart. Property change (without ***BeginUpdate…EndUpdate***) leads to immediate new frame rendering.
Async: Chart is updated on async fashion. The chart will update as fast as possible after property changes, but chart will render a new frame at some later point. This might make it easier to use the chart on some cases.
LimitedFrameRate: Frame rate is limited to value specified in ***FrameRateLimit*** property. 0 = unlimited. E.g. if max. 10 refreshes / second is wanted, set 10. This is similar to the Async option but prevents new frames from being rendered right after first one, thus reducing framerate, but sparing system resources.
:::tip[Note!]
Ensure correct thread handling also in *LimitedFrameRate* and *Async* modes. If the chart updates asynchronously, and chart properties are updated at the same time, a conflict may occur and crash the chart or application.
:::
### InvokeRenderingInUIThread
```csharp
chart.ChartRenderOptions.InvokeRenderingInUIThread = true;
```
When using a background thread in the application, all UI updates from the thread must go through Invoke (***Control.Invoke()*** in WinForms, and ***Dispatcher.Invoke()*** in WPF).
The rendering part will use internal Invoke to UI thread, when enabled.
The default value is **False**, as setting properties and calling methods in a thread-safe way should also be take care of, even when this property is enabled, to prevent thread collision in internal states of the chart.
### HeadlessMode
```csharp
chart.ChartRenderOptions.HeadlessMode = true;
```
Setting this to **True** allows using the chart in a background service, console application or other application without user interface. See more [Headless mode](/docs/inDetail/headless-mode.md) description.
### UseShaderForLinePattern
From version 12.4 shaders are used to render 1 px wide pattern line not only for XY axis grid, but also wireframe of IntensityGridSeries, angular grid of polar axis, LineSeriesCursor, ConstantLine, DataCursor, Annotation border and similar. There is several fold increase in chart refresh rate when patterned wireframe is drawn with shader.
However, it should be noted that some older graphic drivers may not work well with patterns created by shaders. In those cases, user can fallback to creation on CPU of line draw-data (as was before v12). This is done by disabling ***UseShaderForLinePattern*** property.
### FallbackWpfImagePresentation
Forces DX11 rendering on WPF to fallback to the presentation system without D3DImage. In some cases (when D3DImage creation fails), LightningChart will switch to fallback system automatically, although ***ChartMessage*** event will be raised as well. The fallback system can be switched on/off with ***FallbackWpfImagePresentation*** property (WPF edition only). Note that ***FallbackWpfImagePresentation*** property is moved from chart ***Options*** to [ChartRenderOptions](/docs/beginners%20guide/chart-render-options.md) in version 12.5.
### RemoveOverlapBetweenLineSegments
From version 12.6 new ***RemoveOverlapBetweenLineSegments*** property is added. It controls how the overlap adjacent line segments (of line-series, or border of Polygons/Maps) are rendered. By enabling property semitransparent line will become more homogeneous and nicer.

*Thick (50px) semitransparent line with DataBreaking. On the left **RemoveOverlapBetweenLineSegments** is disabled (default), on the right - enabled.*

*Continuous line made up of steep segments. Top, **RemoveOverlapBetweenLineSegments** disabled (old behavior) and at the bottom - enabled.*
---
## Chart editions v10
LightningChart® .NET SDK is an add-on to Microsoft Visual Studio, consisting of data visualization related software components and tool classes for WPF (***Windows Presentation Foundation***), UWP (***Universal Windows Platform***) and WinForms (***Windows Forms***) .NET platforms.
### Editions and performance
For WPF, LightningChart component is available in various binding level editions, to balance between different performance and MVVM (Model - View - ViewModel) bindability needs. UWP chart is based on the bindable WPF version, providing similar performance, binding and MVVM capabilities.

*Bindability and performance matrix*
* For best performance in WPF and multithreading benefits, select non-bindable chart.
* For good tradeoff between WPF bindability and performance, select bindable chart. Bindable also supports MVVM design pattern.
Different chart editions can be used in the same application. It's possible to create basic charts with bindable chart and bind various properties while using the non-bindable chart for performance-critical tasks. The collection properties of bindable charts (such as ViewXY axes, 3D lights) are empty by default which supports XAML editor in full. In Non-bindable and WinForms collections are prefilled with default items.
Per-data-point binding is supported only in fully-bindable WPF, which is available in the source code only.
:::tip[NOTE !]
Non-Bindable WPF chart is not intended to be configured in XAML at all. Use it in [code-behind](/docs/beginners%20guide/chart-in-code.md).
:::
### Differences between Windows forms, WPF and UWP
The property tree and object model between Windows Forms and WPF are almost identical, regarding the Chart category. The main differences are:
| |**Windows Forms**|**WPF**|**UWP**|
| - | :- | :- | :- |
|**Rendering options property**|RenderOptions|ChartRenderOptions|ChartRenderOptions|
|**Background fill property**|Background|ChartBackground|ChartBackground|
|**Fonts**|System.Drawing.Font|Arction.WPF. LightningChart.WPFFont|Arction.Uwp. ChartingMVVM.UwpFont|
|**Colors**|System.Drawing.Color|System.Windows.Media. Color|Windows.UI.Color|
### Namespaces
|**Chart edition**|**Assembly name**|**Namespace root**|**XML namespace**|
| - | :-: | :-: | :-: |
|*WPF (non-bindable)*|Arction.**Wpf.Charting**. LightningChart.dll|Arction.Wpf. Charting|xmlns:lcunb= "http://schemas.arction.com/ charting/ultimate/"|
|*WPF (bindable)*|Arction. **Wpf.ChartingMVVM**. LightningChart.dll|Arction.Wpf. ChartingMVVM|xmlns:lcusb= "http://schemas.arction.com/ ChartingMVVM/ultimate/"|
|*UWP*|Arction. **Uwp.ChartingMVVM**. LightningChart.dll|Arction.Uwp. ChartingMVVM|xmlns:lcu= "using:Arction.Uwp.ChartingMVVM”|
|*WinForms*|Arction. **WinForms.Charting**. LightningChart.dll|Arction.WinForms. Charting|N/A|
**Table. Assembly names and namespaces of LightningChart® .NET editions.**
UWP uses several namespaces in XML. The following are the most common ones:
```csharp
xmlns:lcu="using:Arction.Uwp.ChartingMVVM”
xmlns:viewxy="using:Arction.Uwp.ChartingMVVM.Views.ViewXY”
xmlns:axes="using:Arction.Uwp.ChartingMVVM.Axes”
xmlns:titles="using:Arction.Uwp.ChartingMVVM.Titles”
xmlns:seriesxy="using:Arction.Uwp.ChartingMVVM.SeriesXY”
```
When using other views than ViewXY, use the respective view and series names (View3D, ViewPolar etc.).
Example of using namespaces in UWP or ChartingMVVM:
```csharp
```
### Using LightningChart® .NET libraries
In order to use LightningChart® .NET components, Arction .dll -files have to be added to references. These can be found in the installation folder. The following assemblies are required when developing an application:
| | |
| :- | :- |
|Winforms: |Arction.WinForms.Charting.LightningChart.dll|
|WPF Non-bindable: |Arction.Wpf.Charting.LightningChart.dll Arction.DirectX.dll Arction.RenderingDefinitions.dll|
|WPF Bindable: |Arction.Wpf.ChartingMVVM.LightningChart.dll Arction.DirectX.dll Arction.RenderingDefinitions.dll|
|UWP Chart: |Arction.Uwp.ChartingMVVM.LightningChart.dll Arction.Uwp.RenderingDefinitions.dll Arction.Uwp.RenderingEngineBase.dll|
|If using SignalTools: |Arction.WinForms.SignalProcessing.SignalTools.dll **OR** Arction.Wpf.SignalProcessing.SignalTools.dll **OR** Arction.Uwp.SignalProcessing.SignalTools.dll|
:::tip[NOTE !]
If the above references are added, building the project will automatically copy all the required assemblies to the output folder. When deploying a LightningChart application, double check that all all the required assemblies copied to destination folder (see [Deployment](deployment.md)).
:::
Arction.DirectXFiles.dll is not automatically included as reference, as it is a large file which can increase the initialization time. It is only needed when there are no correct DirectX assemblies already in the system. Arction.DirectXInit.dll routines check the existing dlls and loads them when necessary. When loaded once, it writes the DirectX-dlls into Windows temp folder where LightningChart can access them in the future, thus making the initialization fast.
We recommend not to include Arction.DirectXFiles.dll as reference, instead, copy it next to your exe.
---
## Chart editions v11+
## Chart editions v11, v12
LightningChart® .NET SDK is an add-on to Microsoft Visual Studio, consisting of data visualization related software components and tool classes for WPF (***Windows Presentation Foundation***), UWP (***Universal Windows Platform***) and WinForms (***Windows Forms***) .NET platforms.
### Editions and performance
For WPF, LightningChart component is available in various binding level editions, to balance between different performance and MVVM (Model - View - ViewModel) bindability needs. UWP chart is based on the bindable WPF version, providing similar performance, binding and MVVM capabilities.

*Bindability and performance matrix*
* For best performance in WPF and multithreading benefits, select non-bindable chart.
* For good tradeoff between WPF bindability and performance, select bindable chart. Bindable also supports MVVM design pattern.
Different chart editions can be used in the same application. It's possible to create basic charts with bindable chart and bind various properties while using the non-bindable chart for performance-critical tasks. The collection properties of bindable charts (such as ViewXY axes, 3D lights) are empty by default which supports XAML editor in full. In Non-bindable and WinForms collections are prefilled with default items.
Per-data-point binding is supported only in fully-bindable WPF, which is available in the source code only.
:::tip[NOTE !]
Non-Bindable WPF chart is not intended to be configured in XAML at all. Use it in [code-behind](/docs/beginners%20guide/chart-in-code.md).
:::
### Differences between Windows forms, WPF and UWP
The property tree and object model between Windows Forms and WPF are almost identical, regarding the Chart category. The main differences are:
| |**Windows Forms**|**WPF**|**UWP**|
| - | :- | :- | :- |
|**Rendering options property**|RenderOptions|ChartRenderOptions|ChartRenderOptions|
|**Background fill property**|Background|ChartBackground|ChartBackground|
|**Fonts**|System.Drawing.Font|LightningChart.WPF. Charting.WpfFont|LightningChart.UWP. ChartingMVVM.UwpFont|
|**Colors**|System.Drawing.Color|System.Windows.Media. Color|Windows.UI.Color|
### Namespaces

*Table. Assembly names and namespaces of LightningChart® .NET editions.*
UWP uses several namespaces in XML. The following are the most common ones:
```csharp
xmlns:lcu="using:LightningChartLib.UWP.ChartingMVVM”
xmlns:viewxy=" using:LightningChartLib.UWP.ChartingMVVM.Views.ViewXY”
xmlns:axes=" using:LightningChartLib.UWP.ChartingMVVM.Axes”
xmlns:titles=" using:LightningChartLib.UWP.ChartingMVVM.Titles”
xmlns:seriesxy=" using:LightningChartLib.UWP.ChartingMVVM.SeriesXY”
```
When using other views than ViewXY, use the respective view and series names (View3D, ViewPolar etc.).
Example of using namespaces in UWP or ChartingMVVM:
```csharp
```
### Using LightningChart® .NET libraries
In order to use LightningChart® .NET components, LightningChart *.DLL -files have to be added to references. These can be found in the installation folder. The following assemblies are required when developing an application:
| | |
| :- | :- |
|Winforms: |LightningChart.WinForms.Charting.NET4.dll|
|WPF Non-bindable: |LightningChart.WPF.Charting.NET4.dll LightningChart.DirectX.dll|
|WPF Bindable: |LightningChart.WPF.ChartingMVVM.NET4.dll LightningChart.DirectX.dll|
|UWP Chart: |LightningChart.UWP.ChartingMVVM.dll|
|If using SignalTools: |LightningChart.WinForms.SignalTools.NET4.dll **OR** LightningChart.WPF.SignalTools.NET4.dll **OR** LightningChart.UWP.SignalTools.dll|
*When using .NET6 assemblies, NET4 is changed to NET6. Otherwise, the names are the same.*
:::tip[NOTE !]
If the above references are added, building the project will automatically copy all the required assemblies to the output folder. When deploying a LightningChart application, double check that all all the required assemblies copied to destination folder (see [Deployment](deploymentV11.md)).
:::
LightningChart.DirectXFilesNET.dll is not automatically included as reference, as it is a large file which can increase the initialization time. It is only needed when there are no correct DirectX assemblies already in the system. LightningChart.DirectXInitNET.dll routines check the existing dlls and loads them when necessary. When loaded once, it writes the DirectX-dlls into Windows temp folder where LightningChart can access them in the future, thus making the initialization fast.
We recommend not to include LightningChart.DirectXFilesNET.dll as reference, instead, copy it next to your exe.
---
## Definitions
### View and zooming area definitions
LightningChart views contain several various areas determined by the information they hold. The areas can be seen as two-dimensional rectangles based on the content of the view. These definitions are uniform regardless of the view type. They are used especially in zooming operations to determine which areas of the chart will be shown.
- **ChartArea/ViewArea**: The whole area including the chart and the margins.
- **MarginRectangle**: MarginRectangle (or MarginRect) includes the area inside the margins.
- **GraphArea**: The area defined by the axis ranges. Contains major and minor grids. The data is drawn in this area, unless some data values exceed the axis ranges.
- **Background area / circle**: Is mostly the same as the GraphArea. Contains also the parts of the graph outside the axis ranges and the grids.
- **LabelsArea**: The area consisting of the graph and the axis labels. Ignores the data.
- **Data**: The area containing only the data. Defined by the minimum and the maximum values of the data.
- **DataAndLabelsArea**: Data and LabelsArea combined. All data, axes, labels and markers are included.
- **Border**: A customizable, one-pixel wide rectangle, which indicates the location of the margins. Its visibility can be changed by disabling/enabling it.
- **Margins**: Margins are empty spaces around the graph area. Most of the contents of the view are fitted inside the margins and clipped outside them.
- **ZoomPadding**: The space left between the margins and another, pre-defined area after a zooming operation (see chapter 7.19.3). It has no effect in ViewXY.

*View3D and zooming area definitions*

*A quick overview of ViewXY*
- **Graph margins**: Margins are adjusted automatically by default by axis count and their settings. By setting ViewXY.***AxisLayout. AutoAdjustMargins = False***, ***Margins*** property applies, which allows the margin sizes to be set manually. Set all margins to 0 to make the graph fill the whole view area. See subchapter [Margins](/docs/inDetail/axis-layout-options.md) for further information.
- **Graph border**: A border is drawn around the graph area, in the location of margins. ***Border*** property can be used to change its color and visibility as well as to determine if it should be rendered behind the series. More about border in subchapter [Margins](/docs/inDetail/axis-layout-options.md).
- **Background**: Set the background fill with ***Background*** (***ChartBackground*** in WPF) property. There are plenty of filling options available. See [Setting background fill](/docs/inDetail/background-fill.md).
- **Graph background**: Set the graph background fill with ***GraphBackground*** property. Graph is the area where all grids, series, series cursors, event markers etc. are rendered. For example,
```csharp
chart.ViewXY.GraphBackground.Color = Colors.DarkBlue;
```
- **Title**: This is the main title for the chart. Set the text, shadow, color, text border, rotation, font, alignment etc. with ***Title.Text***, ***Title.Shadow***… properties. For example,
```csharp
chart.Title.Text = "Title text";
```
- **Y-axes**: The vertical axes representing Y values. See [Axis class](/docs/inDetail/axis-class-properties.md).
- **X-axis**: The horizontal axes representing X values. See [Axis class](/docs/inDetail/axis-class-properties.md).
- **Annotations**: Annotations allows displaying mouse-interactive text labels or graphics anywhere in the chart area. See [AnnotationXY](/docs/inDetail/annotation-XY.md).
- **Legend box**: Lists all the series of the chart. See [LegendBoxXY](/docs/inDetail/legend-box-properties.md).
- **Scrollbar**: A scrollbar having unsigned 64-bit value range, to support massive count of sample indices directly. In fact, ***HorizontalScrollBars*** and ***VerticalScrollBars*** are collection properties in the chart root level, but they are aware of ViewXY’s margins. See chapter 13.
- **AutoPadding**: From version 12.5 ViewXY has ***AutoPadding*** property. This is padding for control's edges in PXs. This is outer edge or rim of the chart, which encloses ViewXY [Margins](/docs/inDetail/axis-layout-options.md). See page [AutoPadding](/docs/inDetail/auto-padding.md) for details.
:::info
Chapter references to be updated soon.
:::
---
## Exploring Examples
Interactive Examples is the demo application for LightningChart® .NET, its shortcut appears in Start menu / *LightningChart .NET SDK*. It can also be run from [Dev Center](/docs/getting%20started/dev-center.md).
There are more than 200 examples, which could be very helpful while you are learning how to use library or just searching for the idea of implementation/functionality. The overview of demo usage can be found on this [page](/docs/getting%20started/RunningDemo.md).

**Main features of Interactive Examples App are:**
- interactivity: not only zooming/panning/tracking, but also data point (or series) count can be changed;
- source code of example extractable as standalone application;
- examples could be search by keywords (from list of Tags or text in the description);
- Properties Editor to modify Chart's public properties on-fly;
- exporting of chart-image to file or clipboard, printing with preview or export chart as XML file;
- 2D transformation of chart (flip, rotate);
- color theme change on-fly;
- list of Favorite examples could be created, exported and shared;
- user can start email with question or feedback about specific example directly from app.
:::tip
The overview of demo usage can be found on this [page](/docs/getting%20started/RunningDemo.md).
:::
---
## Deployment v10
Deployment or distribution of LightningChart assemblies.
### Referenced assemblies
Deliver LightningChart .dll -files with the executable folder, next to the executable folder, with Global assembly cache, or with another folder where .NET assembly resolving system can find them. LightningChart also supports ***ClickOnce*** deployment.
**WinForms:**
- Arction.WinForms.Charting.LightningChart.dll
- Arction.Licensing.dll
- Arction.DirectX.dll
- Arction.RenderingDefinitions.dll
- Arction.RenderingEngine.dll
- Arction.RenderingEngine9.dll
- Arction.RenderingEngine11.dll
- Arction.DirectXInit.dll
- Arction.DirectXFiles.dll
If using SignalTools
- Arction.WinForms.SignalProcessing.SignalTools.dll
- Arction.MathCore.dll
**WPF:**
- Arction.Wpf.Charting.LightningChart.dll (for Non-bindable WPF chart)
- Arction.Wpf.ChartingMVVM.LightningChart.dll (for Bindable WPF chart)
- Arction.Licensing.dll
- Arction.DirectX.dll
- Arction.RenderingDefinitions.dll
- Arction.RenderingEngine.dll
- Arction.RenderingEngine9.dll
- Arction.RenderingEngine11.dll
- Arction.DirectXInit.dll
- Arction.DirectXFiles.dll
If using SignalTools
- Arction.Wpf.SignalProcessing.SignalTools.dll
- Arction.MathCore.dll
**UWP:**
- Arction.Uwp.ChartingMVVM.LightningChart.dll
- Arction.Uwp.RenderingDefinitions.dll
- Arction.Uwp.RenderingEngine.dll
- Arction.Uwp.RenderingEngineBase.dll
- Arction.Uwp.Licensing.dll
- SharpDX.D3DCompiler.dll
- SharpDX.Direct2D1.dll
- SharpDX.Direct3D11.dll
- SharpDX.dll
- SharpDX.DXGI.dll
- SharpDX.Mathematics.dll
- UwpAttributes.dll
### License key
Remember to use static ***SetDeploymentKey*** method for all components. Otherwise the chart enters in trial mode and works only for 30 days, with a trial nag on it.
#### Extracting Deployment Key
To be able to run LightningChart applications in computers the software is deployed into, a Deployment Key has to be applied in code. Deployment Key can be extracted from a license key by pressing ***Copy deployment key to Clipboard*** button in License Manager.

*Copying the deployment key to clipboard in License Manager*
#### Applying Deployment Key in an application
In code, use static ***SetDeploymentKey*** methods for the wanted components. There is no need to set the key for the components that are not used (i.e. setting key for bindable charts in a non-bindable application). Call the ***SetDeploymentKey*** methods somewhere before the components need to be used. The best place to call it would be static constructor of the class using the chart, or in the application’s main class.
##### WinForms
Here’s an example how to apply the key at the static constructor method of the Program class that is created by default for every WinForms application.
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
static class Program
{
static Program()
{
//Set Deployment Key for LightningChart components
string deploymentKey = "VMalgCAAO6kO1RgiNIBJABVcG.R..Kikfd...";
Arction.WinForms.Charting.LightningChart.SetDeploymentKey(deploymentKey);
Arction.WinForms.SignalProcessing.SignalGenerator.SetDeploymentKey(deploymentKey);
Arction.WinForms.SignalProcessing.AudioInput.SetDeploymentKey(deploymentKey);
Arction.WinForms.SignalProcessing.AudioOutput.SetDeploymentKey(deploymentKey);
Arction.WinForms.SignalProcessing.SpectrumCalculator.SetDeploymentKey(deploymentKey);
Arction.WinForms.SignalProcessing.SignalReader.SetDeploymentKey(deploymentKey);
Arction.WinForms.SignalProcessing.FilterRoutines.SetDeploymentKey(deploymentKey);
Arction.CustomControls.Trader.WinForms.TradingChart.SetDeploymentKey(deploymentKey);
}
// Rest of the class ...
}
}
```
##### WPF
Here’s an example how to apply the key in the beginning of *App.xaml.cs*, at the static constructor of the App class.
```csharp
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using Arction.Wpf.SignalProcessing;
namespace WpfApplication1
{
///
/// Interaction logic for App.xaml
///
public partial class App : Application
{
static App()
{
// Set Deployment Key for LightningChart components
string deploymentKey = "- DEPLOYMENT KEY FROM LICENSE MANAGER
GOES HERE-";
// Setting Deployment Key for bindable chart
Arction.Wpf.ChartingMVVM.LightningChart
.SetDeploymentKey(deploymentKey);
// Setting Deployment Key for non-bindable chart
Arction.Wpf.Charting.LightningChart
.SetDeploymentKey(deploymentKey);
// Setting of deployment key to other LightningChart components
SignalGenerator.SetDeploymentKey(deploymentKey);
AudioInput.SetDeploymentKey(deploymentKey);
AudioOutput.SetDeploymentKey(deploymentKey);
SpectrumCalculator.SetDeploymentKey(deploymentKey);
SignalReader.SetDeploymentKey(deploymentKey);
FilterRoutines.SetDeploymentKey(deploymentKey);
// Setting Deployment Key for trading chart
Arction.CustomControls.Trader.WPF.TradingChart
.SetDeploymentKey(deploymentKey);
}
}
}
```
In UWP application, it is possible to use either developer key or deployment key, but not both together. Use developer key when developing and debugging the app and deployment key when deploying it.
:::tip[Note !]
Without setting Deployment Key in the application, LightningChart enters into 30 days trial mode in the target machine (applies to computers where a Development license key hasn’t been installed).
:::
#### Running with Deployment Key on development computer
When running an application, in which a deployment key has been applied with ***SetDeploymentKey***, on a computer where a development license has been installed to, the **library prioritizes the development license key**. It might lead into user or debugging confusion when deployment key has higher level of features included (e.g. Gold pack) than locally installed license (e.g. Silver pack). Developers must be aware of this limitation.
:::tip
***LightningChart Ltd. recommends all licenses to be of same type within the whole team.***
:::
#### Running with debugger
With Deployment Key set correctly, when running the project from Visual Studio with debugger attached, and no development license key is found from the system, the chart enters slow rendering mode, max FPS is ~1, and the chart shows message text over the chart.
:::danger[Important !]
*Direct developing and debugging with LightningChart without developer license key, is forbidden by LightningChart EULA.*
:::
### Obfuscating application code
It is **mandatory** to obfuscate the application code, so that LightningChart license keys are not visible to .NET disassembler tools. Leaking license keys may lead into license termination, legal actions and claim of damage.
### XML files of LightningChart assemblies
**Deployment of these XML files is forbidden.**
- Arction.WinForms.Charting.LightningChart.xml
- Arction.Wpf.BindableCharting.LightningChart.xml
- Arction.Wpf.Charting.LightningChart.xml
- Arction.Wpf.ChartingMVVM.LightningChart.xml
- Arction.Wpf.SignalProcessing.SignalTools.xml
- Arction.WinForms.SignalProcessing.SignalTools.xml
The files provided by LightningChart Ltd. are only for helping with the application development. They are used mainly to show code parameters and property tips. When rebuilding LightningChart assemblies from source code, ensure the XML files mentioned above are not deployed. **Distributing them is strictly forbidden**, as they will reveal too much info for .NET disassembler and reverse-engineering applications.
---
## Deployment v11 to v12.5
Deployment or distribution of LightningChart assemblies.
### Referenced assemblies
Deliver LightningChart .dll -files with the executable folder, next to the executable folder, with Global assembly cache, or with another folder where .NET assembly resolving system can find them. LightningChart also supports ***ClickOnce*** deployment.
**WinForms:**
- LightningChart.WinForms.Charting.NET4.dll **(in .NET Framework projects)**
- LightningChart.WinForms.Charting.NET6/NET8.dll **(in .NET6+ projects)**
- LightningChart.DirectX.dll
- LightningChart.DirectXInitNET.dll
- LightningChart.DirectXFilesNET.dll
If using SignalTools
- LightningChart.WinForms.SignalTools.NET4.dll **(in .NET Framework projects)**
- LightningChart.WinForms.SignalTools.NET6/NET8.dll **(in .NET6+ projects)**
- LightningChart.MathCore.dll
**WPF:**
- LightningChart.WPF.Charting.NET4.dll **(for Non-bindable WPF chart, .NET Framework)**
- LightningChart.WPF.Charting.NET6/NET8.dll **(for Non-bindable WPF chart, .NET6+)**
- LightningChart.WPF.ChartingMVVM.NET4.dll **(for Bindable WPF chart, .NET Framework)**
- LightningChart.WPF.ChartingMVVM.NET6/NET8.dll **(for Bindable WPF chart, .NET6+)**
- LightningChart.DirectX.dll
- LightningChart.DirectXInitNET.dll
- LightningChart.DirectXFilesNET.dll
If using SignalTools
- LightningChart.WPF.SignalTools.NET4.dll **(in .NET Framework projects)**
- LightningChart.WPF.SignalTools.NET6/NET8.dll **(in .NET6+ projects)**
- LightningChart.MathCore.dll
**UWP:**
- LightningChart.UWP.ChartingMVVM.dll
- LightningChart.UWP.Attributes.dll
- SharpDX.D3DCompiler.dll
- SharpDX.Direct2D1.dll
- SharpDX.Direct3D11.dll
- SharpDX.dll
- SharpDX.DXGI.dll
- SharpDX.Mathematics.dll
### License key
Remember to use static ***SetDeploymentKey*** method for all components. Otherwise the chart enters in trial mode and works only for 30 days, with a trial nag on it.
#### Extracting Deployment Key
To be able to run LightningChart applications in computers the software is deployed into, a Deployment Key has to be applied in code. Deployment Key can be extracted from a license key by pressing ***Copy deployment key to Clipboard*** button in License Manager.

*Copying the deployment key to clipboard in License Manager*
#### Applying Deployment Key in an application
In code, use static ***SetDeploymentKey*** methods for the wanted components. There is no need to set the key for the components that are not used (i.e. setting key for bindable charts in a non-bindable application). Call the ***SetDeploymentKey*** methods somewhere before the components need to be used. The best place to call it would be static constructor of the class using the chart, or in the application’s main class.
##### WinForms
Here’s an example how to apply the key at the static constructor method of the Program class that is created by default for every WinForms application.
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
static class Program
{
static Program()
{
//Set Deployment Key for LightningChart components
string deploymentKey = "DEPLOYMENT KEY FROM LICENSE MANAGER GOES HERE";
LightningChartLib.WinForms.Charting.LightningChart.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.SignalGenerator.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.AudioInput.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.AudioOutput.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.SpectrumCalculator.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.SignalReader.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.FilterRoutines.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.Trader.TradingChart.SetDeploymentKey(deploymentKey);
}
// Rest of the class ...
}
}
```
##### WPF
Here’s an example how to apply the key in the beginning of *App.xaml.cs*, at the static constructor of the App class.
```csharp
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using LightningChartLib.WPF.SignalProcessing;
namespace WpfApplication1
{
///
/// Interaction logic for App.xaml
///
public partial class App : Application
{
static App()
{
// Set Deployment Key for LightningChart components
string deploymentKey = "DEPLOYMENT KEY FROM LICENSE MANAGER GOES HERE";
// Setting Deployment Key for non-bindable chart
LightningChartLib.WPF.Charting.LightningChart
.SetDeploymentKey(deploymentKey);
// Setting Deployment Key for bindable chart
LightningChartLib.WPF.ChartingMVVM.LightningChart
.SetDeploymentKey(deploymentKey);
// Setting of deployment key to other LightningChart components
SignalGenerator.SetDeploymentKey(deploymentKey);
AudioInput.SetDeploymentKey(deploymentKey);
AudioOutput.SetDeploymentKey(deploymentKey);
SpectrumCalculator.SetDeploymentKey(deploymentKey);
SignalReader.SetDeploymentKey(deploymentKey);
FilterRoutines.SetDeploymentKey(deploymentKey);
// Setting Deployment Key for trading chart
LightningChartLib.WPF.Trader.TradingChart
.SetDeploymentKey(deploymentKey);
}
}
}
```
In UWP application, it is possible to use either developer key or deployment key, but not both together. Use developer key when developing and debugging the app and deployment key when deploying it.
:::tip[Note !]
Without setting Deployment Key in the application, LightningChart enters into 30 days trial mode in the target machine (applies to computers where a Development license key hasn’t been installed).
:::
#### Running with Deployment Key on development computer
When running an application, in which a deployment key has been applied with ***SetDeploymentKey***, on a computer where a development license has been installed to, the **library prioritizes the development license key**. It might lead into user or debugging confusion when deployment key has higher level of features included (e.g. Gold pack) than locally installed license (e.g. Silver pack). Developers must be aware of this limitation.
:::tip
***LightningChart Ltd. recommends all licenses to be of same type within the whole team.***
:::
#### Running with debugger
With Deployment Key set correctly, when running the project from Visual Studio with debugger attached, and no development license key is found from the system, the chart enters slow rendering mode, max FPS is ~1, and the chart shows message text over the chart.
:::danger[Important !]
*Direct developing and debugging with LightningChart without developer license key, is forbidden by LightningChart EULA.*
:::
### Obfuscating application code
It is **mandatory** to obfuscate the application code, so that LightningChart license keys are not visible to .NET disassembler tools. Leaking license keys may lead into license termination, legal actions and claim of damage.
### XML files of LightningChart assemblies
**Deployment of these XML files is forbidden.**
- LightningChart.WinForms.Charting.NET4.xml
- LightningChart.WinForms.Charting.NET6.xml
- LightningChart.WPF.Charting.NET4.xml
- LightningChart.WPF.Charting.NET6.xml
- LightningChart.WPF.ChartingMVVM.NET4.xml
- LightningChart.WPF.ChartingMVVM.NET6.xml
- LightningChart.WPF.SignalTools.NET4.xml
- LightningChart.WPF.SignalTools.NET6.xml
- LightningChart.WinForms.SignalTools.NET4.xml
- LightningChart.WinForms.SignalTools.NET6.xml
The files provided by LightningChart Ltd. are only for helping with the application development. They are used mainly to show code parameters and property tips. When rebuilding LightningChart assemblies from source code, ensure the XML files mentioned above are not deployed. **Distributing them is strictly forbidden**, as they will reveal too much info for .NET disassembler and reverse-engineering applications.
---
## Deployment v12.6 and above
Deployment or distribution of LightningChart assemblies.
### Referenced assemblies
Deliver LightningChart .dll -files with the executable folder, next to the executable folder, with Global assembly cache, or with another folder where .NET assembly resolving system can find them. LightningChart also supports ***ClickOnce*** deployment.
**WinForms:**
- LightningChart.WinForms.Charting.NET4.dll **(in .NET Framework projects)**
- LightningChart.WinForms.Charting.NET10.dll **(in .NET10 projects)**
- LightningChart.DirectX.dll
- LightningChart.DirectXInitNET.dll
- LightningChart.DirectXFilesNET.dll
If using SignalTools
- LightningChart.WinForms.SignalTools.NET4.dll **(in .NET Framework projects)**
- LightningChart.WinForms.SignalTools.NET10.dll **(in .NET10 projects)**
- LightningChart.MathCore.dll
**WPF:**
- LightningChart.WPF.Charting.NET4.dll **(for Non-bindable WPF chart, .NET Framework)**
- LightningChart.WPF.Charting.NET10.dll **(for Non-bindable WPF chart, .NET10)**
- LightningChart.WPF.ChartingMVVM.NET4.dll **(for Bindable WPF chart, .NET Framework)**
- LightningChart.WPF.ChartingMVVM.NET10.dll **(for Bindable WPF chart, .NET10)**
- LightningChart.DirectX.dll
- LightningChart.DirectXInitNET.dll
- LightningChart.DirectXFilesNET.dll
If using SignalTools
- LightningChart.WPF.SignalTools.NET4.dll **(in .NET Framework projects)**
- LightningChart.WPF.SignalTools.NET10.dll **(in .NET10 projects)**
- LightningChart.MathCore.dll
**UWP:**
- LightningChart.UWP.ChartingMVVM.dll
- LightningChart.UWP.Attributes.dll
- SharpDX.D3DCompiler.dll
- SharpDX.Direct2D1.dll
- SharpDX.Direct3D11.dll
- SharpDX.dll
- SharpDX.DXGI.dll
- SharpDX.Mathematics.dll
### License key
Remember to use static ***SetDeploymentKey*** method for all components. Otherwise the chart enters in trial mode and works only for 30 days, with a trial nag on it.
#### Extracting Deployment Key
To be able to run LightningChart applications in computers the software is deployed into, a Deployment Key has to be applied in code. Deployment Key can be extracted from a license key by pressing ***Copy deployment key to Clipboard*** button in License Manager.

*Copying the deployment key to clipboard in License Manager*
#### Applying Deployment Key in an application
In code, use static ***SetDeploymentKey*** methods for the wanted components. There is no need to set the key for the components that are not used (i.e. setting key for bindable charts in a non-bindable application). Call the ***SetDeploymentKey*** methods somewhere before the components need to be used. The best place to call it would be static constructor of the class using the chart, or in the application’s main class.
##### WinForms
Here’s an example how to apply the key at the static constructor method of the Program class that is created by default for every WinForms application.
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
static class Program
{
static Program()
{
//Set Deployment Key for LightningChart components
string deploymentKey = "DEPLOYMENT KEY FROM LICENSE MANAGER GOES HERE";
LightningChartLib.WinForms.Charting.LightningChart.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.SignalGenerator.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.AudioInput.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.AudioOutput.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.SpectrumCalculator.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.SignalReader.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.SignalProcessing.FilterRoutines.SetDeploymentKey(deploymentKey);
LightningChartLib.WinForms.Trader.TradingChart.SetDeploymentKey(deploymentKey);
}
// Rest of the class ...
}
}
```
##### WPF
Here’s an example how to apply the key in the beginning of *App.xaml.cs*, at the static constructor of the App class.
```csharp
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using LightningChartLib.WPF.SignalProcessing;
namespace WpfApplication1
{
///
/// Interaction logic for App.xaml
///
public partial class App : Application
{
static App()
{
// Set Deployment Key for LightningChart components
string deploymentKey = "DEPLOYMENT KEY FROM LICENSE MANAGER GOES HERE";
// Setting Deployment Key for non-bindable chart
LightningChartLib.WPF.Charting.LightningChart
.SetDeploymentKey(deploymentKey);
// Setting Deployment Key for bindable chart
LightningChartLib.WPF.ChartingMVVM.LightningChart
.SetDeploymentKey(deploymentKey);
// Setting of deployment key to other LightningChart components
SignalGenerator.SetDeploymentKey(deploymentKey);
AudioInput.SetDeploymentKey(deploymentKey);
AudioOutput.SetDeploymentKey(deploymentKey);
SpectrumCalculator.SetDeploymentKey(deploymentKey);
SignalReader.SetDeploymentKey(deploymentKey);
FilterRoutines.SetDeploymentKey(deploymentKey);
// Setting Deployment Key for trading chart
LightningChartLib.WPF.Trader.TradingChart
.SetDeploymentKey(deploymentKey);
}
}
}
```
In UWP application, it is possible to use either developer key or deployment key, but not both together. Use developer key when developing and debugging the app and deployment key when deploying it.
:::tip[Note !]
Without setting Deployment Key in the application, LightningChart enters into 30 days trial mode in the target machine (applies to computers where a Development license key hasn’t been installed).
:::
#### Running with Deployment Key on development computer
When running an application, in which a deployment key has been applied with ***SetDeploymentKey***, on a computer where a development license has been installed to, the **library prioritizes the development license key**. It might lead into user or debugging confusion when deployment key has higher level of features included (e.g. Gold pack) than locally installed license (e.g. Silver pack). Developers must be aware of this limitation.
:::tip
***LightningChart Ltd. recommends all licenses to be of same type within the whole team.***
:::
#### Running with debugger
With Deployment Key set correctly, when running the project from Visual Studio with debugger attached, and no development license key is found from the system, the chart enters slow rendering mode, max FPS is ~1, and the chart shows message text over the chart.
:::danger[Important !]
*Direct developing and debugging with LightningChart without developer license key, is forbidden by LightningChart EULA.*
:::
### Obfuscating application code
It is **mandatory** to obfuscate the application code, so that LightningChart license keys are not visible to .NET disassembler tools. Leaking license keys may lead into license termination, legal actions and claim of damage.
### XML files of LightningChart assemblies
**Deployment of these XML files is forbidden.**
- LightningChart.WinForms.Charting.NET4.xml
- LightningChart.WinForms.Charting.NET10.xml
- LightningChart.WPF.Charting.NET4.xml
- LightningChart.WPF.Charting.NET10.xml
- LightningChart.WPF.ChartingMVVM.NET4.xml
- LightningChart.WPF.ChartingMVVM.NET10.xml
- LightningChart.WPF.SignalTools.NET4.xml
- LightningChart.WPF.SignalTools.NET10.xml
- LightningChart.WinForms.SignalTools.NET4.xml
- LightningChart.WinForms.SignalTools.NET10.xml
The files provided by LightningChart Ltd. are only for helping with the application development. They are used mainly to show code parameters and property tips. When rebuilding LightningChart assemblies from source code, ensure the XML files mentioned above are not deployed. **Distributing them is strictly forbidden**, as they will reveal too much info for .NET disassembler and reverse-engineering applications.
---
## Object model
The best way to learn the object model of LightningChart is by using Properties editor of Interactive Examples App / Demo. Just [open Demo](/docs/getting%20started/RunningDemo.md), select example and open Property Editor for the selected chart.

*Object Model of LightningChart. Editing AnnotationXY properties on-fly.*
### Property Editor for standalone application
During software development it maybe handy to have access to property while application is running. Users can create similar property editor like one described above for LightningChart Demo in own standalone application.
For **WinForms** application user can simple add method call in the source code:
```csharp
chart.ShowPropertiesEditor();
```
For **WPF** application to create the grid of properties user can use [Extended WPF Toolkit™](https://github.com/xceedsoftware/wpftoolkit).
---
## Views and other objects
Besides [Series](https://lightningchart.com/net-charts/docs/category/views-and-series/), which contains data to be visualized, each View can have other objects suitable for various purposes.
### Annotations
Annotations allows displaying mouse-interactive text labels or graphics anywhere in the chart area. Annotations can be moved around by mouse, resized, rotated, their target and location can be changed etc. Alternatively, they can be controlled by code. Annotations are great also when custom graphics must be rendered on the screen, as they can be rendered in different styles and shapes.

*AnnotationXY objects with various styles, placed around a line series.*
More about View specific Annotation properties can be found at [AnnotationXY](/docs/inDetail/annotation-XY.md), [Annotation3D](/docs/inDetail/annotation-3D.md), [AnnotationPolar](/docs/inDetail/annotation-polar.md) and [AnnotationSmith](/docs/inDetail/annotation-smith.md).
### Geographic maps (in ViewXY)
[Geographic maps](/docs/inDetail/geographic-maps.md) is property of ViewXY. However, data can be extracted from map-files and used in our Views (as demonstrated in 3D *ExamplePopulationPolygons3D* from our [Demo](/docs/getting%20started/RunningDemo.md)).
### EventMarkers
***EventMarkers*** allow marking a point of interest, where something special occurred during real-time monitoring, or if just wanting to mark a piece of data with a special annotation. Define the marker symbol with ***Symbol*** property and a text label with ***Label*** property.
More about View specific EventMarkers properties can be found at [EventMarkers XY](/docs/inDetail/event-markers-XY.md), [Polar Markers](/docs/inDetail/event-markers-polar.md) and [Smith Markers](/docs/inDetail/event-markers-smith.md).
### Image Layer (in ViewXY)
[***ImageLayer***](/docs/inDetail/image-layer.md) is a very large image layer, which can be gradually filled with smaller images. The accumulation of smaller images is done in a background thread, thus keeping chart’s UI thread responsive and fast (for example zooming could be done while images are loaded).
### Data cursors (DataCursor)
Starting from version 10.4, ViewXY has a built-in data cursor, which automatically tracks the closest series value to the mouse cursor and shows it in a result table. More about [DataCursor in ViewXY](/docs/inDetail/data-cursors.md).
### LegendBox
Legend boxes can show Series' title, icon representing series drawing style and checkbox to toggle Series visibility. The biggest list of properties has [Legend boxes in ViewXY](/docs/inDetail/legend-box-properties.md).
### Band (in ViewXY)
[***Band***](/docs/inDetail/bands.md) can be considered as a series. A band is a vertical or horizontal area reaching from a margin across to another.
### ConstantLine (in ViewXY)
[***ConstantLine***](/docs/inDetail/constant-lines.md) can be considered as a series. ***ConstantLine*** is bound to Y axis, and it represents one horizontal line, ranging from graph left edge to right edge.
### Scrollbars (in ViewXY)
One or more scrollbars can be added via ***HorizontalScrollBars*** or ***VerticalScrollbars*** collection property. The appearance is fully customizable, allowing defining even oval shaped buttons and scroll box. For example, a bitmap can be used as a button icon. Scrollbars can be used with all views, but the most apparent usage is in ViewXY.
### Sectors (in ViewPolar)
***Sector*** can be defined to indicate some angular or amplitude range. Define amplitude range with ***MinAmplitude*** and ***MaxAmplitude*** properties. Define angular range with ***BeginAngle*** and ***EndAngle***. Move a sector by dragging it with mouse.

*Two examples utilizing sectors. The first figure, Wind Rose diagram, is made with several sectors of different colors. In the second figure, a dial is made with AreaSeries with a sector representing RPM meter red zone.*
---
## View3D
***View3D*** allows visualizing data in 3D space. 3D model can be zoomed, rotated and lit up with various ways. Different series types can be placed into the same 3D view to make a combined visualization.
### PointLineSeries3D
***PointLineSeries3D*** allows presenting points and line in 3D space. For points, there are many basic 3D shapes available. Points are connected together with a line, if ***LineVisible*** property is set ***true***.

***PointLineSeries3D*** supports three different point formats:
- Points property (SeriesPoint3D array)
- PointsCompact property (SeriesPointCompact3D array)
- PointsCompactColored property (SeriesPointCompactColored3D array)
***PointsCompact*** and ***PointsCompactColored*** structures are very memory efficient, allowing up to 100 million data points visualization with simple point styles. Set the point format via ***PointsType*** property.
:::tip
More details about ***PointLineSeries3D*** could be found on [this page](/docs/inDetail/PointLineSeries3D.md).
:::
### SurfaceGridSeries3D
***SurfaceGridSeries3D*** allows visualizing data as a 3D surface. In ***SurfaceGridSeries3D***, nodes are equally spaced in X dimension, and in Z dimension as well.


*Surface grid nodes. SizeX = 5, SizeZ = 7.*
:::tip
More details about ***SurfaceGridSeries3D*** could be found on [this page](/docs/inDetail/SurfaceGridSeries3D.md).
:::
### SurfaceMeshSeries3D
***SurfaceMeshSeries3D*** is almost similar to ***SurfaceGridSeries3D*** as they both mostly have the same properties. The biggest difference is that surface nodes can be positioned freely in 3D space. In other words, the surface does not have to be rectangular. ***SurfaceMeshSeries3D*** allows warping the surface virtually to any shape, for example to a sphere or a human head.


*Surface grid nodes. SizeX = 4, SizeZ = 4.*
:::tip
More details about ***SurfaceMeshSeries3D*** could be found on [this page](/docs/inDetail/SurfaceMeshSeries3D.md).
:::
### WaterfallSeries3D
With ***WaterfallSeries3D***, the data is visualized in area strips. Areas can be filled, wire-framed and contour-lined like ***SurfaceGridSeries3D***. In Y-dimension, area starts from ***BaseLevel*** property value. The node data can be set like in ***SurfaceMeshSeries3D***. ***WaterfallSeries3D*** is especially handy for presenting traditional 3D spectrum.

:::tip
More details about ***WaterfallSeries3D*** could be found on [this page](/docs/inDetail/WaterfallSeries3D.md).
:::
### BarSeries3D
***BarSeries3D*** allows bar data visualization in 3D. Bar series can be grouped with many options available in ***BarViewOptions*** property of View3D. ***BarViewOptions.ViewGrouping*** controls how the bars are grouped in the 3D view. Bars are drawn in Y axis direction. To show the bars vertically, rotate the camera 90 degrees.

:::tip
More details about ***BarSeries3D*** could be found on [this page](/docs/inDetail/BarSeries3D.md).
:::
### MeshModels
***MeshModels*** list property allows inserting 3D models from external 3D model editors into LightningChart View3D. The models can be imported in OBJ format, which is a generic format in 3D modeling applications and game engines.
A ***MeshModel*** object ***Position*** follows the X, Y and Z axes it has been assigned to. The model can be rotated by editing ***Rotation*** property. Size can be defined with ***Size*** property, which is a collection of factors for original model size and does not follow axis ranges or 3D world dimensions.

Starting from v.8.2, ***MeshModel*** supports constructing the ***MeshModel*** geometry programmatically. It allows visualizing objects and shapes that have been produced via computation.
The following ***Create*** methods are available:
- *Create(positions, colors, indices)*
- *Create(positions, colors, normals, indices)*
- *Create(positions, textureCoordinates, bitmap, textureWrapMode, indices)*
- *Create(positions, normals, textureCoordinates, bitmap, textureWrapMode, indices)*

:::tip
More details about ***MeshModel*** could be found on [this page](/docs/inDetail/MeshModel.md).
:::
### VolumeModels
***VolumeModels*** is a tool for volume data visualization via Direct Volume Rendering. ***VolumeModel*** takes the volume data inside and visualizes it. LightningChart’s volume rendering engine is based on the *Volume Ray Casting*.
An image is produced by the algorithm via the volume data sampling along the tracks of the rays which travel inside the dataset. A simple realization of hardware acceleration for *Volume Ray Casting* requires generating boundaries for a volume object. Usually, they are represented by a cube. High rendering quality without artefact, and usage of the interchangeable ray function are the main advantages of this technology.
:::danger[Note]
VolumeModels are available only when DirectX 11 renderer is used.
:::
 
:::tip
More details about ***VolumeModel*** could be found on [this page](/docs/inDetail/VolumeModel.md).
:::
### Rectangle3D
***Rectangle3D*** allows presenting a rectangle, turned to any angle, at any size, at any location. They can be added to ***View3D.Rectangles*** list. Rectangles can also act as planes by defining their size according to ***View3D.Dimensions***.
Set ***Size*** in 3D world dimensions (not X, Y or Z axis values) as ***Width*** and ***Height***. Set the center point via ***Center*** property, defined in X, Y and Z axis values. ***Rotation*** property specifies the rotation in degrees.
Fill settings can be modified via ***Fill*** property. Solid color and bitmap fills are available. To use bitmap fill, set the bitmap in ***Image***, and enable ***UseImage***.

:::tip
More details about ***Rectangle3D*** could be found on [this page](/docs/inDetail/Rectangle3D.md).
:::
### Polygon3D
***Polygon3D*** objects allow presenting a 2D polygon stretched to given Y range. They can be added to ***View3D.Polygons*** list.
Define the polygon path in X and Z axis values and store it in ***Points*** array. Set the Y range with ***YMin*** and ***YMax*** values.
***Material.Diffuse*** controls the main color of the rectangle. Rotate the polygon to another angle with ***Rotation.X***, ***Rotation.Y*** and ***Rotation.Z*** in degrees.

:::tip
More details about ***Polygon3D*** could be found on [this page](/docs/inDetail/Polygon3D.md).
:::
---
## ViewPie3D
***ViewPie3D*** presents data as pie and donut charts, in 3D.
### Pie slices
Pie chart data is stored in ***Values*** collection. Each item in the list is of type ***PieSlice***. Edit the data value with ***Value*** property. Set title string into ***Title.Text*** property. By defining ***TitleAlignment*** = *Outside*, the title is drawn outside the pie.

*Example of a 3D Pie chart and a Donut chart*
:::tip
More details about ***ViewPie3D*** could be found on [this page](/docs/inDetail/ViewPie3D.md).
:::
---
## ViewPolar
***ViewPolar*** allows data visualization in a polar format. The data point position is determined by angular value and amplitude (compare angle as X and amplitude as Y in ViewXY). Polar view also has zooming and panning features.
### PointLineSeriesPolar
ViewPolar’s ***PointLineSeriesPolar*** can be used to draw a line, a group of points or a point-line. Lots of line and point styles are available in ***LineStyle*** and ***PointStyle*** properties.

*Some data presented with ViewPolar’s PointLineSeries. Line and points are both visible.*
:::tip
More details about ***PointLineSeriesPolar*** could be found on [this page](/docs/inDetail/PointLineSeriesPolar.md).
:::
### AreaSeries
***AreaSeries*** allow data visualization in filled area style. The line style in the edge can be edited with LineStyle property. Fill can be changed with FillColor property.

*Some data presented with ViewPolar’s AreaSeries.*
:::tip
More details about ***AreaSeriesPolar*** could be found on [this page](/docs/inDetail/AreaSeriesPolar.md).
:::
### Intensity Grid
***IntensityGridSeriesPolar*** (polar heatmap) is like intensity grid series in XY chart. It allows visualizing M x N array of nodes, colored by assigned value-range palette. The colors between nodes are interpolated. ***IntensityGridSeriesPolar*** is evenly spaced in Polar space. The data is stored in ***Data*** property as two-dimensional array of doubles [Angle, Amplitude].

*IntensityGridSeriesPolar. BeginAngle and EndAngle are used to define the angle range.*
:::tip
More details about ***IntensityGridSeriesPolar*** could be found on [this page](/docs/inDetail/intensity-grid-polar.md).
:::
---
## ViewSmith
Smith charts are generally used in electronics in impedance measurements and impedance matching applications.
Smith chart plots the data in real and imaginary values **(R + jX)**.
:::info
Read more about the theory behind Smith charts in [following blog](https://lightningchart.com/blog/smith-chart/).
:::
### PointLineSeries
ViewSmith’s ***PointLineSeries*** can be used to draw a line, a group of points or a point-line as in ViewPolar. Lots of line and point styles are available in ***LineStyle*** and ***PointStyle*** properties.

*Smith data series.*
:::tip
More details about ***PointLineSeriesSmith*** could be found on [this page](/docs/inDetail/PointLineSeriesSmith.md).
:::
:::info
For Step-by-step tutorial how to create your own Smith Chart application with LightningChart .NET library check [following link](/docs/tutorials/smith-chart.md).
:::
---
## ViewXY
XY charts (***ViewXY***) allow two-dimensional data visualization in different ways and formats. All series are bound to axis value ranges.
There are 10 series, which could be considered as 'line-series'. Which one is best for your application depends on required features. The crosstable of 'line-series' and supported features could be found [below](#Which-line-series-should-be-used).
Series have ***AssignXAxisIndex*** and ***AssignYAxisIndex*** property for assigning the X and Y axis. In code, assign the X and Y axis with series constructor parameter, alternatively.
:::tip
If Axis is deleted/disposed, then Series assigned to that axis needs reassigned. When axis disposed, chart automatically (internally) may set series ***AssignXAxisIndex*** and ***AssignYAxisIndex*** properties to 0 or -1.
:::
### SampleDataBlockSeries
***SampleDataBlockSeries*** is a version of ***SampleDataSeries***, fully optimized for real-time/streaming applications. It offers the best possible performance with least CPU and memory consumption, allowing rendering extremely high number of data points simultaneously. As the name of the series suggests, the data is internally managed as blocks, which in turn are individually memory-managed. This removes the need for extremely large continuous linear memory. ***SampleDataBlockSeries*** is the optimal series type for real-time/streaming medical monitoring applications, such as ECG/EKG, EEG, industrial monitoring applications, telemetry, and waveform vibration monitoring.

:::tip
More details about ***SampleDataBlockSeries*** could be found on [this page](/docs/inDetail/SampleDataBlockSeries.md).
:::
### SampleDataSeries
***SampleDataSeries*** is the line series used for presenting sampled signal data (discrete signal data, fixed interval progressing data). This is generally used in real-time Digital signal processing (DSP) applications. The digital signal would be represented as a sequence of numbers that sample a continuous variable in time or space. Data could be visualized as line, as points or both.

:::tip
More details about ***SampleDataSeries*** could be found on [this page](/docs/inDetail/SampleDataSeries.md).
:::
### PointLineSeries
***PointLineSeries*** is for variable interval progressing data. A PointLineSeries can present a simple line, points (scatter) or both as a point-line. ***PointLineSeries*** has more features than any other line-series, but it maybe not as well optimized for memory of CPU usage.

:::tip
More details about ***PointLineSeries*** could be found on [this page](/docs/inDetail/PointLineSeries.md).
:::
### LiteLineSeries
***LiteLineSeries*** is a version of ***PointLineSeries***, that is optimized for much faster performance. It works similarly to ***PointLineSeries*** but has less configuration options. ***LiteLineSeries*** draws only the line between the data points but not the points themselves. Furthermore, it has only ***Color*** and ***Width*** properties to adjust the series appearance. LiteLineSeries expects data points to be in progressive order.

:::tip
More details about ***LiteLineSeries*** could be found on [this page](/docs/inDetail/LiteLineSeries.md).
:::
### FreeformPointLineSeries
A ***FreeformPointLineSeries*** can present a simple line, points (scatter) or both as a point line. ***FreeformPointLineSeries*** is for arbitrary data - allows drawing line/point to any direction from previous point. All line and point formatting options from ***PointLineSeries*** apply.

:::tip
More details about ***FreeformPointLineSeries*** could be found on [this page](/docs/inDetail/FreeformPointLineSeries.md).
:::
### LiteFreeformLineSeries
***LiteFreeformLineSeries*** is a lighter version of ***FreeformPointLineSeries***, that is optimized for much faster performance. However, compared to the regular series, it has less configuration options. ***LiteFreeformLineSeries*** draws only the line between the data points but not the points themselves and therefore is not suitable for scatter plots. Furthermore, it has only ***Color*** and ***Width*** properties to adjust the series appearance. ***LiteFreeformLineSeries*** allows data points to be placed freely. In other words, the points don’t have to be in progressive order.

:::tip
More details about ***LiteFreeformLineSeries*** could be found on [this page](/docs/inDetail/LiteFreeformLineSeries.md).
:::
### DigitalLineSeries
***DigitalLineSeries*** is a specific type of line series, which displays a line alternating between two Y-values, for example 0 and 1. It is fully optimized for performance and uses the least amount of memory of all series types. ***DigitalLineSeries*** has fewer configuration option compared to many other series, as it draws only the line between the data points but not the points themselves. Furthermore, it has only ***Color*** and ***Width*** properties to adjust the series appearance.

:::tip
More details about ***DigitalLineSeries*** could be found on [this page](/docs/inDetail/DigitalLineSeries.md).
:::
### LineCollection
A ***LineCollection*** is a collection of line segments. Each line segment is a line going from point A to B. One ***LineCollection*** can contain thousands of line segments. ***LineCollection*** is extremely efficient in rendering of thousands of distinct line segments, in contrast to ***PointLineSeries***, ***FreeformPointLineSeries*** or ***SampleDataSeries***. However, ***PointLineSeries***, ***FreeformPointLineSeries*** or ***SampleDataSeries*** are more efficient in rendering continuous polylines of millions of points.

:::tip
More details about ***LineCollection*** could be found on [this page](/docs/inDetail/LineCollection.md).
:::
### HighLowSeries
***HighLowSeries*** presents data as filled area between high and low values. The fill can be set with ***Fill*** property and its sub-properties. Define the line style with ***LineStyleHigh*** and ***LineStyleLow*** properties. If the lines should not be visible, set ***LineVisibleHigh = false***, and ***LineVisibleLow = false***, respectively. Define the point style with ***PointStyleHigh*** and ***PointStyleLow*** properties. If the points should not be shown, set ***PointsVisibleHigh = false***, ***PointsVisibleLow = false***.
When the high value of the data is less than its Low value, reverse fill is applied in that part. Edit the reversed fill with ***ReverseFill*** property.

*Range of data between 2004 and 2011 is reversed: high value is < low value.*
:::tip
More details about ***HighLowSeries*** could be found on [this page](/docs/inDetail/HighLowSeries.md).
:::
### AreaSeries
***AreaSeries*** presents data as filled area between base level and values. ***AreaSeries*** is quite similar to ***HighLowSeries***. Set base level with ***BaseValue*** property. Set the preferred fill style with ***Fill*** property.

*Three area series all having BaseValue = 0.*
:::tip
More details about ***AreaSeries*** could be found on [this page](/docs/inDetail/AreaSeries.md).
:::
### Which line series should be used?
Choosing the line series depends on three main questions: how many data points should be shown simultaneously (i.e. performance), what is the nature of the data points (i.e are points in progressive order, or even at fixed interval), and how the line should look visually.
The summary table of features available for each series type is below. For more in detail discussion about those features and what they check [Line-series comparison](/docs/inDetail/comparing-line-series.md)

*Table of all features available for each series type*
### BarSeries
***BarSeries*** allows displaying data in horizontal or vertical bars. Use ***Values*** array property to store the values of a bar series. Add values with ***AddValue(…)*** method. Update an existing value by given value index with ***SetValue(…)*** method. Use ***BarViewOptions*** property of the *chart.ViewXY* to control how the bars are displayed.

*Bars series, vertical and horizontal.*
:::tip
More details about ***BarSeries*** could be found on [this page](/docs/inDetail/BarSeries.md).
:::
### PolygonSeries
***PolygonSeries*** renders a fill and a borderline, by given border path. ***PolygonSeries*** has an automatic path closing feature. Set the filling preferences in ***Fill*** property. Use ***Border*** property of PolygonSeries to set the border line style.
Set ***IntersectionsAllowed = True*** to enable polygon path to intersect itself. Without this property enabled, when intersecting the path, the fill will appear all garbled up. By default, the property is ***False*** for performance reasons, as detecting and rendering intersection cases is heavy.

*Several polygons.*
:::tip
More details about ***PolygonSeries*** could be found on [this page](/docs/inDetail/PolygonSeries.md).
:::
### IntensityGridSeries (also called Heatmap)
***IntensityGridSeries*** allows visualizing M x N array of nodes, colored by assigned value-range palette. The colors between nodes are interpolated. ***IntensityGridSeries*** is an evenly-spaced, rectangular series in X and Y dimension. This series allows rendering contour lines, contour line labels, and wireframe as well.
By enabling ***PixelRendering*** property, the nodes are rendered as pixels, or rectangles. This is a very high-performance rendering style e.g. for real-time high-resolution thermal imaging applications. Note that when this rendering mode is selected, many other options are disabled, such as contour lines, wireframe and interpolation. If logarithmic axes are used, the logarithmic transformation is only applied to corners of the series, the pixels in the bitmap remain evenly spaced and no logarithmic transformation is applied to them.

*IntensityGrid series showing a heat map presentation. Legend box shows the value-range color palette.*
:::tip
More details about ***IntensityGridSeries*** could be found on [this page](/docs/inDetail/IntensityGridSeries.md).
:::
### IntensityMeshSeries (also called Heatmap)
***IntensityMeshSeries*** is similar to ***IntensityGridSeries***. The biggest difference is that series nodes can be positioned arbitrarily in X-Y space. In other words, the series does not have to be rectangular. Wireframe lines can be set visible with ***WireframeType*** property, and nodes can be shown by setting ***ShowNodes*** true.

*IntensityMeshSeries with freely positioned X and Y values for each node. WireframeType = None and ShowNodes = false.*
:::tip
More details about ***IntensityMeshSeries*** could be found on [this page](/docs/inDetail/IntensityMeshSeries.md).
:::
### Persistent series rendering layers
***PersistentSeriesRenderingLayer*** can be used for extremely fast rendering of repetitive line/points data, or line/points/high-low/area fill data that is plotted in same X and Y range over and over again. It is kind of a bitmap, that allows adding rendering data incrementally in it. It keeps the graphics until cleared by command. This way, each update round, only one series needs to be rendered on the layer, followed by the layer rendering on the screen. CPU load or memory footprint doesn’t rise. If existing data should be faded away gradually, it can be done by multiplying the alpha of the bitmap pixels.
It is possible to create as many ***PersistentSeriesRenderingLayer*** objects as needed, and any count of series can be rendered on each of them, any update round.

*Persistent layer shows historical traces, in green color. MultiplyAlpha method is called before updating new data in the rendering layer making the oldest traces fade away.*
:::tip
More details about ***PersistentSeriesRenderingLayer*** could be found on [this page](/docs/inDetail/persistent-layer.md).
:::
### Persistent series rendering intensity layers
***PersistentSeriesRenderingIntensityLayer*** allows collecting traces into a layer and coloring it by the hit count per pixel. The coloring is made by using a value-range palette. The traces can be used with the same series types as in ***PersistentSeriesRenderingLayer*** (see [here](#Persistent-series-rendering-layers)). They are very much similar, main difference being the coloring. When rendering a trace in a location of a pixel again with second rendering call, the intensity of it grows, increasing its value in the value-range palette.

*Persistent intensity layer highlights areas of concentrated activity, in this case in yellow and red.*
:::tip
More details about ***PersistentSeriesRenderingIntensityLayer*** could be found on [this page](/docs/inDetail/persistent-intensity-layer.md).
:::
### StockSeries
***StockSeries*** allow stock exchange data visualization in candle-stick or stock bars format. Several stock series can be added in the same chart by adding multiple ***StockSeries*** objects in ***StockSeries*** list property. Select the style with Style property. The options are *Bars*, *CandleStick* and *OptimizedCandleStick*.

*StockSeries with CandleStick Style. A light blue PointLineSeries is set to go through all Close values.*
:::tip
More details about ***StockSeries*** could be found on [this page](/docs/inDetail/StockSeries.md).
:::
### Automatic series title placement
Each XY series has title (by default hidden), for which style and position could be modified through properties (***series.Title***. propertyName). Enabling property ***ViewXY. TitlesAutoPlacement. Enabled*** informs chart that series’ Title location should be calculated automatically in order to avoid multiple titles overlapping each other. Title position could be locked at current X-Y value by enabling ***series.Title. LockAutoPosition*** property. Auto positioning is reset with ***ViewXY. TitlesAutoPlacement. Reset()*** method.
:::info
To see TitlesAutoPlacement used in example, check *ExampleMinLog* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Zooming and panning
Zooming and panning are configurable and can be performed by left or right mouse button. Zooming can be also performed with mouse wheel. Zooming and panning could be performed on touch screen as well.
### Default behavior (ViewXY)
#### Zoom-rectangle
- Draw zoom-in rectangle around area of interest by clicking and holding on **GraphArea** the left-mouse button and drag mouse from upper left corner to bottom right corner. Release mouse button when correct area is selected.
- Drawing zoom rectangle in opposite direction (from-right-to-left) will initiate data auto-fit action upon mouse button release.

*Default settings: ZoomPanOptions.RectangleZoomMode = HorizontalAndVertical. ZoomOrigin has no effect on the zooming rectangle.*
:::note
User can cancel zoom-rectangle by pressing Esc-key until mouse button is released.
:::
#### Zooming by clicking
- With chart control focused, press Shift key down. Zoom X cursor appears. Click configured (left) mouse button to zoom in, and the other button to zoom out.
- With chart control focused, press Ctrl key down. Zoom Y cursor appears. Click configured (left) mouse button to zoom in, and the other button to zoom out.
#### Panning GraphArea
- Panning is done by clicking and dragging the **GraphArea** with right-mouse button. To stop panning, release the button.
#### Zooming with axis ScaleNibs
- Each axis has ScaleNibs at both ends. Those could be dragged with mouse. Once mouse cursor is over ScaleNibs the 'Horizontal Resize' or 'Vertical Resize' icon will appear (for X- or Y-axis respectively). Press primary mouse button and drag. Dragging toward axis center will have zoom-in effect, while dragging away from axis center will have zoom-out effect.

*Axes ScaleNibs (encircled in red) with 'Vertical Resize' cursor (top-left corner)*
#### Zooming with mouse wheel
Zoom in by scrolling the mouse wheel upwards and zoom out by scrolling it downwards. The zoom center is the position of mouse cursor. Use ***ZoomFactor*** to adjust the mouse wheel zoom strength. By keeping **Shift** key pressed, the zoom is applied only to X dimension. By keeping **Ctrl** key pressed, the zoom applies only for Y dimension.
#### Panning with mouse wheel
When mouse cursor is over axis-area (rectangle around axis line and labels), then mouse wheel scrolling will pan specific axis.
#### Zooming with touch screen
Set two fingers on the chart and pinch the fingers closer to zoom out, or away to zoom in.
By pinching/spreading fingers above an X or Y axis or their labels, the zooming applies to that specific axis only.
#### Panning with touch screen
Set two fingers on the screen and slide them at same pace to pan the view.
Some systems support panning with inertia, so it is possible to “throw” the fingers off the screen, and the view keeps panning and finally slows down until stopped.
By setting a finger above an X or Y axis or labels of it, and sliding the finger, the panning applies to that specific axis only.
:::tip
If you not familiar with some of the terms, please check our [Definitions](definitions.md) page.
:::
### Modifying zooming and panning behavior (ViewXY)
Use ***ViewXY.ZoomPanOptions*** to control the zooming and panning settings.

For more in depth discussion about fine turning this behavior check our [In detail](/docs/inDetail/zooming_panning_InDetail.md) page.
Besides properties also event handlers could be used for fine turning zooming and panning functionality/behavior. The relevant events are ***ViewXY. BeforeZooming***, ***ViewXY. BeforePanning***, ***Axis. RangeChanged***, ***ViewXY. Panned*** and ***ViewXY. Zoomed***. The example of usage could be found in how-to pages: [limit zooming range](/docs/how-to/limit-axis-range.md).
---
## Dev Center
From LightningChart .NET version 8.5 onwards, LightningChart .NET Dev Center is automatically copied when running **LightningChart .NET SDK** [installer](/docs/getting%20started/installation_v11.mdx). Dev Center is a new application, which allows quick access to LightningChart® .NET features and resources. The following tasks can be accomplished with few mouse-clicks.
- Open [Interactive Examples](/docs/getting%20started/RunningDemo.md) demo application.
- Open documentation resources such as tutorials and the User’s Manual.
- Contact support via e-mail.
- Book a video meeting or a phone call.
- Automatically gather application information, which can be sent to technical support. This often helps the support team to solve the issue faster.
- Quick link to send feedback to developers.
- Check license status and open License Manager to update or [activate licenses](/docs/getting%20started/license.md).
- Purchase new licenses.

*The main window of Dev Center containing buttons for different actions.*
---
## Download
## Get SDK installer
### For trial user
Obtain your copy of SDK installer and 30 days trial license for [free](https://portal.lightningchart.com/loadform?view_name=free_or_trial_version_form&product_id=35).
Just fill in your initial information and we’ll deliver you the download link to your email.
Once you obtain SDK installer, continue with [Installation](installation_v11.mdx) guide.
### For licensed user
Once license is bought, the SDK-installer can be downloaded from [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login). An account in Portal could be created by *Team Manager* or user oneself. Email address and password is required for login.

*Portal Login page*
:::info
More about [Managing license in Portal](https://lightningchart.com/net-charts/docs/getting%20started/license/#Managing-license-in-Portal).
:::
Portal account is created once (trial) user requested SDK-installer link, created by user directly or created by 'Team manager' when license assigned to team-member. Users are able to modify profile information once sign-in to Portal.

*Downloads section in Portal*
[**Downloads** section in Portal](https://lightningchart.com/net-charts/docs/getting%20started/license/#Downloads) allows to obtain SDK-installer and corresponding ChangeLog document. LightningChart version available for download is limited by subscription expiration date. Only versions released before expiration data is shown. If license-subscription is not expired, new SDK will appear automatically after release date.
Once you obtain SDK installer, continue with [Installation](installation_v11.mdx) guide.
License-key assignment and activation described [elsewhere](license.md).
---
## Examples Gallery
---
## Getting started
---
## Installation v10
### Run the setup wizard
Run **LightningChart .NET SDK v10.exe.** The setup will install the components into Visual
Studio toolbox. It also installs the help files associated with the toolbox controls. If components or help
install fails, install them manually as instructed in the following sections.
Note, when trialing LightningChart, **SetupDownloader.exe** is most likely used. This downloads and installs the
SDK, meaning running LightningChart .NET SDK v10.exe explicitly is not required. Instead user should click 'Download and install' button.

The installer creates Arction folders in the Start menu:

*Start menu of Windows 10 after installation*
The software installs to **C:\Program Files (x86)\Arction\LightningChart .NET SDK v.10** by default and creates **C:\ProgramData\Arction\LightningChart .NET SDK v.10** folder which contains assembly (.dll) files as well as Demo Service solution used to demonstrate the use of LightningChart in headless mode.
Furthermore, a shortcut to Arction Dev Center is added to the desktop.

---
## Installation v11 and above
### Run the setup wizard
:::info
If you are installing any other major version above v11, then in following instructions just substitute with corresponding number (e.g. v12)
:::
Run **LightningChart .NET SDK v11.exe.** The setup will install the components into Visual
Studio toolbox. It also installs the help files associated with the toolbox controls. If components or help
install fails, install them manually as instructed in the following sections.
Note, when trialing LightningChart, **SetupDownloader.exe** is most likely used. This downloads and installs the
SDK, meaning running LightningChart .NET SDK v11.exe explicitly is not required. Instead user should click 'Download and install' button.

The installer creates *LightningChart .NET SDK v.11/v.12* folders in the Start menu:

*Start menu of Windows 10 after installation*
The software installs to **C:\Program Files\LightningChart\LightningChart .NET SDK v.11/v12** by default and creates **C:\ProgramData\LightningChart\LightningChart .NET SDK v.11/v.12** folder which contains assembly (.dll) files as well as Demo Service solution used to demonstrate the use of LightningChart in headless mode.
Furthermore, a shortcut to *LightningChart [Dev Center](/docs/getting%20started/dev-center.md)* is added to the desktop.

At the end of SDK installation user will be prompted to launch LightningChart [Interactive Examples app](/docs/getting%20started/RunningDemo.md) (which could be very helpful while you are learning how to use library or just searching for the idea of implementation/functionality)

---
## License activation
Trial license is automatically installed when you use LightningChart .NET control for the first time. If trial extension is required, then [contact us](https://lightningchart.com/contact/) to discuss your needs. Once you receive trial-license-key (extension), follow the procedures described in [Installing and activating License-Key](#Installing-and-activating-License-Key) paragraph.
### Obtaining License-Key
Once license is bought, the License-Key for software developer could be downloaded from [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login). An account in Portal could be created by *Team Manager* or user oneself.

Email address and password is required for login. Portal account is created once user requested SDK-installer link (see [Get SDK installer](download.md)). Users are able to modify profile information once sign-in to Portal.
There are 2 main types of accounts in Portal: *Team Manager* and *Team Member*. *Team Manager* can manage own team members by inviting them, disabling, editing their account details and assigning team members for each purchased license.
**Licenses** section in Portal allows to check all information on existing licenses type, subscription period, assigned team member, license key and so on. You can also purchase new products and renew existing license subscriptions, as well as set an auto renewal for them. In the Licenses section you can also claim your existing subscription.
NOTE, user who purchased license directly in Portal or claimed existing license successfully will become *Team Manager* automatically. Please allow 1 business day for license to appear in the account once purchasing is done.

*Team Manager* or *Team Member* who has assigned license could download License-Key (*.ALF file) by clicking key-icon. License-Key should be activated on computer where charting application will be developed.
### Installing and activating License-Key
Manage licenses by running the **License Manager** application from the [Dev Center](/docs/getting%20started/dev-center.md) or from Windows start menu: Programs / LightningChart .NET SDK / License Manager.
When dragging a LightningChart component from Toolbox into an application the first time, a license key is asked in a license manager window. Add the license key from the received license file by clicking **Install license from file** and browsing the **.alf** file.

Per-developer licenses are activated to LightningChart License Server over internet automatically after adding the license file.

If online activation is not possible due to for example internet connection being not available or the connection being too slow, the licenses can be activated via e-mail as well. **Request offline activation** button becomes available after the respective online action has failed one or two times. Deactivating the license offline works similarly.

Clicking the offline buttons gives on-screen instructions. Follow them to send an e-mail message to LightningChart licensing team at licensing@lightningchart.com.
LightningChart will provide instructions how to install the license offline. Expect a reply in 1 business days.
### Removing a license
If license is about to be transferred to another computer, it should be first deactivated from old machine.
License can be removed from the system with **Deactivate & uninstall** button. Online connection is required for automatic deactivation. If internet connection is not available, deactivation can be done via e-mail as instructed in the previous chapter.
After the license has been deactivated, it can be installed on another computer.

### Updating a license
After initial installation of license, it can still be updated, for example when subscription period is extended, it is upgraded to better edition, or when source code is bought etc. **NOTE**, license is **not** automatically updated on user’s machine. Therefore, each user should take action to ensure that license on developer machine is up-to-date. To do that the old license has to be deactivated and removed first (see the previous paragraph “Removing a license” how to do this). Afterwards obtain the new license key (.alf file) from the LightningChart’s customer portal. Then install it according to the instructions on paragraph [Installing and activating License-Key](#Installing-and-activating-License-Key).
### Managing license in Portal
[LightningChart’s customer Portal](https://portal.lightningchart.com/user/login) allows users to browse products, download trial versions and manage license subscriptions in one place.
This document will lead you through the main sections and tools available in **Team Manager** Account and **Team Member** Account at Portal.
:::info[Note]
This chapter is about LightningChart .NET specific Portal features. However, Portal also serves similar purpose for other products of LightningChart Ltd. Therefore, in your Portal account you may see additional options.
:::
#### Team Manager Account
When you register as a developer with a company, you will get a Team Manager Account. Below is the description of each section of Team Manager Account.
##### Notifications Dashboard
All notifications, orders history, invitation requests and other details are reflected in
the account’s Dashboard section.

*Notifications Dashboard*
##### Account Profile
You can check and change your personal information and notification settings in the Account Profile section.

*Account Profile*
##### Team Management
In this section, you can manage your team members by inviting them, disabling, editing their account details and assigning your team members for each purchased license.

*Team Management*
##### (Developer) Licenses
This section allows to check all information on existing licenses type, subscription period, assigned team member, license key and so on.
In the Licenses section you can also claim your existing subscription to transfer it to the LightningChart Portal.

*Licenses*
##### Downloads
Here you can check all available versions of your purchased products and read change logs.

*Downloads*
##### Invoices
After purchasing products, you will get email notification about order. However, invoices are not maintain in the Invoices section anymore.
##### Support
Portal's ticketing system became **obsolete** in 2026. While it is still possible to see old tickets, the fastest way to get help is to write email to support@lightningchart.com (please mention subscription ID in email).

*Support*
#### Team Member Account
When you accept an invitation to join a team which was sent to you by another user, you get a Team Member Account. Below is the description of each section of the Team Member Account.
*Notifications Dashboard*, *Account Profile*, *Licenses*, *Downloads* and *Support* sections will look the same and give same information as described for [Team Manager account](#Team-Manager-Account).
##### Invitation Requests
The only new section for *member* account is Invitation Requests. In this section, you can accept invitations from your Team Manager when they invite you to join their team.

*Invitation Requests*
---
## Library requirements
### System requirements
Check if the computer configuration meets the requirements
- .NET framework v. 4.8 / 10.0 or newer installed. For older .NET version see [.NET compatibility](#NET-compatibility)
- **DirectX11** compatible graphics hardware and operating system is recommended, although DirectX 9.0c (shader model 3) level graphics adapter maybe be sufficient for some use cases.
- Windows 11 is recommended, but see note on other [Windows OS](#Windows-OS).
- Visual Studio for development, but not required for deployment. See note on [Visual Studio](#Visual-Studio) version.
#### .NET compatibility
While upgrading LightningChart .NET library target, library follows [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core).
The latest version of LightningChart .NET library is build targeting .NET Framework 4.8 and .NET 10.0. However, earlier versions LightningChart .NET library use older .NET version. Therefore, it is possible to use LightingChart even in application targeting .NET Framework 4.0, BUT its is not recommended as legacy packages are not supported.
| LightningChart Version | .NET Framework Target | .NET (Core) Target |
| :--- | :--- | :--- |
| `12.6.1` | .NET Framework 4.8 | .NET 10.0 |
| `12.5.1 to 12.2.1` | .NET Framework 4.8 | .NET 8.0 |
| `12.1.1 to 11.0.1` | .NET Framework 4.8 | .NET 6.0 |
| `10.5.1` | .NET Framework 4.6.2 | - |
| `10.4.1 to 10.2.1` | .NET Framework 4.5.2 | - |
| `10.1.2 to 10.1.2` | .NET Framework 4.5 | - |
| `10.1.1 to 8.0.0` | .NET Framework 4.0 | - |
:::tip[Note]
Project's (where library will be used) build target framework should be the same as library's or higher. For example, DLLs targeting .NET 6.0 can be used in application, which targets .NET 6.0, 7.0, 8.0, 9.0 etc.
:::
:::warning
.NET application can use libraries build for .NET Framework as well as .NET (Core). When using the .NET Framework targeting library in .NET (Core) application, Visual Studio may give a warning about installed package using different target, especially when using NuGet packages. However, this does not prevent the application from working.
In these cases, the warning can be suppressed or just ignored.
:::
#### Windows OS
Latest **Microsoft Windows** operating system is recommended. However, if system support DirectX 9.0c (shader model 3) level graphics adapter or newer, then LightningChart .NET component can be used. Therefore, earlier versions of Windows OS (like 10, 8, 7 and even Windows Vista or Windows Server 2008 R2) can be used with limitations.
:::tip
The summary of .NET Framework version history and correlation of each version with Visual Studio, Windows, and Windows Server can be found in [following document](https://learn.microsoft.com/en-us/dotnet/framework/install/versions-and-dependencies).
:::
:::tip
.NET Core (and the modern unified .NET 5 through .NET 10) shifted away from being an operating system component tied to Windows. Therefore, its dependency and support structure works completely differently from the old .NET Framework. See [.NET Supported OS Policy](https://github.com/dotnet/core/blob/main/os-lifecycle-policy.md).
:::
For rendering without graphics hardware ([WARP software rendering](https://learn.microsoft.com/en-us/windows/win32/direct3darticles/directx-warp)), DirectX11 compatible operating system is required.
**Windows IoT** also satisfy DirectX and .NET framework requirements (see [Creating app for ARM-device](/docs/how-to/create-app-for-ARM-device.md)).
#### Visual Studio
Latest **Visual Studio** (2026) is recommended. However, some very early versions of LightningChart .NET component may be compatible even with Visual Studio 2010.
:::note
For several latest LightningChart versions at least Visual Studio 2022 is required, because .NET Framework 4.6 and above is used. At least Visual Studio 2022 is required for .NET (5, 6, 7, 8, 9, 10) projects.
More information how each Visual Studio version support .NET Development can be found in following pages: [VS 2026](https://learn.microsoft.com/en-us/visualstudio/releases/2026/compatibility#-visual-studio-support-for-net-development), [VS 2022](https://learn.microsoft.com/en-us/visualstudio/releases/2022/compatibility#-visual-studio-2022-support-for-net-development) etc.
:::
##### Visual Studio Toolbox
::::warning[Warning]
Currently Visual Studio (2022 or 2026) does not support Controls/Toolbox Deployment through DLL-reference for .NET (5, 6, 7, 8, 9, 10) projects. Therefore, LightningChart .NET 6.0/8.0/10.0 controls cannot be installed the same way as for .NET Framework and LightningChart controls will not appear in Visual Studio toolbox in .NET Core 3.x, .NET 5, .NET 6, .NET 7, .NET 8, .NET 9 or .NET 10 projects.
This is not LightningChart specific, and will effect any custom-control. Probably Microsoft Visual Studio dev. team will fix it in the future. However, this limitation does not prevent LightningChart control usage - user just need to add references manually and **create chart in the code**.
:::tip[Tip]
For an example how chart could be created and configured **in the code** see [here](/docs/beginners%20guide/chart-in-code.md).
:::
::::
### Dependencies
LightningChart is mostly self-contained package. There are only few dependencies, which should be added in few specific projects.
**LightningChart v12.6.1 and .NET Framework 4.8.x project**
If DLLs used in the project was build targeting for .NET Framework 4.8 (e.g. *LightningChart.WinForms.Charting.NET4.dll* or *LightningChart.WPF.Charting.NET4.dll*), then [System.Text.Json](https://www.nuget.org/packages/System.Text.Json/) (10.0.2) and its dependencies will be automatically added in the project (output folder).
**LightningChart v12.5.1 and .NET 8.0 project (BUT not .NET 10.0)**
If DLLs used in the project was build targeting for .NET 8.0 (e.g. *LightningChart.WinForms.Charting.NET8.dll* or *LightningChart.WPF.Charting.NET8.dll*), then user should add [System.Drawing.Common](https://www.nuget.org/packages/System.Drawing.Common/) (>= 10.0.0) in the project.
In addition, [System.Text.Json](https://www.nuget.org/packages/System.Text.Json/) (>= 10.0.0) is needed, if [PrintPreview](/docs/inDetail/export-printing.md) feature is used. Or [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/) (>= 13.0.0), if [HERE tile map](/docs/inDetail/geographic-maps.md) feature is used.
**LightningChart v12.5.1 and .NET Framework 4.8.x project**
If DLLs used in the project was build targeting for .NET Framework 4.8 (e.g. *LightningChart.WinForms.Charting.NET4.dll* or *LightningChart.WPF.Charting.NET4.dll*), then [System.Text.Json](https://www.nuget.org/packages/System.Text.Json/) (10.0.2) and its dependencies will be automatically added in the project.
In addition, user need to add [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/) (>= 13.0.0), if [HERE tile map](/docs/inDetail/geographic-maps.md) feature is used.
**UWP project**
For UWP project and edition of LightningChart library user should add in the project following packages:
[Microsoft.NETCore.UniversalWindowsPlatform](https://www.nuget.org/packages/Microsoft.NETCore.UniversalWindowsPlatform/) (>= 6.2.14)
[Microsoft.Toolkit.Uwp](https://www.nuget.org/packages/Microsoft.Toolkit.Uwp/) (>= 7.1.3)
---
## Learning from Demo
There are more than 215 examples, which could be very helpful while you are learning how to use library or just searching for the idea of implementation/functionality.
### Open Demo
Interactive Examples App is the demo application for LightningChart® .NET, its shortcut appears on Desktop or in Start menu / LightningChart .NET SDK. It can also be run from [Dev Center](/docs/getting%20started/dev-center.md).

*Running Interactive Examples via Start menu or Dev Center*
### Main features of Demo
*Main features of Interactive Examples App are:*
- examples could be [search by keywords](#Searching-example) (from list of Tags or text in the description);
- [interactivity](#Interaction-with-example): not only zooming/panning/tracking, but also data point (or series) count can be changed;
- [Properties Editor](#Interaction-with-example) to modify Chart's public properties on-fly;
- source code of [example extractable as standalone application](#Extracting-example);
- [exporting](#Exporting-to-file) of chart-image to file or clipboard, printing with preview or export chart as XML file;
- [2D transformation](#Chart-geometry-transformation) of chart (flip, rotate);
- [color theme](#Color-themes) change on-fly;
- list of [Favorite examples](#Favorite-examples) could be created, exported and shared;
- user can start email with question or feedback about specific example directly from app.

*Demo in Tile view*

*Demo in List view*

*Exploring selected example*
#### Examples Gallery
Examples shown in Interactive Examples app in Tile or List view. If you don't have application, you can find them listed in [Gallery page](/docs/getting%20started/examples-gallery.md).
#### Searching example
Interactive Examples has a large number of demo examples (210+) grouped in various categories (For example, *Showcase*, *Performance*, *ViewXY*, *View3D*, *Polar*, *Maps*, *Trader* etc.). Check the examples by browsing the categories or by using the search bar on top of the application.
When user search examples by keyword(s) (in top search-box), the new category of examples is created based on those (in Tile-view). User can enter multiple words and do search with AND operator. This category is place at the top of view. Similarly, clicking on Tags from right-side description column will add those to the search-box.
User 'clear' button at right side of search-box to remove new category of examples.
Right below search-box there list of most popular Tags. Those can be used to filter existing categories of examples (only those examples are show, which have specified tags). Multiple filtering words can be applied with OR or AND operator (match any or match all respectively).
#### Interaction with example
Many examples have several chart settings added to the user interface, feel free to change them. Furthermore, the **Properties Editor** tab can be used to view and edit almost every chart property individually (see image above).
#### Extracting example
Each individual example can be extracted as standalone application. First user must select target platform (WPF (Windows Presentation Foundation), Windows Forms or UWP (Universal Windows Platform)) and .NET version (.NET Framework 4.8 or .NET 10.0).
Once *"Extract..."* button is clicked, user will be asked to specify root folder for example to be extracted to. And then Visual Studio with new project will be open automatically.
Once extracted as a standalone Visual Studio project, example can be modified or used as the basis for the user’s own application.
Over 170 examples can also be extracted as bindable WPF projects utilizing the MVVM model. Furthermore, over 77 examples are available as UWP standalone projects, likewise using binding and MVVM models.
:::info[Note]
The count of yellow triangles show relative performance difference between platforms.
If conversion of example to specific platform is not done yet, then triangles will be black and example is not possible to extract as standalone application. User can send request about such cases to [Support](support.md)
:::

*Visual Studio with extracted example*
#### Exporting to file
The Chart capabilities to export is described [elsewhere](/docs/inDetail/export-printing.md). However, it is also possible to some of export method calls directly from Demo. When example is open, user will find icons-buttons in top-right corner to do such actions.

*Exporting to file*
#### Chart geometry transformation
The geometry of Chart as WPF object can be modified and described [elsewhere](/docs/how-to/rotate-chart.md). The example of such rotation transformation can see on selected example by using Demo's controls as shown in image above.
#### Color themes
LightningChart has dozen predefined color-theme and it is also possible to create custom theme (see [User Manual](/docs/users-manuals.md) chapter 12). Demo allows to switch to one of those color theme whenever example is open. Color-theme switch button can be found in top-right corner of Demo.
:::tip
Note that most of examples have been created with dark color theme in mind. Therefore, color selection for series or palette may be not ideal when overall chart's color theme is changed.
:::
#### Favorite examples
The list of Favorite examples could be created, exported and shared. When mouse hover over example ‘Add to Favorites list’, or star-icon is shown. In addition, star-icon is shown next to the description on the right side column. Once list of Favorite examples is created user can filter example to shown only those or one can export to file (by using context menu from top-right corner of Demo). Such file can be shared between user as anybody having Interactive Examples App can upload it and use it.
:::tip
Note, Interactive Examples App does not require LightningChart license per se. Therefore, sharing favorite examples may be quickest way to show idea or capabilities charting application.
:::
### Headless mode demonstration
There is also a **Service demo** for connecting a client application to a service that generates a chart image stream. For the Service demo (Headless mode rendering), please refer to [Headless mode](/docs/inDetail/headless-mode.md) page and to the **DemoService\description.pdf** file in the following directory path:
**C:\ProgramData\LightningChart\LightningChart .NET SDK v.??\DemoService**
---
## Getting support
There are number of ways get support or receive answers to your question.
First, you can learn a lot by exploring our Demo application (see [Learning from Demo](/docs/getting%20started/RunningDemo.md)).
Second, you can check this online documentation. It should contain up-to-date information and updated frequently. If you prefer single file document, you can also use 400-page PDF, which was installed with SDK (online location is [here](/docs/users-manuals.md))
Users with active subscription can ask question directly to LightningChart developers. The fastest way to get help is to write email to support@lightningchart.com (please mention subscription ID in email). Typical response time is less than 1 business day.
User with trial license could also ask questions to LightningChart developers.
You can also explorer [LightningChart's forum](https://lightningchart.com/forum/) and [other resources](https://lightningchart.com/net-charts/resources/). Although some of those topic maybe too old. Therefore, it is good idea to verify that proposed solution is still the best in the latest release.
---
## 3D Orthographic view tips
Use ***View3D.Camera.Projection*** = *Orthographic* instead of *OrthographicLegacy* for maximum performance. Difference can be seen especially when zooming the view while having lots of series and data in it (see [3D Camera](/docs/inDetail/3D-overview.md)).
---
## How to set correct pixel alignment?
In case, application subscribes/listens to [LightningChart ChartMessage](/docs/how-to/debug-troubleshoot.md), the WPF application may raise events related to *'pixel alignment'*.
For example, it maybe Warning with details *"Failed to set correct pixel alignment..."*.
It is just warning that internal pixel alignment system was not able to achieve desired results. In worst case the chart/image may be a bit blurry.
If user would enable ***grid.UseLayoutRounding*** (as recommended by [.NET documentation](https://learn.microsoft.com/en-us/dotnet/api/system.windows.frameworkelement.uselayoutrounding?view=windowsdesktop-10.0&viewFallbackFrom=netcore-3.1)) that should be sufficient to fix any/most blurriness issues.
If user don’t see any blurriness, then nothing to be alarmed yet, and user can ignore warning.
---
## Using LightningChart in C++ applications
***LightningChart*** is a .NET library which can be most fluently used with C# and VB.NET language. However, it is possible to use LightningChart in C++ Win32 applications as well, including MFC applications. The application using LightningChart must be compiled with **Common Language Runtime Support (/clr)** option. When creating a Windows Form Project using C++, refer to the detailed step by step tutorial below.
### Install required C++/CLR packages
Make sure your Visual Studio have installed C++ package with C++/CLR. For example, run Visual Studio
Installer, and select update/modify button. From Workloads select **Desktop development with C++**. From Individual components select **C++/CLI support**.

*Visual Studio Installer selections for C++ project.*
### Setting Visual Studio project
Open Visual Studio and create a new project. If all the required packages and components described above are installed, the following selection is available when creating new project:
**Templates -> Visual C++ -> CLR -> CLR Empty project (.NET Framework)**.

*Windows Forms C++ project template.*
Right click the created project and choose Properties option. Modify
**Configuration Properties -> Linker -> System -> SubSystem** *-> Windows*
and
**Linker -> Advanced -> Entry point** *-> Main*
as shown in the next figure below.

*C++ project property pages.*
Add *Windows Form* Item to the project: right click the project and choose **Add -> New Item...** Select Windows Form as shown in the next figure below. It is possible to get an error message: *The data necessary to complete this operation is not yet available. (Exception from HRESULT: 0x8000000A)*. This can be ignored, just close it and proceed to the next step.

*Add new Windows Forms item in C++ project.*
Add the following code to the created form (in this example *MyForm.cpp*), save it and close the Visual Studio.
```csharp
#include "MyForm.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThreadAttribute]
void Main(array^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Project1::MyForm form;
Application::Run(%form);
}
```
The project is ready to be built for the first time. Reopen the project and select **Build -> Rebuild Solution**. When the project is running, an empty Windows Form should be seen.
### Creating LightningChart application in C++ project
Components can now be added to the form by editing **MyForm.h** file. Below is a simple example how to create a chart with ***PointLineSeries*** in it. Include LightningChart’s WinForms DLL in references list and add relevant namespaces in **MyForm.h** code file.

*Include LightningChart.WinForms.Charting.NET4 in references list and add relevant namespaces in the project.*
Declare a ‘chart’ variable and set its properties. Below is an example of a chart creation method.
```csharp
protected:
LightningChart ^ _chart;
void CreateChart()
{
_chart = gcnew LightningChart();
//Disable repaints for every property change
_chart->BeginUpdate();
//Set parent window by window handle
_chart->Parent = this;
//Fill the form area
_chart->Dock = DockStyle::Fill;
_chart->ActiveView = ActiveView::ViewXY;
// Configure x-axis.
AxisX^ axisX = _chart->ViewXY->XAxes[0];
axisX->SetRange(0, 20);
axisX->ScrollMode = XAxisScrollMode::None;
axisX->ValueType = AxisValueType::Number;
// Configure y-axis.
AxisY^ axisY = _chart->ViewXY->YAxes[0];
axisY->SetRange(0, 100);
PointLineSeries^ pls1 = gcnew PointLineSeries(_chart->ViewXY, axisX, axisY);
pls1->LineStyle->Color = Color::Yellow;
pls1->Title->Text = "New Title";
pls1->PointsVisible = true;
pls1->LineVisible = true;
_chart->ViewXY->PointLineSeries->Add(pls1);
// Generate random data.
Random rand;
int pointCount = 21;
array ^ points = gcnew array(pointCount);
for (int point = 0; point < pointCount; point++)
{
points[point].X = (double)point;
points[point].Y = 100.0 * rand.NextDouble();
}
pls1->Points = points;
// Allow chart rendering.
_chart->EndUpdate();
}
```
The resulting application when compiled and executed:

*Example application executed.*
---
## Creating app for ARM-device
Windows has traditionally run on machines that are powered by x86 / x64 processors, but more recently, also runs on devices powered by [Arm processors](https://learn.microsoft.com/en-us/windows/arm/overview).
Arm-powered devices are particularly interesting because the power-frugal nature of the Arm architecture enables these devices to offer longer battery life while delivering great performance. Arm Systems on Chip (SoC) often include other key features such as a powerful CPU, GPU, Wi-Fi & mobile data networks, as well as Neural Processor Units (NPUs) for accelerating AI workloads.
### UWP application
Universal Windows Platform (UWP) apps can be configured to run on not only on traditional architectures (like *x86* and *x64*), but also on *ARM* and *ARM64*.
How users should setup application with LightningChart in UWP and how to build it for ARM-devices is discussed elsewhere [see Creating UWP project](/docs/inDetail/creating-UWP-project.md).
### WPF application for ARM-device
This chapter/article demonstrates how to use LightningChart WPF with .NET 8.0 to implement a desktop application that runs on Arm64.
#### x86 and x64 (software) Emulation on ARM
Emulation makes the rich ecosystem of Windows apps available on Arm, allowing users to run the apps they care about without any modifications to the app. Windows 11 on Arm supports emulation of both x86 and x64 apps. Windows 10 on Arm also supports emulation, but only for x86 apps. See more [How emulation works on Arm](https://learn.microsoft.com/en-us/windows/arm/apps-on-arm-x86-emulation)
#### Native ARM support
While having your app run under emulation on Arm devices is a great place to start, your app will benefit from native performance gains and the unique qualities of Arm-powered devices if you rebuild to add Arm support to your app.
Starting from around version .NET 6.0 it is possible to bring Windows Forms and WPF apps to ARM-devices. Running your desktop applications on ARM devices natively can significantly speed up performance for your end users. [see more in following video](https://learn.microsoft.com/en-us/shows/dotnetconf-focus-on-windows/bringing-your-windows-forms-and-wpf-apps-to-arm-devices)
#### ARM-device
For testing purpose we will use Raspberry Pi 4 model B.

*ARM-device: Hardware*
We have Windows 11 ARM64 version installed there...

*ARM-device: Software*
#### Create the project
Use Visual Studio 2022 to create a new project or open existing one. While user can create LightingChart based charting application from scratch (for example, see [Tutorials](https://lightningchart.com/net-charts/docs/category/tutorials/)), it will much easier just extract ready made project from [Interactive Examples App](/docs/getting%20started/RunningDemo.md).
For this test we will extract *ExampleAreaSeriesRealTimeXY* as .NET 8.0 project.
#### Building and running an application
Next we will prepare an application for ARM64, ARM32 and x86_64 builds. The steps as following:
1. Click the Any CPU drop-down menu and select **Configuration Manager…**:

*Visual Studio Configuration-Manager*
2. In the **Configuration Manager**, click **New…** from the *Active Solution Platform* drop-down menu:
3. In the **New Solution Platform** window, select ARM64, and click the OK button. Then repeat step for x86, x64 and ARM32 solution platform.

*Visual Studio, New Solution Platform*
4. Next we build application for all **solution platforms** of interest (ARM64 in particular).
5. Then we transfer application to device and run.

*RaspberryPi4B running real-time example built for ARM64 platform*
:::tip[note]
Note that one can run x64 platform build on ARM-device (software emulation). However, native (ARM) platform build will make application to run significantly faster.
:::
---
## Cartesian Chart - how to create?
It maybe trivial question for some, but not that obvious for others. If you found yourself in latter category, we are here to untangle that question.
While most frequently Cartesian Chart understood as tow-dimensional chart/coordinate-system, one can define Cartesian coordinates for any dimension N. Where is N any positive integer number from 1 to infinity.
:::info
You can learn history, concepts around Cartesian Chart and how to build one with LightningChart .NET library from [following article](https://lightningchart.com/blog/cartesian-charts/).
:::
---
## How customize DataCursor's ResultTable?
From version 12.4 [DataCursor](/docs/inDetail/data-cursors.md) can have customizable content of ***ResultTable***. In particular, after subscribing to ***DataCursor. ChangeResultContent*** event, user can use event handle to create [a composite format string](https://learn.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting), which will be used instead of default table. As much as composite format string allows, user can define which values to show in ***ResultTable***, with what precision and how to arrange items (e.g. padding, alignment, multi-lines).
***ChangeResultContent*** event is available for XY, 3D, Polar and Smith views, although event-argument-class is slightly different for each. The event-argument give user access to tracked series, axis values of tacking point and few other parameters.
:::tip[info]
For multi-line Result-string it is better to use monospaced fonts for nice alignments.
For example, "Courier New", "Lucida Sans Typewriter", "Cascadia Mono", "DejaVu Sans Mono" or "Liberation Mono".
:::
:::tip[]
***Series.Title.Text*** property can help to identify the object under DataCursor. From version 12.5 there is no need to know specific series type. It is enough to cast to the base class of View (like *SeriesBaseXY*, *SeriesBase3D* or *SeriesBaseRound*) and call ***series.GetTitleText()*** method.
:::
### Simple ResultTable (XY)
In this example, ***ResultTable*** is simplified to bare minimum.
```csharp
// subscribing to event
_chart.ViewXY.DataCursor.Visible = true;
_chart.ViewXY.DataCursor.ChangeResultContent += ChangeResultContent;
_chart.ViewXY.DataCursor.ShowColorIndicator = false;
// DataCursor event handler
private void ChangeResultContent(object sender, ViewXYDataCursorResultTableFormatEventArgs e)
{
PointLineSeries pls = e.Series as PointLineSeries;
if (pls == null) return;
// Minimalistic output.
e.ResultContent = String.Format("{0,4:0.0}°C {1,5:0.00}", e.Y, e.X);
}
```

*DataCursor example, ResultTable-Simple.*
### GeoMap ResultTable (XY)
In this example, ***ResultTable*** shows [geographical map](/docs/inDetail/geographic-maps.md) coordinates. Note, that monospaced font is used.
```csharp
// subscribing to event
_chart.ViewXY.DataCursor.Visible = true;
_chart.ViewXY.DataCursor.ChangeResultContent += ChangeResultContent;
// For multi-line Result-string it is better to use monospaced fonts for nice alignments.
// For example, "Courier New", "Lucida Sans Typewriter", "Cascadia Mono", "DejaVu Sans Mono" or "Liberation Mono".
_chart.ViewXY.DataCursor.Results.DataRowFont = new WpfFont("Courier New", 14);
// DataCursor event handler
private void ChangeResultContent(object sender, ViewXYDataCursorResultTableFormatEventArgs e)
{
FreeformPointLineSeries series = e.Series as FreeformPointLineSeries;
if (series == null) return;
// For multi-line string it is better to use monospaced fonts for nice alignments.
// Following composite format string titles to the left and values to the right,
// Each with preferred formatted field width.
string formatString =
"{0}\n" + // Title
"{1,-5}{2,14}\n" + // Lon
"{3,-5}{4,14}"; // Lat
string value1 = FormatAsMapCoordinate(e.X, true);
string value2 = FormatAsMapCoordinate(e.Y, false);
e.ResultContent = String.Format(formatString,
series.Title.Text,
"Lon:", value1,
"Lat:", value2);
}
private static string FormatAsMapCoordinate(double dVal, bool longitude)
{
string postFix = longitude ? " E" : " N";
if (dVal < 0)
{
dVal = -dVal;
postFix = longitude ? " W" : " S";
}
int iDegreesIntegerPart = (int)dVal;
double dMinutes = (dVal - iDegreesIntegerPart) * 60.0;
int iMinutesIntegerPart = (int)dMinutes;
double dSeconds = (dMinutes - iMinutesIntegerPart) * 60.0;
int iSeconds = (int)(dSeconds + 0.5);
//Fix inaccurate values
if (iSeconds == 60)
{
iMinutesIntegerPart++;
iSeconds = 0;
}
if (iMinutesIntegerPart == 60)
{
iDegreesIntegerPart++;
iMinutesIntegerPart = 0;
}
return string.Format("{0}°{1:00}'{2:00}\"", iDegreesIntegerPart, iMinutesIntegerPart, iSeconds) + postFix;
}
```

*DataCursor example, ResultTable-GeoMap.*
### Heatmap ResultTable (XY)
In this example, ***ResultTable*** shows [IntesityGridSeries](/docs/inDetail/IntensityGridSeries.md) values.
```csharp
// subscribing to event
_chart.ViewXY.DataCursor.Visible = true;
_chart.ViewXY.DataCursor.ChangeResultContent += ChangeResultContent;
// DataCursor event handler
private void ChangeResultContent(object sender, ViewXYDataCursorResultTableFormatEventArgs e)
{
IntensitySeriesBase series = (IntensitySeriesBase)e.Series;
if (series == null) return;
string formatString =
"{0}\n" +
" {1,-12}{2,8:0.00} {3}\n" +
" {4,-12}{5,8:0.00} {6}\n" +
" Value:{7,16:0.00}";
double value1 = e.X;
double value2 = e.Y;
double value3 = e.Value;
Color color = e.Color;
String strSeriesTitle = series.Title.Text;
String strXAxisTitle = _chart.ViewXY.XAxes[series.AssignXAxisIndex].Title.Text + ":";
String strYAxisTitle = _chart.ViewXY.YAxes[series.AssignYAxisIndex].Title.Text + ":";
String strXAxisUnits = _chart.ViewXY.XAxes[series.AssignXAxisIndex].Units.Text;
String strYAxisUnits = _chart.ViewXY.YAxes[series.AssignYAxisIndex].Units.Text;
e.ResultContent = String.Format(formatString,
strSeriesTitle,
strXAxisTitle, value1, strXAxisUnits,
strYAxisTitle, value2, strYAxisUnits, value3);
}
```

*DataCursor example, ResultTable-Heatmap.*
### ResultTable with multiple series
In this example, ***ResultTable*** shows combined result from all series at the same point-index as primary tracked series.
```csharp
// subscribing to event
_chart.ViewXY.DataCursor.Visible = true;
_chart.ViewXY.DataCursor.ChangeResultContent += ChangeResultContent;
viewXY.DataCursor.ShowColorIndicator = false; // we will try to show all Series in the same table
// DataCursor event handler
private void DataCursor_ChangeResultContent(object sender, ViewXYDataCursorResultTableFormatEventArgs e)
{
PointLineSeries series = e.Series as PointLineSeries;
if (series == null) return;
int iIndex = (int)e.PrimaryDataIndex;
AxisX axisX = _chart.ViewXY.XAxes[0];
AxisY axisY = _chart.ViewXY.YAxes[0];
if (e.X <= series.Points[iIndex].X)
--iIndex;
// Show values of all series from same index.
string strResult = "Y-Values at X: " + e.X.ToString("0.00") + "\n\n";
double startX = series.Points[iIndex].X;
double endX = series.Points[iIndex + 1].X;
double dDiffX = endX - startX;
float[] coordsX = axisX.ValuesToCoords(new double[] { startX, endX }, false);
double dXCoeff = (e.PointerCoordX - coordsX[0]) / (coordsX[1] - coordsX[0]);
foreach (PointLineSeries pointLineSeries in _chart.ViewXY.PointLineSeries)
{
if (iIndex - 1 < pointLineSeries.Points.Length)
{
double startY = pointLineSeries.Points[iIndex].Y;
double endY = pointLineSeries.Points[iIndex + 1].Y;
double dDiffY = endY - startY;
double value = startY + dXCoeff * dDiffY;
strResult += pointLineSeries.Title.Text + ": " + value.ToString("0.00") +"\n";
}
}
strResult = strResult.TrimEnd('\n');
e.ResultContent = strResult;
}
```

*DataCursor example, ResultTable with multiple series.*
### ResultTable 3D
In this example, ***ResultTable*** shows multi-line 3D results arrangement.
```csharp
// subscribing to event
_chart.View3D.DataCursor.Visible = true;
_chart.View3D.DataCursor.ChangeResultContent += DataCursor_ChangeResultContent;
// DataCursor event handler
private void DataCursor_ChangeResultContent(object sender, View3DDataCursorResultTableFormatEventArgs e)
{
PointLineSeries3D series = e.Series as PointLineSeries3D;
if (series == null) return;
string formatString = "{0}\n {1,-12}{2,8:0.00} {3}\n {4,-12}{5,8:0.00} {6}\n {7,-12}{8,8:0.00} {9}";
double value1 = e.X;
double value2 = e.Y;
double value3 = e.Z;
String strSeriesTitle = series.Title.Text;
String strXAxisTitle = _chart.View3D.XAxisPrimary3D.Title.Text + ":";
String strYAxisTitle = _chart.View3D.YAxisPrimary3D.Title.Text + ":";
String strZAxisTitle = _chart.View3D.ZAxisPrimary3D.Title.Text + ":";
String strXAxisUnits = _chart.View3D.XAxisPrimary3D.Units.Text;
String strYAxisUnits = _chart.View3D.YAxisPrimary3D.Units.Text;
String strZAxisUnits = _chart.View3D.ZAxisPrimary3D.Units.Text;
e.ResultContent = String.Format(formatString, strSeriesTitle, strXAxisTitle, value1, strXAxisUnits, strYAxisTitle, value2, strYAxisUnits, strZAxisTitle, value3, strZAxisUnits);
}
```

*DataCursor example, ResultTable 3D.*
### ResultTable Polar line
In this example, ***ResultTable*** shows multi-line Polar results arrangement. Note, that monospaced font is used.
```csharp
// subscribing to event
_chart.ViewPolar.DataCursor.Visible = true;
_chart.ViewPolar.DataCursor.ChangeResultContent += DataCursor_ChangeResultContent;
_chart.ViewPolar.DataCursor.ShowResultTable = true;
// For multi-line Result-string it is better to use monospaced fonts for nice alignments.
// For example, "Courier New", "Lucida Sans Typewriter", "Cascadia Mono", "DejaVu Sans Mono" or "Liberation Mono".
_chart.ViewPolar.DataCursor.Results.DataRowFont = new WpfFont("Cascadia Mono", 16.0, "16", false, false);
// DataCursor event handler
private void DataCursor_ChangeResultContent(object sender, ViewPolarDataCursorResultTableFormatEventArgs e)
{
PointLineSeriesPolar pls = e.Series as PointLineSeriesPolar;
if (pls == null) return;
// For multi-line string it is better to use monospaced fonts for nice alignments.
// Following composite format string titles to the left and values to the right,
// Each with preferred formatted field width.
string formatString =
"{0}\n" +
" {1,-12}{2,8:0.00} {3}\n" +
" {4,-12}{5,8:0.00} {6}";
double angle = e.Angle;
double amplitude = e.Amplitude;
String strSeriesTitle = pls.Title.Text;
AxisPolar axis = _chart.ViewPolar.Axes[0];
String strAngleTitle = "Angle:";
String strAngleUnits = "°";
String strAmplitudeTitle = "Amplitude:";
String strAmplitudeUnits = "Å";
e.ResultContent = String.Format(formatString,
strSeriesTitle,
strAngleTitle, angle, strAngleUnits,
strAmplitudeTitle, amplitude, strAmplitudeUnits);
}
```

*DataCursor example, ResultTable Polar line.*
### ResultTable Polar heatmap
In this example, ***ResultTable*** shows multi-line results arrangement for [IntensityGridSeriesPolar](/docs/inDetail/intensity-grid-polar.md). Note, that monospaced font is used.
```csharp
// subscribing to event
_chart.ViewPolar.DataCursor.Visible = true;
_chart.ViewPolar.DataCursor.ChangeResultContent += DataCursor_ChangeResultContent;
_chart.ViewPolar.DataCursor.ShowResultTable = true;
// For multi-line Result-string it is better to use monospaced fonts for nice alignments.
// For example, "Courier New", "Lucida Sans Typewriter", "Cascadia Mono", "DejaVu Sans Mono" or "Liberation Mono".
_chart.ViewPolar.DataCursor.Results.DataRowFont = new WpfFont("DejaVu Sans Mono", 16.0, "16", false, false);
// DataCursor event handler
private void DataCursor_ChangeResultContent(object sender, ViewPolarDataCursorResultTableFormatEventArgs e)
{
IntensityGridSeriesPolar pls = e.Series as IntensityGridSeriesPolar;
if (pls == null) return;
// For multi-line string it is better to use monospaced fonts for nice alignments.
// Following composite format string titles to the left and values to the right,
// Each with preferred formatted field width.
string formatString =
"{0}\n" +
" {1,-12}{2,8:0.00} {3}\n" +
" {4,-12}{5,8:0.00} {6}\n" +
" {7,-12}{8,8:0.00} {9}";
double angle = e.Angle;
double amplitude = e.Amplitude;
double value = e.Value;
String strSeriesTitle = pls.Title.Text;
AxisPolar axis = _chart.ViewPolar.Axes[0];
String strAngleTitle = "Angle:";
String strAngleUnits = "°";
String strAmplitudeTitle = "Amplitude:";
String strAmplitudeUnits = "Å";
String strValueTitle = "Value:";
String strValueUnits = "";
e.ResultContent = String.Format(formatString,
strSeriesTitle,
strAngleTitle, angle, strAngleUnits,
strAmplitudeTitle, amplitude, strAmplitudeUnits,
strValueTitle, value, strValueUnits);
}
```

*DataCursor example, ResultTable Polar heatmap.*
### ResultTable Smith line
In this example, ***ResultTable*** shows multi-line Smith results arrangement. Note, that monospaced font is used.
```csharp
// subscribing to event
_chart.ViewSmith.DataCursor.Visible = true;
_chart.ViewSmith.DataCursor.ShowResultTable = true;
_chart.ViewSmith.DataCursor.ChangeResultContent += DataCursor_ChangeResultContent;
// For multi-line Result-string it is better to use monospaced fonts for nice alignments.
// For example, "Courier New", "Lucida Sans Typewriter", "Cascadia Mono", "DejaVu Sans Mono" or "Liberation Mono".
_chart.ViewSmith.DataCursor.Results.DataRowFont = new WpfFont("Liberation Mono", 16.0, "16", false, false);
// DataCursor event handler
private void DataCursor_ChangeResultContent(object sender, ViewSmithDataCursorResultTableFormatEventArgs e)
{
PointLineSeriesSmith pls = e.Series as PointLineSeriesSmith;
if (pls == null) return;
// For multi-line string it is better to use monospaced fonts for nice alignments.
// Following composite format string titles to the left and values to the right,
// Each with preferred formatted field width.
string formatString =
"{0}\n" +
" {1,-12}{2,8:0} {3}\n" +
" {4,-12}{5,8:0} {6}\n" +
" {7,-12}{8,8:0} {9}";
double resistance = e.Re;
double reactance = e.Im;
string strSeriesTitle = pls.Title.Text;
string freqUnits = "Hz";
object tag = e.Tag;
double dTag = (int)e.Tag;
if (1000 <= dTag)
{
dTag /= 1000;
freqUnits = "kHz";
tag = dTag.ToString("0");
}
string strResistanceTitle = "Resistive:";
string strResistanceUnits = "Ω";
string strReactanceTitle = reactance < 0 ? "Capacitive:" : "Inductive:";
string strTagTitle = "Frequency:";
e.ResultContent = String.Format(formatString,
strSeriesTitle,
strResistanceTitle, resistance, strResistanceUnits,
strReactanceTitle, Math.Abs(reactance), strResistanceUnits,
strTagTitle, tag, freqUnits);
}
```

*DataCursor example, ResultTable Smith line.*
### Multiple ResultTable or overlapping series
If line-series overlap and DataCursor is tracking such overlapping points/lines, then DataCursor's ResultTable will have more information than usual. Standard ResultTable would show multiple title and color indicators followed by one set of values.

*DataCursor example, overlapping series (default rendering).*
In contrast, for customized ResultTable each series raise ***ChangeResultContent*** event and ResultContent strings will be stacked. It can be avoided by canceling other than first events. For example, one can create list of result-strings, which emptied before rendering and filled in ***ChangeResultContent*** event handler. If that list is not empty during ***ChangeResultContent*** event (and new string is same as one in the list), then just exist event handler.
```csharp
_chart.BeforeRendering += _chart_BeforeRendering;
List _listResult = new List();
private void _chart_BeforeRendering(object sender, BeforeRenderingEventArgs e)
{
_listResult.Clear();
}
private void ChangeResultContent(object sender, ViewXYDataCursorResultTableFormatEventArgs e)
{
PointLineSeries pls = e.Series as PointLineSeries;
if (pls == null) return;
string strResults = String.Format("{0,4:0.0}°C {1,5:0.00}", e.Y, e.X);
if (_listResult.Count > 0 && strResults.Equals(_listResult[0]))
return;
e.ResultContent = strResults;
_listResult.Add(e.ResultContent);
}
```
---
## How to debug and troubleshoot
Sooner or later during charting application development user may notice that something is not right. Either chart produce unexpected visualization, show some exception or application even crash. It could be various reasons for those problems and this page describe how to troubleshoot them.
When facing unexpected problem, the first thing user should do is to verify that application's design follow guideline:
- No charting [object sharing](/inDetail/sharing-objects.md);
- Correct [dispose pattern](/inDetail/dispose-pattern.md);
- Chart properties updated in correct [thread](/how-to/multithreaded-applications.md);
- [Graphic drivers](#Graphic-drivers-issue) are up-to-date;
- Application can access amount of [memory required](#OutOfMemoryException);
### ChartMessage event handler
From version 8.4 onwards LightningChart will send messages from the chart to the user through **ChartMessage** event. The messages can contain notifications about chart performance, incorrect usage, warnings or errors. Define a handler for **chart.ChartMessage** event to listen to the messages. The event contains a **ChartMessageInfo** struct, which holds the message’s information.
**ChartMessageInfo**’s **MessageSeverity** property tells how severe the message is. Messages can be filtered based on their severity. Possible severity levels for messages are:
- **Debug** - Debug information which usually is not interesting to the user and no action is required.
- **Information** – An incorrect usage of a chart, for example using an invalid property setting, has happened which should not impact chart performance. User action is typically not required.
- **Warning** – Some incorrect usage of chart, for instance using a disposed object, has happened which might cause some minor problems with the chart such as performance loss. User action might be required.
- **RecoverableError** – An error has occurred from which the chart should have recovered. User must listen to ChartMessage events or messages with this severity will be thrown as exceptions.
- **UnrecoverableError** – An error has occurred from which the chart couldn’t recover. Might indicate an incoming exception. User must listen to ChartMessage events or messages with this severity will be thrown as exceptions.
- **Critical** – A critical error has occurred in the chart which will always be thrown as an exception.
**MessageType** property explains the basic type of the message while **Details** property has more specific information about it. All the possible message types can be found in **MessageType** enum located in LightningChart namespace.
Unwanted messages can be filtered out by changing the **chart.Options.ChartMessageMinimumLevel** property value. The property allows only messages of the set minimum level and higher to be sent through the event system. It is set to **MessageSeverity.Warning** by default.
Exceptions are thrown as **ChartException** objects, which contains **ExceptionInfo** struct with detailed information about the exception similar to **ChartMessage** events. In some cases, the chart may throw exceptions of other types, such as a rendering engine exception. If user wants the chart to raise an exception on all messages with a severity level of **MessageSeverity.Warning** or higher, **chart.Options.ThrowChartExceptions** property needs to be set **true** (default is **false**).
It is recommended to always subscribe to **ChartMessage** event to be notified about errors in the chart and possible exceptions from unlistened messages. In case of having any problems with the chart and support for it is needed, please ensure there is a working message/exception handler in the application, log the **ChartMessages** and include them in your support request.
Here is the example of event handler:
```csharp
///
/// Check internal message for debugging purposes
///
///
private void _chart_ChartMessage(ChartMessageInfo info)
{
string msgInfo = info.ToString();
StringBuilder sb = new StringBuilder();
LightningChart chart = info.Chart;
FileStream fs = null;
string _engineName = chart.GetRenderDeviceInfo().EngineName;
// save INFO string to Logs =>
try
{
fs = new FileStream("LightningChart_LOG.txt", FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
using (StreamWriter writer = new StreamWriter(fs, Encoding.Default))
{
string dateTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.f");
sb.Append(dateTime + "\t" + _engineName);
sb.AppendLine(msgInfo);
// write to file
System.Diagnostics.Debug.WriteLine(sb.ToString());
writer.WriteLine(sb.ToString());
}
}
catch (Exception ex)
{
string message = string.Format("Failed to write to file \n Exception: {0} \n ChartMessage: {1}"
, ex.Message, info.Details);
System.Diagnostics.Debug.WriteLine(message);
Dispatcher.BeginInvoke(new Action(() => MessageBox.Show(message)));
}
finally
{
if (fs != null)
fs.Dispose();
}
}
```
In addition, by enabling ***CustomMessageOptions. SetChartMessageAsCustomMessage*** property user can pass all internal ChartMessage to [CustomMessage box/property](/docs/inDetail/custom-message.md).
### OutOfMemoryException
User should make sure that application can access amount of memory required. If user takes away memory from any application, it will freeze and crash. If a lot of points are sent to chart, it may be more than some default settings allows.
First, it maybe good idea to check amount of physical memory and the dynamic of its usage with user's application running. The easiest way to do it is to use Task Manager. User can get even more information with [Process Explorer](https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer). Things to check:
- how much free memory available in system,
- how much is used by charting application.
- how memory-usage grows when data is loaded to the LightningChart?
Checking for memory leaks during prolonged running of application is also important.
:::info
Note about memory leakage. .NET memory is managed by Garbage Collector (GC) automatically. However, the activity of GC is not straightforward: user cannot be sure will it make final cleaning in next second or next minute. It all depend on intensity of application, available computer resources etc.
:::
If user constantly sees memory utilization close to 100%, then it is sign that computer don't have enough free memory. For smooth interaction with application user should install more RAM memory. Otherwise it will always be freezing. Optimizing chart/application (to use less memory) is another path.
Next step is to estimate the maximum amount of memory required by app. If application is somewhat demanding, then project’s build target can not be x86. This will limit applications memory to 1-2 GB, which may be not enough. For memory hungry app, it should be 'Any CPU' or '64-bit' build target (checkbox ‘prefer 32-bit’ is cleared).

*Project properties in Visual Studio*
Finally, user should be aware that .NET has default limits: single array size could not be bigger than 2 GB or maximum number of elements in an array is UInt32. MaxValue (2,147,483,591). Fortunately this is could be solved with .NET Framework 4.5 (and above) and configuration attribute ([here](https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) is the description). The following *app.config* file snippet shows how to enable this feature for a .NET Framework application.
```csharp
```
### Other debugging tools
Task Manager or [Process Explorer](https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer) would be good starting point for the any investigation.

*Process Explorer screenshot*
Process Explorer is very diverse tool, which allow to explore many aspect of application in question. For example, it can show CPU and GPU load, RAM and GPU memory utilization, .NET assemblies loaded for process and much more. Therefore, it is a good tool for identifying bottleneck of app (e.g. freezing due to 100% load of CPU or GPU, excess memory usage etc.) as well as for understanding how much computer resource app needs (and should hardware need to be upgraded).
Visual Studio comes with [Performance Profiler](https://learn.microsoft.com/en-us/visualstudio/profiling/?view=vs-2022) - profiling and diagnostics tools help you diagnose memory and CPU usage and other application-level issues. With these tools, you can accumulate performance data while you run your application.
There are more specialized tools for profiling application.
### Graphic drivers issue
LightningChart allows variety of GPU choices, even virtual/simulated once. However, rendering does rely on graphic drivers (DirectX support) and their quality maybe not always perfect. Bad graphic drivers may manifest as wrong line size, missing or extra object in the chart, extreme memory utilization or even crash of application.
:::note
The example how severe graphic drivers issue could be described [here](https://lightningchart.com/news/intel-11-cpu-and-iris-xe-graphics-problems-and-workarounds/).
:::
There are ways to safeguard application from unexpected graphic drivers issue. Basically end-user of application should have possibility to switch between graphic drivers - similar way like following testing is done.
But first step is to establish that problem seen in charting application is due to graphic drivers issue. Different GPU may have different problem, but universal way to check is to change **Chart. [ChartRenderOptions](/docs/beginners%20guide/chart-render-options.md). DeviceType** (in *WindowsForms* **Chart. [RenderOptions](/docs/beginners%20guide/chart-render-options.md). DeviceType**) property (compare between HardwareOnlyD11, HardwareOnlyD9, and SoftwareOnlyD11 options). If user sees that application is working with one rendering device but not other (especially if it is working with SoftwareOnlyD11) – then it is good indication of graphic drivers problems.
:::note
DeviceType *SoftwareOnlyD11* uses [Windows Advanced Rasterization Platform (WARP)](https://learn.microsoft.com/en-us/windows/win32/direct3darticles/directx-warp).
:::
Obviously solutions for such problem:
- check and update graphic drivers from manufacture page;
- install another graphic card;
- set LightningChart to use another graphic card with **chart. ChartRenderOptions. GPUPreference** property (in *WindowsForms* **Chart. RenderOptions. GPUPreference**)
:::note
If you verified that problem is graphic drivers, but update does not solve the issue, please let us know. In the report please include test application and also DxDiag (DirectX diagnostic tool) output as TXT file. If graphic hardware is still supported, we maybe able to request the fix from manufacture, if many user face same problem.
:::
### How to report error to LightningChart library developers
If none of above helped to resolve your problem please [contact us](/docs/getting%20started/support.md).
It is good idea to check is LightningChart .NET Demo (*Interactive Examples App*) behave similar and problem could be reproduced there. Find similar example in Demo and [change properties](/beginners%20guide/ObjectModel.md) to reproduce problem you see. If it is not enough, try extracting example as standalone application and modify code.
Send the detailed description of your problem, test application and replication steps to us. This helps in the resolution of the problem in the fastest way possible.
---
## How to draw rectangle (ViewXY)?
Sometimes there a need to draw rectangle on the chart with mouse-cursor. The purpose may be to select points in the range or just modify zoom behavior.
You can draw rectangle with mouse-cursor by creating ***Annotation*** and using Chart’s mouse events (e.g. ***MouseDown***, ***MouseMove*** and ***MouseUp***). Basic idea is to create ***Annotation*** on mouse down event, then change size of annotation-rectangle while mouse-cursor is dragged. Once mouse button is released, user take note of rectangle location and do action required for selection.
In the example below Annotation-rectangle is used to modify/replace default chart 'ZoomRectangle' behavior.
We start, first with disabling default chart 'ZoomRectangle' behavior, and subscribing to mouse events:
```csharp
view.ZoomPanOptions.DevicePrimaryButtonAction = UserInteractiveDeviceButtonAction.None;
//Event to start drawing
_chart.PreviewMouseLeftButtonDown += _chart_MouseDown;
// event of actual drawing
_chart.MouseMove += _chart_MouseMove;
//Event to stop drawing
_chart.PreviewMouseLeftButtonUp += _chart_MouseUp;
```
:::info[Note]
If chart has many objects (like line-series or intensity-series), mouse-event may be handled by them (if ***AllowUserInteraction*** property is enabled for them). Therefore, to ensure that rectangle drawing will be handled properly, user may need to subscribe to ***PreviewMouse...*** events.
:::
Next application needs few global variable to connect events handlers.
```csharp
AnnotationXY _annZoomRectangle = null;
PointDouble _mouseDownValues = new PointDouble(0, 0);
bool _bDrawingRectangle = false;
```
***MouseDown*** and ***MouseMove*** event handlers are used to create and resize ***Annotation*** rectangle.
```csharp
///
/// Start drawing Annotation-rectangle over the chart
///
/// Event sender
/// Mouse arguments
private void _chart_MouseDown(object sender, MouseButtonEventArgs e)
{
ViewXY viewXY = _chart.ViewXY;
AxisX xAxis = viewXY.XAxes[0];
AxisY yAxis = viewXY.YAxes[0];
System.Windows.Point position = e.GetPosition(this);
/******************************************************************************/
/* In WPF mouse-cursor position is received in DIPs. However, */
/* In WinForms chart mouse-event argument supply coordinates in screen PX. */
/* Therefore, coordinates<->value conversion methods should set flag */
/* UseDIP accordingly (UseDIP=true for WPF, UseDIP=false for WinForms). */
/******************************************************************************/
//Convert screen coordinates to axis values, and set annotation to point that place
double xValue, yValue;
xAxis.CoordToValue((int)position.X, out xValue, false, true);
yAxis.CoordToValue((int)position.Y, out yValue, true);
//Disable rendering
_chart.BeginUpdate();
AnnotationXY annotation = new AnnotationXY(_chart.ViewXY, _chart.ViewXY.XAxes[0], _chart.ViewXY.YAxes[0])
{
Tag = "ZoomRectangle",
Style = AnnotationStyle.Rectangle,
Shadow = new Shadow() { Visible = false },
TextStyle = new AnnotationTextStyle() { Visible = false },
BorderVisible = true,
BorderLineStyle = new LineStyle() { Width = 1, Pattern = LinePattern.Dot },
Fill = new Fill() { Style = RectFillStyle.ColorOnly, Color = Color.FromArgb(30, 255, 165, 0), GradientFill = GradientFill.Solid },
AllowUserInteraction = false,
Sizing = AnnotationXYSizing.AxisValuesBoundaries,
AxisValuesBoundaries = new BoundsDoubleXY(xValue, xValue, yValue, yValue),
};
_chart.ViewXY.Annotations.Add(annotation);
_annZoomRectangle = annotation;
_mouseDownValues = new PointDouble(xValue, yValue);
//Allow rendering
_chart.EndUpdate();
_bDrawingRectangle = true;
}
///
/// Actual drawing by moving the mouse
///
/// Event sender
/// Mouse arguments
private void _chart_MouseMove(object sender, MouseEventArgs e)
{
if (_bDrawingRectangle)
{
ViewXY viewXY = _chart.ViewXY;
AxisX xAxis = viewXY.XAxes[0];
AxisY yAxis = viewXY.YAxes[0];
System.Windows.Point position = e.GetPosition(this);
/******************************************************************************/
/* In WPF mouse-cursor position is received in DIPs. However, */
/* In WinForms chart mouse-event argument supply coordinates in screen PX. */
/* Therefore, coordinates<->value conversion methods should set flag */
/* UseDIP accordingly (UseDIP=true for WPF, UseDIP=false for WinForms). */
/******************************************************************************/
//Convert screen coordinates to axis values,
double xValue, yValue;
xAxis.CoordToValue((int)position.X, out xValue, false, true);
yAxis.CoordToValue((int)position.Y, out yValue, true);
//Disable rendering
_chart.BeginUpdate();
_annZoomRectangle.AxisValuesBoundaries.XMin = Math.Min(xValue, _mouseDownValues.X);
_annZoomRectangle.AxisValuesBoundaries.XMax = Math.Max(xValue, _mouseDownValues.X);
_annZoomRectangle.AxisValuesBoundaries.YMin = Math.Min(yValue, _mouseDownValues.Y);
_annZoomRectangle.AxisValuesBoundaries.YMax = Math.Max(yValue, _mouseDownValues.Y);
_chart.EndUpdate();
}
}
```
Finally ***MouseUp*** event is used to do 'selection-action'. In this example, Annotation-rectangle is removed and new range is applied for X- and Y-axis.
```csharp
///
/// Stop drawing by mouse.
///
/// Event sender
/// Mouse button event arguments
private void _chart_MouseUp(object sender, MouseButtonEventArgs e)
{
double xMin = _annZoomRectangle.AxisValuesBoundaries.XMin;
double xMax = _annZoomRectangle.AxisValuesBoundaries.XMax;
double yMin = _annZoomRectangle.AxisValuesBoundaries.YMin;
double yMax = _annZoomRectangle.AxisValuesBoundaries.YMax;
ViewXY viewXY = _chart.ViewXY;
AxisX xAxis = viewXY.XAxes[0];
AxisY yAxis = viewXY.YAxes[0];
// check how big rectangle in PX, do nothing if it is too small
float[] xCoord = xAxis.ValuesToCoords(new double[] {xMin, xMax}, false);
float[] yCoord = yAxis.ValuesToCoords(new double[] {yMin, yMax}, false);
bool bApplyZoom = false;
float fZoomThreshold = 10;
if (Math.Abs(xCoord[0]- xCoord[1]) >= fZoomThreshold && Math.Abs(xCoord[0] - xCoord[1]) >= fZoomThreshold)
{
bApplyZoom = true;
}
_bDrawingRectangle = false;
_chart.BeginUpdate();
// dispose Annotation
_chart.ViewXY.Annotations.Remove(_annZoomRectangle);
_annZoomRectangle = null;
if (bApplyZoom)
{
yAxis.SetRange(yMin, yMax);
xAxis.SetRange(xMin, xMax);
}
_chart.EndUpdate();
}
```
:::info[Tip]
Similar idea can be used elsewhere. For example, in [ViewPolar](/docs/beginners%20guide/ViewPolar-series/polar_chart.md) one can draw with mouse-cursor arc-shape with ***Sector*** class. [Our Demo](/docs/getting%20started/RunningDemo.md) demonstrates that particular behavior and points selection in *ExampleScatterPolarMouseSelecting*.
:::
---
## Hardware tips
To get the absolute maximum performance for a LightningChart application, the computer hardware must be powerful. In many applications, display adapter power is more important than CPU power. Use as modern display adapter as possible. DirectX 9.0c level display adapters work. ‘c’ comes from DirectX Shader Model 3, which is required by some effects.
***GetRenderDeviceInfo()*** method can be called to find out if some feature is not supported by the used display adapter. Especially, if the returned information states that ***FastVertexFormat*** is not supported, it is a bad thing for performance.
:::note
LightningChart is a GPU hardware accelerated chart. Without a good GPU, the performance may be much lower than in optimal case. A good resource to compare the performance of different GPUs is **PassMark’s Video Card Benchmarks** (http://www.videocardbenchmark.net/gpu_list.php). A video card having 10x better score than others, can be also 10 times faster in LightningChart use, but overall difference in refresh rate is rarely that great, since another computer hardware may become a bottleneck.
:::
:::tip
If user is unsure about hardware needs, then creating proof-of-concept application and measuring its performance can be a way to go. Extracting example from [our Demo](/docs/getting%20started/RunningDemo.md) can be the fastest way to build such POC.
[Process Explorer](https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer) can give information about GPU, CPU and memory. Visual Studio has some Diagnostic tools as well. Based on those performance measurements, user would know, what are the bottlenecks of application.
Some of those bottlenecks could be resolved with hardware, others could be discussed with LightningChart developers to find optimal approach of library usage.
:::
---
## Intensity series tips
Applies to: [IntensityGridSeries](/docs/inDetail/IntensityGridSeries.md), [IntensityMeshSeries](/docs/inDetail/IntensityMeshSeries.md)
- Change the ***Optimization*** property of the series to *StaticData*, if the data won’t be updated continuously. *DynamicData* is better choice if data is changed many times per second.
- Use ***Optimization***: *DynamicValuesData* to update only the ***Value*** fields of ***Data*** array’s *IntensityPoint* structures, and call ***InvalidateValuesDataOnly()*** method to update the chart. This way, the update is much faster as the geometry of the series is not recalculated. This is only intended to be used in applications where the data X and Y values of the nodes stay in the same place, for example in thermal imaging solutions.
Applies to: [IntensityGridSeries](/docs/inDetail/IntensityGridSeries.md)
- For high-resolution thermal imaging applications, enable ***PixelRendering*** for ***IntensityGridSeries***.
- For rapidly updating data sets, use ***SetValuesData*** and ***SetColorsData*** methods instead of ***Data*** property to save memory and to improve performance.
:::info
To see 'tip in action' as examples *ChromaticityDiagram*, *Spectrogram2D*, *IntensityMeshCircle* and *HighResolutionSpectrogram* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## How to limit zooming/panning to specific Axis value
There is no property, which could limit Axis range, but you can use event handler to control it.
If you use normal zooming functionality (with mouse wheel or drawing rectangle), then ***Chart.ViewXY.BeforeZooming*** event is fired. Event argument tells new and old Axes ranges. Therefore, you can compare value and Cancel zooming (there is flag for that in event handler).
It also possible to use ***Chart.ViewXY.Zoomed += View_Zoomed*** event handler to set specific values. For example in *ExampleAreaXY* from Demo XAxis is prevented from zoom-out in certain range:
```csharp
///
/// Horizontal zooming logic.
///
/// ViewXY.
/// Event arguments.
private void View_Zoomed(object sender, ZoomedXYEventArgs e)
{
double min = 0;
double max = 1000;
ViewXY view = _chart.ViewXY;
double currentMin = view.XAxes[0].Minimum;
double currentMax = view.XAxes[0].Maximum;
if (min > currentMin || max < currentMax)
{
if (min > currentMin)
currentMin = min;
if (max < currentMax)
currentMax = max;
_chart.BeginUpdate();
view.XAxes[0].SetRange(currentMin, currentMax);
_chart.EndUpdate();
}
}
```
Alternative and more general is to use ***Axis.RangeChanged*** event handler. This is raised for any panning/zooming event that may happen on the chart. In event handler you can check values and call ***Axis.SetRange()*** with desired limitations. Note that later method will initiate range change and new ***Axis.RangeChanged*** (therefore, you may want to unsubscribe temporary).
```csharp
private void axisX_RangeChanged(object sender, RangeChangedEventArgs e)
{
double _xMinStopValue = 0;
double _xMaxStopValue = 1000;
double dNewMin = e.NewMin;
double dNewMax = e.NewMax;
// apply Stop values so that zooming/panning could not go outside this range
if (dNewMin < _xMinStopValue)
{
dNewMin = _xMinStopValue;
dNewMax = e.NewMax + _xMinStopValue - e.NewMin;
}
if (_xMaxStopValue < dNewMax)
{
dNewMax = _xMaxStopValue;
if (dNewMin != _xMinStopValue)
{
dNewMin = Math.Max(_xMinStopValue, e.NewMin + _xMaxStopValue - e.NewMax);
}
}
_chart.BeginUpdate();
_chart.ViewXY.XAxes[0].RangeChanged -= axisX_RangeChanged;
_chart.ViewXY.XAxes[0].SetRange(dNewMin, dNewMax);
_chart.ViewXY.XAxes[0].RangeChanged += axisX_RangeChanged;
_chart.EndUpdate();
}
```
---
## How to limit point count (ViewXY)?
While it is possible to add more and more points to chart or line-series almost indefinitely, at some stage it will become impractical and starts to consume too much memory. Especially true for long running real-time/streaming application, where the main interest is to observe/visualize the latest points. Therefore, it is a good idea to have point limiting strategy implemented in the streaming application.
### DropOldSeriesData
ViewXY has property ***DropOldSeriesData*** (and ***DropOldEventMarkers***), which automatically deletes series data (or [event markers](/docs/inDetail/event-markers-XY.md)), whose x value is less than X-axis minimum. By setting this true, user will be able to maintain stable points count (points outside visible axis range will be deleted, when new points are added with ***AddPoints()*** or ***AddSamples()*** methods).
The amount of dropped points can be adjusted with ***Series. ScrollModePointsKeepLevel*** property. It controls how often the draw data is cleared when using X axis scroll mode. Valid range is 1...100. Where 1 frees the draw data and the reconstructs the draw data after every 1/10 scroll page (Page = Axis range Maximum-Minimum). 100 frees the draw data and the reconstructs the draw data after every 100/10 = 10 pages.
:::note
If user will zoom-in XAxis during (and ***DropOldSeriesData*** is enabled) and zoom-out, the line drawn on the chart may be shorted from the left side. This happens due to Axis.Minimum temporary being large value, and therefore, more points will be dropped.
:::
### DeleteSamplesBeforeX / DeletePointsBeforeX
If user needs more flexibility (when and how many points are deleted), and negate zooming issues described in the note above, then ***Series. DeleteSamplesBeforeX()*** method (for *SampleDataBlockSeries* / *SampleDataSeries*) or ***DeletePointsBeforeX()*** method (for other progressive x-value line-series) can be used. When those methods are used, property ***ViewXY. DropOldSeriesData*** should be disabled.
### PointCountLimit
Freeform point line-series (***LiteFreeformLineSeries*** or ***FreeformPointLineSeries***) points are not automatically destroyed even if ***DropOldSeriesData*** is enabled, and the points are scrolled out of current view. To automatically destroy old series points in real-time monitoring solution, use point count limiter. Set ***Series. PointCountLimitEnabled*** = true and set the limit to ***PointCountLimit*** property. If limiter is enabled, the Points array behaves as a ring buffer after the point count limit has been reached. The oldest point from Points array can always be found by retrieving value from ***OldestPointIndex*** (for ***FreeformPointLineSeries***). If needing to read the existing data out of point count limited buffer, use the following method:
- If OldestPointIndex is 0, read from Points[0] till Points[PointCount-1].
- If OldestPointIndex > 0, first read from Points[OldestPointIndex] till Points[PointCountLimit-1]. Then, read from Points[0] till Points[OldestPointIndex-1].
- To directly retrieve the last series point, call ***GetLastPoint()*** method (for ***FreeformPointLineSeries***).
### "Brutal force" approach
Some [line-series XY](/docs/beginners%20guide/ViewXY-series/xy_chart.md) has ***Points*** property/array (or in case of ***SampleDataSeries*** properties ***SamplesDouble / SamplesSingle***), which gets or sets series points. (But not ***BlockSeriesBase*** type or ***LineCollection***).
Therefore, it is possible at any phase of app running to create new array of points and assign to corresponding property. E.g.
```csharp
SeriesPoint[] newPoints = new SeriesPoint[n];
//...create new array
series.Points = newPoints;
```
However, this approach is not very efficient or fast for [scrolling/sweeping XAxis](/docs/inDetail/axis-class-properties.md), especially when array size increase and a lot of copying is required.
:::warning[Note]
When series methods like ***AddPoints()***, ***AddValues()*** or ***AddSamples()*** are used new points are added at the end of array/series. However, to facilitate Real-time monitoring [scrolling](/docs/inDetail/axis-class-properties.md), those methods actually increase points-array size more than actual points added. This is to reduce the need to resize array next time points are added. Therefore, user shouldn't blindly copy all old Points to newPoints. Instead, ***Series. PointCount*** should always be used, as it tells which points are 'real' from the start of array.
:::
---
## Line series tips
Here is the list of tips to improve performance. Typically, there is trade-off between performance improvement and other features, or some extra requirement for the data is attached. Therefore, user should balance all the needs carefully.
- When using a line series, use [SampleDataBlockSeries](/docs/inDetail/SampleDataBlockSeries.md) or [SampleDataSeries](/docs/inDetail/SampleDataSeries.md), if it is suitable for the application (see [Line-series comparison](/docs/inDetail/comparing-line-series.md)). It is the fastest one to draw and doesn’t need as much memory as other line series types.
- If X-values are not in progressively increasing order at fixed interval, prefer 'progressive' series (like [LiteLineSeries](/docs/inDetail/LiteLineSeries.md) or [PointLineSeries](/docs/inDetail/PointLineSeries.md)) over assumption free series (like [LiteFreeformLineSeries](/docs/inDetail/LiteFreeformLineSeries.md) or [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md)). Use “Lite” versions of these series if minimal visual customization is needed. See [Line-series comparison](/docs/inDetail/comparing-line-series.md).
- Set ***PointsVisible*** property false, if the data points don’t have to be visible.
- Set line width to 1 with ***LineStyle.Width*** property (“Lite” are less sensitive to line width).
- Use solid line style by setting [LineStyle.Pattern](/docs/inDetail/line-style.md) to *Solid*.
- Disable [anti-aliasing](/docs/inDetail/anti-aliasing.md) by setting line series ***LineStyle.AntiAliasing*** to *None* and set chart’s ***AntiAliasLevel*** to 0.
- Disable all mouse interactivity by setting ***AllowUserInteraction*** of a series to false. Alternatively, disable whole chart’s mouse interactivity by setting ***chart.Options.AllowUserInteraction*** to false.
- Hide the legend box if there is no need for it. ***series.ShowInLegendBox*** -property can also be disabled for all the series. These work especially when there are a lot of series in a chart.
```csharp
chart.ViewXY.LegendBoxes[0].Visible = false;
chart.ViewXY.PointLineSeries[0].ShowInLegendBox = false;
```
---
## Maps tips
Applies to: [ViewXY.Maps](/docs/inDetail/geographic-maps.md)
- Set ***ViewXY.Maps.Optimization*** to *CombinedLayers* in a typical situation where the X and Y axis ranges are kept the same, and other data is presented over the maps. This allows the map layers to be rendered into the same buffer image, resulting into more efficient rendering.
- ***Set ViewXY.Maps.Optimization*** to *None*, if the map titles should be displayed over [IntensityGrid](/docs/inDetail/IntensityGridSeries.md) or [IntensityMesh](/docs/inDetail/IntensityMeshSeries.md) series.
---
## How to measure Annotation
***Annotation*** has many properties which controls its size and location (e.g. [AnnotationXY](/docs/inDetail/annotation-XY.md) ). Annotation can be dragged to different position on the screen and it can be resized. Also text inside of Annotation can be change at any time. While in most cases user don't need to worry and rendering will be done automatically, sometimes user may want to know size and location of Annotation. For some settings answer is very trivial (e.g. if *AnnotationXYSizing == AxisValuesBoundaries*). However, it is less obvious when other settings are used.
From version 12.4 ***Annotation. Size*** property can be used to access Width and Height of Annotation after latest rendering event (see [Size](https://lightningchart.com/net-charts/docs/inDetail/annotation-XY/#Size-settings)).
Before 12.4, following method(s) will help to answer the question about size and location of Annotation, if
```csharp
annotation.Sizing = AnnotationXYSizing.Automatic;
```
```csharp
///
/// Get Annotation's TextBox size and location on the screen [in PX]
///
///
/// Size in Pixels
/// Location in Pixels
internal void GetAnnotationSizeAndLocation(AnnotationXY annotation, out Size size, out Point location)
{
float fMaxWidth = 0;
float fMaxHeight = 0;
string[] aContent = annotation.Text.Split('\n');
// Text row max Height
float fRowMax = _chart.MeasureTextPX("Åg", annotation.TextStyle.Font).Y;
for (int i = 0; i < aContent.Length; i++)
{
var point = _chart.MeasureTextPX(aContent[i], annotation.TextStyle.Font);
if (fMaxWidth < point.X)
fMaxWidth = point.X;
}
// add padding space
fMaxWidth += 2 * annotation.AutoSizePadding;
fMaxHeight = fRowMax * aContent.Length + 2 * annotation.AutoSizePadding;
size = new Size(fMaxWidth, fMaxHeight);
double dX = float.MinValue;
double dY = float.MinValue;
switch (annotation.LocationCoordinateSystem)
{
case CoordinateSystem.AxisValues:
dX = XValueToCoord(annotation.LocationAxisValues.X, annotation.AssignXAxisIndex);
dY = YValueToCoord(annotation.LocationAxisValues.Y, annotation.AssignYAxisIndex);
break;
case CoordinateSystem.RelativeCoordinatesToTarget:
switch (annotation.TargetCoordinateSystem)
{
case AnnotationTargetCoordinates.AxisValues:
dX = XValueToCoord(annotation.TargetAxisValues.X, annotation.AssignXAxisIndex);
dY = YValueToCoord(annotation.TargetAxisValues.Y, annotation.AssignYAxisIndex);
break;
case AnnotationTargetCoordinates.ScreenCoordinates:
dX = annotation.TargetScreenCoords.X;
dY = annotation.TargetScreenCoords.Y;
break;
}
dX += annotation.LocationRelativeOffset.X;
dY += annotation.LocationRelativeOffset.Y;
// take into account Anchor position as well
dX -= annotation.Anchor.X * size.Width;
dY -= annotation.Anchor.Y * size.Height;
break;
case CoordinateSystem.ScreenCoordinates:
dX = annotation.LocationScreenCoords.X;
dY = annotation.LocationScreenCoords.Y;
// take into account Anchor position as well
dX -= annotation.Anchor.X * size.Width;
dY -= annotation.Anchor.Y * size.Height;
break;
}
location = new Point(dX, dY);
}
private float XValueToCoord(double value, int xAxisIndex)
{
return _chart.ViewXY.XAxes[xAxisIndex].ValueToCoord(value, false);
}
private float YValueToCoord(double value, int yAxisIndex)
{
return _chart.ViewXY.YAxes[yAxisIndex].ValueToCoord(value, false);
}
```
---
## How to create multithreaded chart applications
### Introduction
Getting an application to run smoothly using background threads can really make a big difference.
Unloading non-essential processes to one or more background threads helps keep the application’s UI responsive and fast.
However, compared to a single-threaded program, multithreaded programs need a bit more effort to develop. The careless use of threads is a big reason for subtle bugs, which can take a lot of time to locate.
This article aims to help to understand multithreaded chart applications and explains some of the concepts of .NET multithreading and in particular, how the [LightningChart .NET control](https://lightningchart.com/net-charts/) should be used in multithreaded programs.
### Multithreading
Most operating systems use a single-threading model for code involving the user interface. This model is necessary to properly sequence user-interface events, including keystrokes and touch input. This thread is often called the **main thread**, the **user-interface thread**, or the **UI thread**. Strictly speaking, [.NET classifies](https://learn.microsoft.com/en-us/dotnet/api/system.threading.thread?view=net-6.0#Foreground) the foreground and background differently.
But in this article, we will call the non-UI thread as a *background thread*.

*Example of Parallel Stacks window of multithreaded chart application in Visual Studio.*
Understanding multithreaded chart applications can improve the performance of an application but access to UI controls isn’t inherently thread-safe. Multithreading can expose your code to serious and complex bugs.
Two or more threads manipulating a control can force the control into an inconsistent state and lead to race conditions, access violations, deadlocks, and freezes or hangs. If you implement multithreading in your app, ensure you are calling the cross-thread controls in a thread-safe way.
UI libraries (Windows Forms, WPF, and UWP) are designed in such a way that **UI elements may only be accessed from the UI thread**. Windows does this to ensure the integrity of UI controls.
:::danger[Important]
LightningChart® .NET control is a UI element. Therefore, the same thread-safe rules apply. Like every other UI control, it requires that **all the LightningChart properties should be updated in the UI Thread**.
:::
When using a background thread in the application, all UI updates from the thread must go through Invoke ([**Control.Invoke()**](https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.invoke?view=windowsdesktop-6.0) in WinForms, and [**Dispatcher.Invoke()**](https://docs.microsoft.com/en-us/dotnet/api/system.windows.threading.dispatcher.invoke?view=windowsdesktop-6.0) in WPF). Both methods schedule a delegate for execution.
WPF dispatcher is more flexible as it allows users to specify queue [priority](https://docs.microsoft.com/en-us/dotnet/api/system.windows.threading.dispatcherpriority?view=windowsdesktop-6.0) when adding an element to the Dispatcher queue.
:::tip
There are 2 amendments in above statement (*'all the LightningChart properties should be updated in the UI Thread'*).
First, if application has multiple windows and each of those windows is allowed to have own thread. In such case LightningChart can use window’s thread not necessary main application thread.
Second, LightningChart could be created in Headless Mode, which could be on any background thread. However, if Headless chart is updated, then it should be always from the thread it was created.
:::
### Use cases
#### Multithreaded chart applications Demo
This design for multithreaded chart applications is demonstrated in the following [ThreadMultiChannel](/docs/getting%20started/examples-gallery.md) example from our Demo. We use this design very often, as it perfectly suits distributing calculations over multiple threads as well as updating the charts as fast as possible.
The idea is to have a background thread to read/collect/generate new data and push some amount of ‘new points’ through the **Invoke()** call.

*Our Demo’s (Interactive Examples app) examples show thread-safe chart updates and background thread usage for data generating.*
The principles of LightningChart rendering are simple. Whenever a user adds data (or modifies a property) the chart is rendered. That process involves a lot of processing, which includes parallel loop computation, object disposal, updating of relevant properties, the recreation of objects, etc.
For this reason, only one thread should update and read Chart – serial/synchronous execution.
#### Headless Demo Service
For a standard desktop application, the LightningChart thread is the same as the Main UI Thread. However, that thread doesn’t necessarily have to be the Main UI Thread. The [Headless mode](/docs/inDetail/headless-mode.md) allows the chart to run in a background thread, but all the updates should go through the same thread where the chart was created.


*Headless demo service: a diagram of a client’s internal operation of messages with named pipes and background thread illustrated.*
#### Multiple windows
Another use case is, for example, when the application may have multiple windows, and each window may have its own Thread.
For this scenario, LightningChart is allowed to use the thread of the window it was added to (which could be a different thread than the one running on the main app’s window). This kind of design was implemented in our [SampleDataBlockSeriesDemo](/docs/getting%20started/examples-gallery.md) example, as seen in the next image:

*Multiple Windows – multithreaded chart applications approach.*
### Additional Notes
#### Invoke vs BeginInvoke
It is worth noting that the Dispatcher/Control has two similar methods: **Invoke()** and **BeginInvoke()**. Both methods schedule a delegate for execution.
- Invoke is a synchronous call – that is, it doesn’t return until the UI thread actually finishes executing the delegate.
- BeginInvoke is asynchronous and returns immediately.
On the other hand (in the case of LightningChart .NET) by updating the chart through BeginInvoke, the user instantly gets a responsive UI. However, on the other hand, the application has limited information when the actual rendering happens. A similar effect could be achieved by changing the chart update type, with:
```csharp
_chart.(Chart)RenderOptions.UpdateType = ChartUpdateTypes.Async;
```
#### Task object
[System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task?view=net-6.0) class is a special case: a Task object typically executes asynchronously on a thread pool rather than synchronously on the main application thread. Therefore, it is more likely that the task will be executed in the background thread than in the UI thread. This can cause an access violation in the thread if the process is intended to be run on the UI thread.
#### BeginUpdate and EndUpdate
Understanding the multithreaded chart applications approach is not going to improve the performance if the user does not arrange tiny chart updates into bigger batches.
If more than one property is programmatically changed at the same time, the property changes should be made between the ***BeginUpdate()*** and ***EndUpdate()*** method calls as a batch (see [Updating chart data or properties](/docs/inDetail/updating-chart.md)).
Otherwise, every property update will refresh the chart and cause a massive extra overhead.
### Conclusion
Whenever you have large and time-consuming items in your multithreaded chart applications, consider using background threads / several threads. However, don’t forget that LightningChart is a UI element. Therefore, for thread safety, **all the LightningChart properties should be updated in the UI Thread**.
### ADDITIONAL READING
1. [Use the Parallel Stacks window](https://docs.microsoft.com/en-us/visualstudio/debugger/using-the-parallel-stacks-window?view=vs-2022) (Microsoft Visual Studio documentation)
2. [Foreground and background threads](https://docs.microsoft.com/en-us/dotnet/api/system.threading.thread?view=net-6.0#Foreground) (Microsoft .NET documentation)
3. [How to make thread-safe calls to controls](https://docs.microsoft.com/en-us/dotnet/desktop/winforms/controls/how-to-make-thread-safe-calls?view=netdesktop-6.0) (Windows Forms .NET)
4. [Threading Model](https://docs.microsoft.com/en-us/dotnet/desktop/wpf/advanced/threading-model?view=netframeworkdesktop-4.8) (Microsoft .NET documentation)
---
## How to resize MeshModel?
[***MeshModel***](/docs/inDetail/MeshModel.md) scale (scaling factor) is controlled by ***Size*** property. For example,
```csharp
float sizeFactor = 40f; // Model scaling
// Set Scaling factor
model.Size.SetValues(sizeFactor, sizeFactor, sizeFactor);
```
However, only central point of mesh model is position at [x,y,z] axes values (***Position*** property). The size of ***MeshModel*** is not fixed to Axes or Dimensions or 3D world. Therefore, one would need to scale model for the first time it is put on the chart. If user will change Axes range or 3D world dimensions, it will distort relative size of ***MeshModel***.
:::note
Zooming could be done with mouse wheel scrolling or changing ***Chart.View3D.Camera.ViewDistance*** property directly.
:::
If user wants to change Axes range or dimensions after ***MeshModel*** is loaded, it is possible, but a bit more complicated. This article is about that.
***MeshModel.Size*** needs recalculation to adjust to a new range or dimensions. The reference values ones needs at all times are: *original-Size*, *original-Dimensions* and *original-AxisRange*. Below is an example of implementation.
First user needs to save those references values once model is added to the chart and chart is initialized.
```csharp
SizeDoubleXYZ _originalDimensions;
SizeDoubleXYZ _originalAxisRange;
List _lOriginalSize = new List();
// save initial values after chart is created and MeshModels are imported/created
_originalDimensions = new SizeDoubleXYZ(
_chart.View3D.Dimensions.Width,
_chart.View3D.Dimensions.Height,
_chart.View3D.Dimensions.Depth
);
_originalAxisRange = new SizeDoubleXYZ(
_chart.View3D.XAxisPrimary3D.Maximum - _chart.View3D.XAxisPrimary3D.Minimum,
_chart.View3D.YAxisPrimary3D.Maximum - _chart.View3D.YAxisPrimary3D.Minimum,
_chart.View3D.ZAxisPrimary3D.Maximum - _chart.View3D.ZAxisPrimary3D.Minimum
);
foreach (MeshModel model in _chart.View3D.MeshModels)
{
_lOriginalSize.Add( new SizeDoubleXYZ(model.Size.Width, model.Size.Height, model.Size.Height));
}
```
Next user needs to subscribe to corresponding events:
```csharp
// subscribe to event to update chart of dimensions or axis range change
_chart.View3D.XAxisPrimary3D.RangeChanged += AxisPrimary3D_RangeChanged;
_chart.View3D.YAxisPrimary3D.RangeChanged += AxisPrimary3D_RangeChanged;
_chart.View3D.ZAxisPrimary3D.RangeChanged += AxisPrimary3D_RangeChanged;
_chart.View3D.DimensionsChanged += View3D_DimensionsChanged;
```
Finally here are the math for size update and implementation of event handlers:
```csharp
private void MeshModelSizeUpdate()
{
_chart.BeginUpdate();
SizeDoubleXYZ newAxisRange = new SizeDoubleXYZ(
_chart.View3D.XAxisPrimary3D.Maximum - _chart.View3D.XAxisPrimary3D.Minimum,
_chart.View3D.YAxisPrimary3D.Maximum - _chart.View3D.YAxisPrimary3D.Minimum,
_chart.View3D.ZAxisPrimary3D.Maximum - _chart.View3D.ZAxisPrimary3D.Minimum
);
SizeDoubleXYZ newDimensions = new SizeDoubleXYZ(
_chart.View3D.Dimensions.Width,
_chart.View3D.Dimensions.Height,
_chart.View3D.Dimensions.Depth
);
foreach (MeshModel model in _chart.View3D.MeshModels)
{
SizeDoubleXYZ originalSize = _lOriginalSize[_chart.View3D.MeshModels.IndexOf(model)];
// update model Size if Dimensions or Axes range changes
model.Size.SetValues(
originalSize.Width * (_originalAxisRange.Width / newAxisRange.Width) * (newDimensions.Width / _originalDimensions.Width),
originalSize.Height * (_originalAxisRange.Height / newAxisRange.Height) * (newDimensions.Height / _originalDimensions.Height),
originalSize.Depth * (_originalAxisRange.Depth / newAxisRange.Depth) * (newDimensions.Depth / _originalDimensions.Depth)
);
}
_chart.EndUpdate();
}
private void View3D_DimensionsChanged(double newWidth, double newHeight, double newDepth, View3D view, LightningChart chart)
{
MeshModelSizeUpdate();
}
private void AxisPrimary3D_RangeChanged(object sender, Arction.Wpf.Charting.Axes.RangeChangedEventArgs e)
{
MeshModelSizeUpdate();
}
```
Happy coding!
---
## How to rotate chart (ViewXY)?
Y- and X-axes similar, but not the same. In particular, stacking could be done only for YAxes and scrolling/sweeping is only for XAxis. LightningChart is design such way that Xaxis is always horizontal and progressive order of x-values is required for most of [line-series](/docs/beginners%20guide/ViewXY-series/xy_chart.md#Which-line-series-should-be-used).
Nevertheless, sometimes user may need XAxis be vertical, while YAxis to be horizontal. While it is possible to rename axis, the specific behavior (e.g. stacking Y-axes and scrolling/sweeping X-axes) is not possible to switch inside LightningChart. However, such rotation could be done with WPF [RotateTransform Class](https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.rotatetransform?view=netframework-4.8)
To set a graphics transformation following few lines should be added in the code
```csharp
// Apply rotation of a chart.
var layoutGroup = new TransformGroup();
layoutGroup.Children.Add(new RotateTransform(-90));
chart.LayoutTransform = layoutGroup;
```
[Any example from our Demo](/docs/getting%20started/RunningDemo.md) could be rotated on fly to demonstrate this rotation feature (buttons outline in the picture below). In *ExampleSideSpectrogram*, such rotation is done in the code and chart is scrolling vertically when example is started.

*ExampleSideSpectrogram*
:::info[Note]
WinForms does not have such feature, so it would be much more difficult to do there.
:::
---
## How to create Axis labels with scientific notation
Scientific notation is a way of expressing numbers, which commonly used by scientists, mathematicians, and engineers. This base 10 notation, where nonzero numbers are written in the form

Which could be read as, *m* times ten raised to the power of *n*, where *n* is an integer, and the coefficient *m* is a nonzero real number.
Officially superscripts formatting is not supported in C# / .NET. However, there is some workaround. Basically one needs to use Unicode characters to show exponents like the ones described below.
This approach is centered around method for converting number to scientific notation (with superscript). Here is the example of such method
```csharp
///
/// Converted number to scientific notation
///
/// Number to be converted to scientific notation
///
public string FormatAs10Power(double val)
{
string SuperscriptDigits = "\u2070\u00b9\u00b2\u00b3\u2074\u2075\u2076\u2077\u2078\u2079";
string expstr = string.Format("{0:0.#E0}", val);
var numparts = expstr.Split('E');
char[] powerchars = numparts[1].ToArray();
for (int i = 0; i < powerchars.Length; i++)
{
powerchars[i] = (powerchars[i] == '-') ? '\u207b' : SuperscriptDigits[powerchars[i] - '0'];
}
numparts[1] = new string(powerchars);
return string.Join(" x 10", numparts);
}
```
Once user has way to convert number to *right* string, then there is no limits in LightningChart how it could be used. For axis labels most relevant would ***CustomTicks*** and ***FormatValueLabel*** event. ***CustomTicks*** allow to customize position, style and label text of each axis tick. Therefore, above *scientific notation* string could be used as ***LabelText***.
***axis.FormatValueLabel*** event handler allows formatting axis value labels as well. And following examples will demonstrates its usage. For experimenting with this approach you can extract [any example from our Demo](/docs/getting%20started/RunningDemo.md) and add few lines there. *ExampleLogAxesXY* could be one such example.
First, subscribe to event
```csharp
yAxis.FormatValueLabel += Axis_FormatValueLabel;
axisX.FormatValueLabel += Axis_FormatValueLabel;
```
Second, create event handler like this
```csharp
private string Axis_FormatValueLabel(object sender, FormatValueLabelEventArgs e)
{
return FormatAs10Power(e.Value);
}
```
And that's it, all the labels now will have scientific notation

*Axes labels formatted as scientific notation*
---
## 3D surface series tips
Applies to: [SurfaceGridSeries3D](/docs/inDetail/SurfaceGridSeries3D.md), [SurfaceMeshSeries3D](/docs/inDetail/SurfaceMeshSeries3D.md), [WaterfallSeries3D](/docs/inDetail/WaterfallSeries3D.md)
- Disable lighting by setting ***SuppressLighting*** to false if light reflections and shading are not needed.
- If contour lines are used, use *FastColorZones* or *FastPalettedZones* instead of *ColorLineBy..* or *PalettedLineBy..* .
Applies to: [SurfaceGridSeries3D](/docs/inDetail/SurfaceGridSeries3D.md)
- With scrolling data (like 3D-spectrum or spectrogram), use ***InsertRowBackAndScroll()*** and ***InsertColumnBackAndScroll()*** methods to update data and axis ranges.
:::info
Check InsertRowBackAndScroll / InsertColumnBackAndScroll usage in examples *AudioSpectrogram3D* and *ExampleSpectrogram* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Updating from older version
LightningChart components API may have been changed from an older version, after which the project may not load or use the new version automatically. These instructions show how to set the new version assemblies as a reference to a project and how to fix the properties that were unable to de-serialize in the Visual Studio form editor.
In order to update chart, the reference to the old version has to be removed and a reference to the new version added. In some cases __*.Designer.cs__ and __*.resx__ files may need to be fixed as they may contain properties, which are binary incompatible.
Removing the old reference from project References
1. Go to Solution Explorer.
2. Open References folder.
3. Select LightningChart assemblies and remove them by pressing **Delete** key or right-click and select **Remove**.
Adding a reference to a new version
1. Go to Solution Explorer.
2. Open References folder.
3. Add reference to new chart. Right-click on References folder. Select **Add Reference...** and select the new LightningChart DLL file.
As the API may have been changed, the source code on changed properties may have to be fixed.\
If a chart is totally incompatible (i.e. Visual Studio can't load UI on form editor), LightningChart property setters have to be removed from __*.Designer.cs__ and __*.resx__ files.
Removing property setters from *.Designer.cs file
1. Open __*.Designer.cs__ file in text editor (use other editor than Visual Studio if possible).
2. Locate and delete rows containing setters for LightningChart. For example:
*this.m_chart.Background = ((LightningChartLib.WPF.Charting.LightningChart.Fill)(resources.GetObject("m_chart.Background")));*
There is no need to remove inherited properties, like Location and Size. Remove properties, which are read from resource by a method like above *"NN = ((...)(resources.GetObject("...")));"*.
Removing serialized items from *.resx file
1. Open __*.resx__ file in text editor.
2. Find xml tags containing LightningChart objects (they are identified with chart member name. e.g. "m_chart" or "LightningChart1").
3. Remove the lines including tag to the end of xml object ( tag).
E.g. if chart background is serialized as the following xml object, all the following lines should be removed from the __*.resx__ file:
```
AAEAAAD/////AQAAAAAAAAAMAgAAAGRBcmN0aW9uLkxpZ2h0bmluZ0NoYXJ0VWx0aW1hdGUsIFZlcnNp b249NC42LjEuMjAwMSwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj03MmY1NWZiZDY5MDFm
... lots of encoded stuff ...
YXlvdXQBAAAAB3ZhbHVlX18ACAIAAAAAAAAACw==
```
:::note
Note that some objects may be very large, e.g. title row count may be approximately 200 lines while views are usually much larger (View3D has about 2000 lines).
:::
In case of having several charts, all their serialized properties need to be removed. Editor search is a handy tool to find the chart objects.
After the objects are removed from __*.resx__ file and related setters from __*.Designer.cs__ file, it should be possible to open the project successfully in Visual Studio form editor.
---
## View3D overview
***View3D*** allows visualizing data in 3D space. 3D model can be zoomed, rotated and lit up with various
ways. Different series types can be placed into the same 3D view to make a combined visualization.

*View3D object main tree.*
### 3D model and dimensions
3D model is constructed in the center of 3D world. Dimension magnitudes define the size of the model
box in 3D space. Walls and axis sizes are defined with this dimension box. Use the ***Dimensions*** property to set each dimension magnitude.
When camera rotation is not defined, positive X direction is to the right, positive Y dimension upwards
and positive Z direction inwards to the screen.

*3D model positive and negative directions*
#### World coordinates
Some 3D objects use “World coordinates”, not axis values. For example, lights are positioned this way to be independent from axis ranges. World coordinates can be called also as “*3D model space coordinates*”.
The origin [0,0,0] is in the center of the model. The actual 3D model space ranges from [*-Dimensions.X/2 to Dimensions.X/2*], [*-Dimensions.Y/2 to Dimensions.Y/2*] and [*-Dimensions.Z/2 to Dimensions.Z/2*].

*Example of 3D view setup. Dimensions are set to X=100, Y=40, Z=80. Walls visible: left, bottom, back. Perspective camera is used.*
LightningChart provides methods to convert values between series values, axis values, world coordinates
and screen coordinates.
Converts 3D world space coordinate to series value, using the axes bound to the series.
```csharp
public PointDouble3D Convert3DWorldCoordToSeriesValue(SeriesBase3D series, double x, double y, double z)
```
Convert 3D world coordinates into screen coordinates.
```csharp
public PointInt[] Convert3DWorldCoordsToScreenCoords(CoordXYZ[] coordsW)
```
Converts series points to 3D world space coordinates, using the axes bound to the series.
```csharp
// 'Normal' point
public CoordXYZ[] ConvertSeriesPointsTo3DWorldCoords(SeriesBase3D series, SeriesPoint3D[] points)
// PointsCompact
public CoordXYZ[] ConvertSeriesPointsTo3DWorldCoords(SeriesBase3D series, SeriesPointCompact3D[] points)
// PointsCompactColored
public CoordXYZ[] ConvertSeriesPointsTo3DWorldCoords(SeriesBase3D series, SeriesPointCompactColored3D[] points)
```
Converts series points to screen coordinates, using the axes bound to the series.
```csharp
// 'Normal' point
public PointInt[] ConvertSeriesPointsToScreenCoords(SeriesBase3D series, SeriesPoint3D[] points)
// PointsCompact
public PointInt[] ConvertSeriesPointsToScreenCoords(SeriesBase3D series, SeriesPointCompact3D[] points)
// PointsCompactColored
public PointInt[] ConvertSeriesPointsToScreenCoords(SeriesBase3D series, SeriesPointCompactColored3D[] points)
```
Converts series value range to 3D world space range, using the axes bound to the series.
```csharp
public PointDouble3D ConvertSeriesValueRangesTo3DWorldRanges(SeriesBase3D series, double xValueRange, double yValueRange, double zValueRange)
```
Converts series value to 3D world space coordinate, using the axes bound to the series.
```csharp
public PointDouble3D ConvertSeriesValueTo3DWorldCoord(SeriesBase3D series, double x, double y, double z)
```
Converts series value to screen coordinate, using the axes bound to the series.
```csharp
public PointInt ConvertSeriesValueToScreenCoord(SeriesBase3D series, double x, double y, double z)
```
### 3D Walls
Walls (***WallOnFront***, ***WallOnBack***, ***WallOnTop***, ***WallOnBottom***, ***WallOnLeft***, ***WallOnRight***) are used to present axis grids and gridstrips and to give a base for the axes. By default, bottom, left, right, back and front walls are visible. Their ***AutoHide*** property is set true. When rotating the view, the obstructing walls are temporarily hidden so that they don’t block the view of chart contents. To force a wall visible, set ***Visible*** = true and ***AutoHide*** = false.

*View3D Wall object properties.*
Use ***XGridAxis***, ***YGridAxis***, ***ZGridAxis***, ***GridStripColorX***, ***GridStripColorY***, ***GridStripColorZ*** and ***GridStrips*** properties to select from which axes the grid is applied, and to modify the coloring of the grid strips. The available properties depend on the wall orientation. ***FullTransparent*** property allows showing only the grid while hiding the solid wall. Note that even if ***FullTransparent*** is enabled, the grid still follows ***Visible*** and AutoHide ***properties*** of the wall.
### 3D FrameBox
A simplified 3D box presentation can be used instead of walls. Set Visible = false for every wall, then
set ***FrameBox.Style*** = *AllEdges*. Set the color or the frame with ***FrameBox.LineColor***.

*FrameBox visible, walls are hidden.*
### 3D Camera

*Camera properties*
Camera type, location, distance and target together determine the 3D viewpoint. Use ***RotationX***, ***RotationY***, ***RotationZ*** and ***ViewDistance*** to set the camera position in the 3D model space. Target the camera to preferred direction by setting the ***Target*** property.
Select projection type with ***Projection*** property.
- *Perspective*, shows a realistic projection.
- *Orthographic*, projection type used in scientific and engineering applications. This selection is recommended over OrthographicLegacy.
- *OrthographicLegacy*, (equivalent to *OrthoGraphicCamera = True* in LightningChart v.8.3 and earlier). This is slower to render after zooming compared to Orthographic. It maintains the sizes of the 3D objects, if they are defined in 3D world coordinates (not axis values). Also, the thickness of the walls stays the same when zooming. Zooming changes the dimensions but does not affect ***ViewDistance***.
***RotationX***, ***RotationY*** and ***RotationY*** can be limited by setting boundaries via ***RotationXMinimum***, ***RotationXMaximum***, ***RotationYMinimum***, ***RotationYMaximum***, ***RotationZMinimum*** and ***RotationZMaximum*** properties.

*Perspective camera presentation in 3D space.*

*Perspective and orthographic camera views in 3D space.*
Zoomed view in Orthographic and OrthographicLegacy differ as follows:
Orthographic

*Orthographic projection type. On the left, unzoomed. On the right, zoomed in. Airplane (MeshModel3D) object size grows on the screen along with other objects.*
OrthographicLegacy

*OrthographicLegacy. On the left, unzoomed. On the right, zoomed in. Airplane (MeshModel3D, see 7.14) object size stays the same, but 3D dimensions are changed.*
#### Predefined cameras
Use ***SetPredefinedCamera*** method of ***View3D.Camera*** to set one of the predefined cameras.
```csharp
// Setting predefined camera orientation
chart.View3D.Camera.SetPredefinedCamera(PredefinedCamera.BackOrthographic);
```
:::info
To see feature demonstration as example, check *CamerasAndLights* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
#### Camera orientation mode
LightningChart v8.4 added a new camera orientation mode with improved camera orientation definition. The new mode called *ZXY_Extrinsic* (the name defines in which order the dimensions are calculated) is now set to be the default orientation mode. It fixes many rotation-based issues especially near the poles of the chart (i.e. camera on top of the chart). The old orientation mode, *XYZ_Mixed*, is still available but will most likely become deprecated at some point in the future. Orientations can be accessed via ***View3D.Camera. OrientationMode***.
Rotations are also modified by this change. With the new camera orientation mode, one of the axis directions (world unit vectors) is used as the horizontal mouse rotation axis. This is the axis of which the camera is rotated around. Axis determination is automatically done when ***RotationX***, ***RotationY*** or ***RotationZ*** properties are changed. Closest axis to the camera’s up direction is selected as the rotation axis, so that the rotations feel as natural as possible on all occasions.
The new orientation and rotation model allow views in the 3D scene that were previously impossible.
### 3D Lights
Lights can be freely positioned anywhere in the 3D model space. Several lights can be added into ***Lights*** collection property. There are two different light types: *Directional* and *PointOfLight*.

*Directional light and point of light.*
:::tip[Note]
Some series types (***SurfaceGridSeries3D***, ***SurfaceMeshSeries3D***, ***WaterfallSeries3D***) allow suppressing lighting totally from its surface via ***SuppressLighting*** property. Check it’s not enabled if the series should be correctly lit. Surface series have ***LightedSurface*** property, which selects the surface side that is correctly lit.
:::
:::tip[Note]
Placing all the lights inside the 3D model box can make the wall edges appear very dark, possibly making axis ticks hardly visible. Adjust axis tick coloring in such case.
:::
#### Directional light
In *Directional* (***Type***) light, the light rays are parallel, and the light intensity does not attenuate as the distance increases. The light flux gets direction from ***Location*** and ***Target*** properties. ***LocationFromCamera*** property allows using to the location of the camera as a source of light.
#### Point of light
In *PointOfLight* (***Type***) intensity attenuates as the distance grows. Use ***AttenuationConstant***,
***AttenuationLinear*** and ***AttenuationQuadratic*** properties to control the attenuation over distance.
***Target*** is irrelevant with this light type, as the light is distributed equally to all directions.
#### Lights and materials
All 3D objects have a ***Material*** property. Material tells how to react to lights. Material’s ***DiffuseColor*** reacts with ***DiffuseColor*** of a light. Material’s ***SpecularColor*** reacts with light’s ***SpecularColor***. Diffuse color can be understood as a matter base color, while specular color is the color that reflects off the lit surface. Using high ***SpecularPower*** gives the object a metallic look.
Surface series have ***ColorSaturation*** property, valid range is 0…100%. High value boosts the surface fill colors and reduces the shading effect.

*The surface series on the left has ColorSaturation = 50%. On the right, ColorSaturation = 85%.*
#### Predefined lighting schemes
Use ***SetPredefinedLightingScheme*** method of View3D to select a built-in predefined lighting scheme.

*Predefined ‘DiscoCMY’ scheme in use. The scheme is composed from three differently colored PointOfLights near the ceiling. The spheres and cones are made with PointLineSeries3D.*
:::info
To see feature demonstration as example, check *CamerasAndLights* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### 3D Axes
In general, the 3D axes behave very much like [ViewXY’s axes](/docs/inDetail/axis-class-properties.md). Many of the properties and methods are similar.
For each dimension, there are two axes: primary and secondary. In other words, View3D has the following axis properties available: ***XAxisPrimary3D***, ***XAxisSecondary3D***, ***YAxisPrimary3D***, ***YAxisSecondary3D***, ***ZAxisPrimary3D*** and ***ZAxisSecondary3D***.
#### Location
The axes can be positioned in 3D model box corners. Use ***Location*** property of an axis to adjust the position.
- For X axis, the ***Location*** options are: *BottomFront*, *BottomBack*, *TopFront* and *TopBack*.
- For Y axis, the ***Location*** options are: *FrontLeft*, *FrontRight*, *BackLeft* and *BackRight*.
- For Z axis, the ***Location*** options are: *BottomLeft*, *BottomRight*, *TopLeft* and *TopRight*.

*Default axis location setup, XAxisPrimary at BottomFront, YAxisPrimary at FrontLeft and ZAxisPrimary in BottomRight.*

*ZAxisPrimary location set to BottomLeft.*

*Secondary axes set visible, and their locations and colors set arbitrarily. Secondary Y axis ScaleType set to Logarithmic.*
#### Orientation
Each axis can be oriented in two planes. This affects the position and orientation of both axis ticks and value labels.
- X axis: *XY* and *XZ* planes
- Y axis: *XY* and *YZ* planes
- Z axis: *XZ* and *YZ* planes

*X axis orientation is set to XY, Y axis orientation to XY, Z axis orientation to XZ.*

*Y axis orientation stays same, but X axis orientation is changed to XZ and Z axis orientation is changed to ZY plane.*
:::tip
Changing Orientation maybe in particular useful when viewing 'from above'.
:::
#### CornerAlignment
The axis alignment in 3D model box corners can be changed with ***CornerAlignment*** property.
Use ***MajorDivTickStyle*** and ***MinorDivTickStyle*** ***Alignment*** properties to control the text alignment.

*Only Y axis is visible in this example. First figure: Y Axis CornerAlignment is set to Inside. Alignment properties in MajorDivTickStyle and MinorDivTickStyle are set to Near. Second figure: CornerAlignment is set to AtCorner. Third picture: CornerAlignment is set to Outside.*
### 3D Margins
From LightningChart v.8.4 onwards, ***View3D*** supports margins. [Similarly to ***ViewXY***](/docs/beginners%20guide/definitions.md), when ***AutoSizeMargins*** is set *true*, the graph size is adjusted so that there’s enough space for all the axes and chart title. If it is disabled, ***View3D. Margins*** property applies allowing setting margins manually. By default, ***AutoSizeMargins*** is set *false*.
***View3D.MarginsChanged*** event can be set to trigger when a margin has been changed because of (for
example) resizing it.
The contents of the view are automatically clipped outside the margins. All contents are clipped other than the chart title, annotations and legend boxes as their position is defined in screen coordinates, allowing them to be freely positioned on the margins as well. A one-pixel or more wide (***Border. Width*** property from version 12.4) border rectangle, ***Border***, can be drawn to display where the margins are. By default, the border is not visible in View3D (enable ***Visible*** property to see it). The color of the rectangle can be changed via ***Border.Color***.

*On the left, the graph has no margins (all margins set to 0). On the right, margins are set and the content is clipped outside them. Border.Visible is set True to mark where the margins of the view are.*
### 3D series, general
View3D’s series allow data visualization in different ways and formats. All series are bound to axis value ranges. For each dimension, the series can be selected to bind to primary or secondary axis. Use Series ***XAxisBinding***, ***YAxisBinding*** and ***ZAxisBinding*** properties to control that.
### Clipping objects within axis ranges
By setting ***ClipContents*** property to True, series, rectangles and mesh models are clipped inside axis value ranges. The axes are always stretched for a dimension, so when clipping is enabled, it prevents rendering outside the walls.

*On the left, ClipContents is not used. Series render outside axis ranges. On the right, ClipContents is enabled.*
:::tip
Note that clipping does not modify the series data set itself. Clipping occurs only in rendering stage. Also, mouse hit test will take effect also outside the walls for invisible, clipped objects.
:::
---
## Advanced line coloring
## Advanced line coloring of line series
The line color can be changed based on data values, or on other external logic.
### Y-value based coloring of line with value-range palette
By enabling ***UsePalette*** property of [SampleDataSeries](/docs/inDetail/SampleDataSeries.md), [PointLineSeries](/docs/inDetail/PointLineSeries.md) or [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md), the coloring of line is applied by the ***ValueRangePalette*** property. ***ValueRangePalette*** contains Y values and color pairs. ***ValueRangePalette. Type*** sets the *Gradient* or *Uniform* steps palette (more about palette can be found at [IntensityGridSeries](/docs/inDetail/IntensityGridSeries.md)).
The palette coloring can be set for Y axis line too. Enable ***UsePalette*** property of Y axis and assign the preferred series in ***PaletteSeries*** property.
```csharp
// Create series with palette
PointLineSeries pls = new PointLineSeries(_chart.ViewXY, axisX, _chart.ViewXY.YAxes[0])
{
UsePalette = true
};
pls.LineStyle.Width = 5;
pls.ValueRangePalette = CreatePalette(pls);
//Color the Y axis too with the same palette
_chart.ViewXY.YAxes[0].PaletteSeries = pls;
_chart.ViewXY.YAxes[0].UsePalette = true;
```

*On the left, a Gradient palette is used to color the line based on Y values. On the right, a Uniform palette is used. UsePalette is enabled for Y-axis as well.*

*Gradient palette coloring for bipolar signal data. UsePalette for Y-axis is disabled.*
:::note
[HighLowSeries](/docs/inDetail/HighLowSeries.md) and [AreaSeries](/docs/inDetail/AreaSeries.md) also has ***UsePalette*** and ***ValueRangePalette*** properties, but those applied to ***Fill***.
:::
### Custom shaping and coloring with CustomLinePointColoringAndShaping event
Custom shaping and coloring is supported in [SampleDataSeries](/docs/inDetail/SampleDataSeries.md), [PointLineSeries](/docs/inDetail/PointLineSeries.md) and [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md). The adjustment of coloring and coordinate can be made with ***CustomLinePointColoringAndShaping*** event, which is called just before entering the rendering stage of the chart. Custom coloring is available with all line patterns (*Dash*, *Dot* etc.). However, gradient coloring can only be applied when ***LineStyle. Pattern*** = *Solid*. The event also has serious limitations in vector file exports.

*CustomLinePointColorAndShaping event handler used to change the line color by the specific changing reference level.*
The event arguments have the following info:
- **CanModifyColors**: Colors modification is available.
- **Colors**: Prefilled colors array with *LineStyle* color. If ***CanModifyColors*** is true, modifications can be done either by assigning new values to prefilled colors, or by creating a new colors array. If **CanModifyColors** is false, don’t fill them.
- **CanModifyCoords**: Coordinates modification is available.
- **Coords**: Pre-filled screen coordinates array. If ***CanModifyCoords*** is true, modifications can be done either by assigning new values to prefilled coordinates, or by creating a new coordinates array. The new array length doesn’t have to be equal to prefilled one. Ensure the length of the Coords and Colors array are equal when exiting the event handler. If **CanModifyCoords** is false, don’t fill them.
- **HasDataPointIndices**: applicable to [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md), and (starting from version 12.6) applicable to [SampleDataSeries](/docs/inDetail/SampleDataSeries.md) & [PointLineSeries](/docs/inDetail/PointLineSeries.md).
- **DataPointIndices**: Data point indices included in the coordinate and color arrays. Subsequent points are skipped in line construction if their X and Y values or coordinates are equal. Using **DataPointIndices** info, e.g. a color can be picked for a line point from data point’s **PointColor** field or external color array.
- **DataPointIndiceCount**: (starting from version 12.6) reports data point count at each coord (i.e. item in *DataPointIndices[]* array).
- **SweepPageIndex**: If ***XAxis.ScrollMode*** = *‘Sweeping’*, tells the page index (0 or 1).
### Examples
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures*, *MultiColorLineEvent*, *ExampleMultiColorLinePalette*, *SpectrogramLayoutCursors*, *MultiColorLineIndicesXY* and *ThreadMultiChannel* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Annotation3D
***View3D.Annotations*** collection allows adding annotations (***Annotation3D***) into the 3D scene. In general, they are similar to ViewXY’s Annotations (see [AnnotationXY](/docs/inDetail/annotation-XY.md)), with the exception of ***Target*** and ***Location*** properties using X, Y and Z dimensions (*AxisValues* is using [x,y,z] coordinate system, but *ScreenCoords* still using 2D [x,y]).

*Annotation3D object displaying the value of a 3D series. Crosshair cursor can be used to aid the target movement.*
***Target*** can be moved by mouse in 3D. For aiding the movement, annotation can show cross-hair lines when mouse is over the ***Target*** node. Set ***ShowTargetCrosshair*** property to *Auto/On/Off* and adjust the line style in ***TargetCrosshairLineStyle***.
:::info
To see Annotation 3D demonstration as example, check *ExamplePointTracking3D*, *ExampleMeshModelAsteroid*, *Surface mouse control* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## AnnotationPolar
***ViewPolar.Annotations*** are similar to ViewXY’s Annotations (see [AnnotationXY](/docs/inDetail/annotation-XY.md)) with the exception of ***Target*** and ***Location*** being defined in Polar axis values (note, *AxisValues* is using [amplitude,angle] coordinate system, but *ScreenCoords* still using 2D [x,y]). Sizing by axis values is not suitable and therefore ***Sizing*** property has only values *Automatic* and *ScreenCoordinates*.

*An annotation in Polar view.*
:::info
To see Annotation Polar demonstration as example, check *ExamplePolarVectors* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## AnnotationSmith
***AnnotationSmith*** allow displaying mouse-interactive text labels or graphics anywhere in the chart area. ***ViewSmith.Annotations*** are similar to ViewXY’s Annotations (see [AnnotationXY](/docs/inDetail/annotation-XY.md)) with the exception of ***Target*** and ***Location*** being defined in smith axis values (real and imaginary). Sizing by axis values is not suitable and therefore ***Sizing*** property has only values *Automatic* and *ScreenCoordinates*.

*An annotation in ViewSmith*
---
## AnnotationXY
Annotations allow displaying mouse-interactive text labels or graphics anywhere in the chart area. Annotations can be moved around by mouse, resized, rotated, their target and location can be changed etc. Alternatively, they can be controlled by code. Annotations are great also when custom graphics must be rendered on the screen, as they can be rendered in different styles and shapes. Create ***AnnotationXY*** objects in ***ViewXY.Annotations*** collection.
By moving mouse over an annotation, it goes into mouse-interactive edit state, allowing relocation, resizing it, rotating it, and determining where the arrow points to.

*Move mouse over the annotation to enter the editing state. Move mouse away to leave the edit state.*

*AnnotationXY objects with various styles, placed around a line series. Use Style property to select the shape.*
### Controlling target and location
***Target*** is the ending point of the arrow, the point that the arrow or callout tip points to. ***Target*** can be set in axis values or in screen coordinates. Use ***TargetCoordinateSystem*** to select between *AxisValues* or *ScreenCoordinates*. When *AxisValues* is selected, ***TargetAxisValues*** property sets where the arrow line points to (end of the arrow line). Use ***TargetScreenCoords*** property to set it in screen coordinates instead.
***Location*** is the starting point of the arrow. It can be set by screen coordinates, axis values, or as relative offset from ***Target***. Use ***LocationCoordinateSystem*** to select, and ***LocationScreenCoords***, ***LocationAxisValues*** or ***LocationRelativeOffset*** to control the location by the selected method. Location is also the center point of text area rotation.
***Anchor*** property controls how the text area is placed at ***Location***. By setting ***Anchor.X*** = 0.5 and ***Anchor.Y*** = 0.5, the beginning of the arrow is in the middle of text-box. When setting ***Anchor.X*** 0.1 and ***Anchor.Y*** = 0.25, arrow start is near the upper left corner as the following figure illustrates:

*Anchor values explained. Current Anchor.X = 0.1 and Anchor.Y = 0.25. When the anchor values are between 0…1, the arrow start point is inside the text area.*
### Using mouse to move, rotate and resize

*Annotation mouse-interactive nodes*
Drag from ***Target*** to move the end of the arrow. Drag from text area to set new ***Location***. By dragging from round location/anchor node, ***Anchor*** and ***Location*** properties can be adjusted at the same time, keeping the text box in the same place.
By holding **Shift** key down while dragging from X or Y resize node, a symmetrical operation is used, both sides are adjusted at same time. By holding **Shift** key down while dragging from a corner resize node (X+Y), resizing maintains the aspect ratio. In rotate operation, **Shift** key snaps the rotate angle to nearest multiple of 15 degrees.
### Adjusting appearance
Select the annotation shape by setting ***Style*** property. The options are: *Rectangle*, *RectangleArrow*, *RoundedRectangle*, *RoundedRectangleArrow*, *Arrow*, *Callout*, *RoundedCallout*, *Ellipse*, *EllipseArrow*, *Triangle* and *TriangleArrow*.
For styles with arrow, use ***ArrowLineStyle***, ***ArrowStyleBegin*** and ***ArrowStyleEnd*** to control the arrow design. As arrow end styles, there are options: *None*, *Square*, *Arrow*, *Circle* and *Caliper*.
Use ***Fill*** to modify the fill of the annotation. Note, if annotation fill is not visible (***Fill. Style*** = *None*) or color are semitransparent, then ***Shadow. Color*** will be visible. To hide shadow disable ***Shadow. Visible*** property.
The appearance of the editing state mouse-interactive nodes can be changed from ***NibStyle***. ***TextStyle*** controls the font settings and text alignment inside the text area. ***BorderLineStyle*** and ***CornerRoundRadius*** control the border line appearance (if ***BorderVisible*** is enabled).
#### Arrow style appearance
Arrowhead is drawn, when ***Style*** property is set to an option with arrow, and ***ArrowStyleEnd*** or ***ArrowStyleBegin*** style set as *Arrow*, *Circle* and *Caliper*. Default arrowhead is created from equilateral triangle, where side length is 3 time of line-width (***ArrowLineStyle. Width***).

*Default arrow style for Annotation (equilateral triangle).*
From version 12.4 Annotation's arrow has more properties for adjustment. In particular, ***ArrowEndWidthMultiplicator*** and ***ArrowBeginWidthMultiplicator*** has been added (default is 1). Those properties allow more fine control of arrow width. That is, width can be any multiple of line-width (***ArrowLineStyle. Width***).

*Annotation arrow style with ArrowEndWidthMultiplicator = 3, ArrowEndAspectRatio = 1.*
It is also possible to draw arrowhead using other shapes besides equilateral triangle. ***ArrowEndAspectRatio*** property controls arrow end aspect ratio (width / height), where default is 1.

*Annotation arrow style with ArrowEndWidthMultiplicator = 2, ArrowEndAspectRatio = 2.*
### Size settings
***Sizing*** property controls how the annotation text box is sized:
- Automatic adjusts the size by the contents, and leaves ***AutoSizePadding*** space to the borders.
- AxisValuesBoundaries allows the size of the annotation to be set in axis values. Use ***AxisValuesBoundaries***. ***XMin***, ***XMax***, ***YMin*** and ***YMax*** to define them.
- ScreenCoordinates enables setting size in the screen coordinates. Use ***SizeScreenCoords***. ***Height*** and ***Width***.
From version 12.4 new property is added to Annotation base class (therefore, applicable for Annotations in all Views). ***Annotation. Size*** is read only property, which gets the size of annotation text bounding box (after chart is rendered). Size has ***Width*** and ***Height*** fields. This property is handy, when user needs to know the final/current size of the Annotation (for example, after resizing or text change).
### Keeping text area visible
When ***KeepVisible*** is enabled, the annotation text area is forced inside the graph. The annotation won't move outside the graph when moving it by mouse or code. When panning the graph view or adjusting axes, the annotations are repositioned to show inside the graph.
### Clipping inside graph
When ***ClipInsideGraph*** is enabled, the annotation is clipped inside the graph. When it’s disabled, the annotation is rendered also in the margin area of the chart.
By enabling ***ClipWhenSweeping***, the annotation doesn’t show up in the sweeping gap area when [ScrollMode](https://lightningchart.com/net-charts/docs/inDetail/axis-class-properties/#Real-time-monitoring-scrolling) is set *Sweeping*.
### Displaying annotation over axes
By setting ***RenderBehindAxes*** = True, annotation is shown under axes. All clipping and Z ordering features are not feasible in that case. ***RenderBehindAxis*** has no effect if ***ClipInsideGraph*** is set true.

*On the left RenderBehindAxes = True, on the right RenderBehindAxes = False. ClipInsideGraph is set False in both cases.*
### Controlling the Z order
By setting ***Behind*** property to its default value, *False*, the annotation appears on top of series. By setting it *True*, it is rendered before the series, thus appearing under them.
The annotations appear in the order they exist in Annotations list, while keeping the ***Behind*** filter as a master controller. Annotations Z order can be changed quickly by using ***ChangeOrder*** method of annotation for example in a mouse event handler. The options for order change are:
- BringToFront brings the annotation to topmost
- SendToBack sends to back
- MoveBack moves one step backwards
- MoveFront moves one step forwards
:::tip
A use case of **annotation.ChangeOrder()** method can be found in *ExampleAnnotationsXY* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### LayerGrouping performance optimization
When having hundreds of annotations with visible text, the delay of text rendering starts to play a significant role. By default, text rendering follows the Z order, keeping the text firmly within an annotation.
The performance can be improved by setting ***LayerGrouping*** = True, and the chart will use only two flat annotation text layers. One for annotations with ***Behind*** set to True, and other for annotations with ***Behind*** set to False. It greatly improves performance. On the other hand, the text will be rendered wrong if there are overlap between annotations.

*On the left LayerGrouping = False. On the right, LayerGrouping = True, Z order of texts is lost.*
When using ***Style*** = Arrow or by setting the annotation fill not visible (***Fill. Style*** = *None*), the restriction of Z order typically doesn't show up.
### Converting between axis values and screen coordinates
In some cases, ***Location*** or ***Target*** may be wanted to be defined in mixed configuration. First in screen coordinates and second in axis values, or vice versa. Axes have ***ValueToCoord*** method for converting an axis value to a screen coordinate, and ***CoordToValue*** to convert a screen coordinate to an axis value as described in [Axis properties](axis-class-properties.md).
---
## Anti-Aliasing
**LightningChart® .NET** supports anti-aliased rendering. It can be applied for objects having AntiAliasing-property. With anti-aliasing, lines etc. can be rendered with smoothened edges, resulting in a more polished graphical representation, but with a performance cost as it increases the CPU/GPU overhead.
### Enabling Anti-Aliasing
Anti-aliasing can be controlled through ***AntiAliasing***-property, which is set via a boolean value or ***LineAntialias***-enumeration depending on the related component. For the latter, there currently are two options available:
```csharp
LineAntialias.None; // No anti-aliasing
LineAntialias.Normal; // Anti-aliasing
```
For example,
```csharp
seriesEventMarker.Symbol.Antialiasing = true;
pointLineSeries.LineStyle.AntiAliasing = LineAntialias.Normal;
```
Anti-aliasing is also affected by chart’s ***AntiAliasLevel*** (see [RenderOptions/ChartRenderOptions](/docs/beginners%20guide/chart-render-options.md)). It is a factor defining the applied anti-aliasing mode based on the selected rendering engine (DirectX9 and DirectX11). Setting anti-aliasing level to 0 or 1 will result into no anti-aliasing to be applied on rendering even if the AntiAliasing-property for the individual components is set to true or *LineAntialias.Normal*.
AntiAliasLevel can be set through chart’s rendering options ([RenderOptions/ChartRenderOptions](/docs/beginners%20guide/chart-render-options.md)):
```csharp
// Anti-aliasing factor. Values 0 and 1 result into no anti-aliasing applied.
chart.ChartRenderOptions.AntiAliasLevel = 2;
```
Without setting the value manually AntiAliasLevel defaults to 4 or 8.
### DirectX11 Anti-Aliasing
On DirectX11 there are a couple of common features, which should be taken into account, when rendering with anti-aliasing:
- Setting ***AntiAliasLevel*** overrides the ***AntiAliasing***-property if set to a value greater than 1, meaning that the rendering will be done using anti-aliasing even if the ***AntiAliasing***-property has been set to be false or *LineAntialias.None*. The only exception of this is if *LineOptimization.Hairline* is applied (only available with 3D rendering).
- ***LineAntiAliasType*** can be used to choose whether alpha-blending (ALAA)- or quadrilateral anti-aliasing (QLAA) is used (see [RenderOptions/ChartRenderOptions](/docs/beginners%20guide/chart-render-options.md)):
```csharp
LineAntiAliasingType.ALAA; // Alpha-blending anti-aliasing.
LineAntiAliasingType.QLAA; // Quadrilateral anti-aliasing.
```
```csharp
chart.ChartRenderOptions.LineAAType2D = LineAntiAliasingType.ALAA;
```
:::note
On 3D rendering with DirectX11, all triangle lines are always rendered with anti-aliasing unless the AntiAliasLevel is set to 0 or 1.
:::
---
## AreaSeries
Area series presents data as filled area between base level and values. Area series is quite similar to [HighLowSeries](/docs/inDetail/HighLowSeries.md), but simpler. Add the series to chart by adding ***AreaSeries*** objects into ***AreaSeries*** list.
```csharp
//Add area series to the chart
chart.ViewXY.AreaSeries.Add(areaSeries);
```

*Three area series all having BaseValue = 0.*
### Line style
Series support [LineStyle](/docs/inDetail/line-style.md).
### Points style
Series support [PointStyle](/docs/inDetail/points-style.md).
### Fill style
The fill can be set with ***Fill*** property and its sub-properties.
### Limits (UseLimits)
Exceed and deceed limits can be used like in [HighLowSeries](/docs/inDetail/HighLowSeries.md).
### BaseValue
Set base level with ***BaseValue*** property. Default value is 0, and Fill is created from that base-value towards Y-value. If Y-value smaller than ***BaseValue***, then no fill is created.

*An example of AreaSeries, when BaseValue = 50.*
### Adding data
The data values must be added in code. The data must be given in ascending order by X values, i.e.
**Points[i+1].X ≥ Points[i].X**.
Use ***AddValues***(*AreaSeriesPoint[], bool invalidate*) method to add data values to the end of existing values array.
```csharp
AreaSeriesPoint[] dataArray = new AreaSeriesPoint[6];
dataArray [0] = new AreaSeriesPoint (2004, 37000);
dataArray [1] = new AreaSeriesPoint (2005, 35000);
dataArray [2] = new AreaSeriesPoint (2006, 47000);
dataArray [3] = new AreaSeriesPoint (2007, 37000);
dataArray [4] = new AreaSeriesPoint (2008, 40000);
dataArray [5] = new AreaSeriesPoint (2009, 56000);
//Add data to the end
chart.ViewXY.AreaSeries[0].AddValues(dataArray, true);
```
To set whole series data at once while overwriting old data, assign the new data array directly:
```csharp
//Assign the data into points array
chart.ViewXY.AreaSeries[0].Points = dataArray;
```
### SeriesEventMarker
Series support [SeriesEventMarker](/docs/inDetail/event-markers-XY.md).
### DataBreaking
Series support [DataBreaking by NaN or other value](/docs/inDetail/data-breaking.md).
### ClipAreas
Series support [ClipAreas](/docs/inDetail/ClipAreas.md).
### LineSeriesCursors
Series can be tracked with [LineSeriesCursors](/docs/inDetail/LineSeriesCursor.md).
### DataCursor
Series can be tracked with [DataCursor](/docs/inDetail/data-cursors.md).
### LimitYToStackSegment
Series support [LimitYToStackSegment](/docs/inDetail/limit-y-value.md).
### Rendering data into the Persistent-Rendering-Layer
Series data can be added to either [PersistentSeriesRenderingLayer](/docs/inDetail/persistent-layer.md) or [PersistentSeriesRenderingIntensityLayer](/docs/inDetail/persistent-intensity-layer.md).
### Examples
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures*, *AreaXY*, *SegmentsWithLegend* and *AreaSeriesRealTimeXY* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## AreaSeriesPolar
Area series allow data visualization in filled area style. The line style at the edge can be edited with ***LineStyle*** property (similar to ViewXY line-series' [LineStyle](/docs/inDetail/line-style.md)). Fill can be changed with ***FillColor*** property.
Add the series to chart by adding ***AreaSeriesPolar*** objects to ***ViewPolar. AreaSeries*** list.

*Some data presented with ViewPolar’s AreaSeries.*
### Setting data
This code represents the data setting of previous figure.
```csharp
int iCount = 360;
PolarSeriesPoint[] points = new PolarSeriesPoint[iCount];
Random rnd = new Random();
for (int i = 0; i < iCount; i++)
{
points [i].Amplitude = 30f + rnd.NextDouble() * 5f * Math.Sin((double)i / 50f);
points [i].Angle = (double)i;
}
chart.ViewPolar.AreaSeries[0].Points = points;
```
### Examples
:::info
To see feature demonstration as example, check *ExampleAreaSeriesPolar*, *CombinedPolar*, *SpiderChart* and *Speedometer* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## AutoPadding
From version 12.5 ViewXY has ***AutoPadding*** property. This is the padding in PXs for control's edges, i.e. the outer edge or rim of the chart, which encloses ViewXY [Margins](/docs/inDetail/axis-layout-options.md). ***AutoPadding*** can be used when Margins are auto-adjusted (***AxisLayout.*** ***AutoAdjustMargins*** is enabled). Chart objects like [Annotations](/docs/inDetail/annotation-XY.md) and [LegendBoxes](/docs/inDetail/legend-box-properties.md) can be placed in the padded area.
***AutoPadding*** is Padding-structure in WinForms and Thickness-structure in WPF. For example,
```csharp
_chart.ViewXY.AutoPadding = new Padding(iLeftPadding, iTopPadding, iRightPadding, iBottomPadding);
```
:::info[Note]
***AutoPadding*** area is colored with same color as chart [background](/docs/inDetail/background-fill.md). Therefore, there is no visible boundary between ***AutoPadding*** and ***Margins***. However, it is possible to outline/color those areas with [Annotation](/docs/inDetail/annotation-XY.md) (as done in *ExampleAutoPadding* from [our Demo](/docs/getting%20started/RunningDemo.md)).
:::

*A simple ViewXY.AutoPadding usage example. Padded area is pseudo-colored differently [in grey] for clarity (with Annotation help).*
---
## Automatic Y fit
Use ***AutoYFit*** property to control the automatic Y axis adjustment. Automatic Y fit can be used to adjust the Y axis ranges to show all the data in the chart in visible X axis range. It is intended especially for real-time monitoring purposes. The fit is applied in time intervals, use ***UpdateInterval*** to set the interval in milliseconds. ***MarginPercents*** can be used to define if any empty space should be left between the series and the graph borders. By enabling ***Through***, the fitting analysis is made for all data, but may cause some overhead in performance critical systems. By disabling it, only a small piece of latest data is used for fitting routine and may cause improper behavior in certain applications.
***AutoYFit*** can be enabled via ***ZoomPanOptions***:
```csharp
_chart.ViewXY.ZoomPanOptions.AutoYFit.Enabled = true;
```
Which Y-axes are automatically fit should be also defined. With ***AutoYFit.TargetAllYAxes***, automatic Y fit can be applied to every Y-axis simultaneously. Alternatively, ***yAxis.AllowAutoYFit*** can be enabled for each Y-axis separately.
```csharp
// Enable AutoYFit for all Y axis.
_chart.ViewXY.ZoomPanOptions.AutoYFit.TargetAllYAxes = true;
// Enable AutoYFit only for this Y axis.
_chart.ViewXY.YAxes[0].AllowAutoYFit = true;
```
:::tip
***AxisY*** class also has ***Fit()*** methods for fitting in Y dimension.
:::
:::tip
Examples of usage could be found in our Demo application (see [Learning from Demo](/docs/getting%20started/RunningDemo.md)): *Signal reader; Audio L+R, area, spectrograms; Waveform, persistent spectrum*.
:::
---
## Axis class properties
Properties described here applicable all XY and 3D axes, unless specified otherwise.
In ViewXY an unlimited count of Y or X axes can be defined. Add the Y axes by using YAxes collection property (while X axes to XAxes collection). For example,
```csharp
// Adding Y-axes to the chart
chart.ViewXY.YAxes.Add(new AxisY());
// OR
AxisY axisY = new AxisY(_chart.ViewXY);
axisY.Title.Text = "Y-axis";
chart.ViewXY.YAxes.Add(axisY);
```

*Illustration of terms used: axis, divisions, grid etc.*
### Value type
***ValueType*** -property controls which value types are used by the axis labels.
```csharp
// Changing axis value type
chart.ViewXY.YAxes[0].ValueType = AxisValueType.DateTime;
```
***ValueType*** has the following options available:
Number
Regular numeric format for integer and decimal presentation. When ***AutoFormatLabels*** is disabled, ***LabelsNumberFormat*** applies. See [labels formatting](#Tick-value-labels-formatting).
:::tip[Note!]
When *AxisValueType* is *Number*, sometimes it is still desired that Axis tick interval is tuned not towards decimal but towards time unit (e.g. 6, 60, 600). This is mostly applicable for large time scales. When user wishes to have time interval of multiply of 6 or 60 (e.g 0-30-60-90 or 0-60-120-180), Axis property ***AutoDivSpacingForNumbersInTime*** should be enabled.
:::
Time
For time of day presentation. When ***AutoFormatLabels*** is disabled, ***LabelsTimeFormat*** applies. See [labels formatting](#Tick-value-labels-formatting).
DateTime
Date presentation, with optional time of day. When ***AutoFormatLabels*** is disabled, ***LabelsTimeFormat*** applies here as well, similarly to Time type. See [labels formatting](#Tick-value-labels-formatting).
:::tip[Note!]
For best accuracy, it is advised to set ***DateOriginYear***, ***DateOriginMonth*** and ***DateOriginDay*** just below (minimum) dates shown in the chart.
```csharp
xAxis.SetDateOrigin(new DateTime(2019, 12, 17));
// or
xAxis.DateOriginYear = 2019;
xAxis.DateOriginMonth = 12;
xAxis.DateOriginDay = 17;
```
Use ***DateTimeToAxisValue*** method to obtain axis values from a .NET *DateTime* object to be used in series data.
```csharp
// Convert current time to Y value
data[0].X = chart.ViewXY.XAxes[0].DateTimeToAxisValue(DateTime.Now);
```
:::
MapCoordsDegrees
Geographical map coordinate presentation in degrees decimals.
Example: 40.446195° -79.948862°
MapCoordsDegNESW
Geographical map coordinate presentation in degrees decimals, with N, E, S, W indication.
Example: 40.446195N 79.948862W
MapCoordsDegMinSecNESW
Geographical map coordinate presentation in degrees, arc minutes, arc seconds, with N, E, S, W indication.
Example: 40°2'13"N 9°58'2"W
MapCoordsDegPadMinSecNESW
Geographical map coordinate presentation in degrees, arc minutes, arc seconds, with N, E, S, W indication. The arc minute and second values are padded with zeros, if they are < 10. It is a great way to present coordinates in Y axis, as the numbers are aligned.
Example: 40°02'13"N 9°58'02"W
### AutoFormatLabels format string
When ***AutoFormatLabels*** property is enabled, LightningChart tries to estimate the best suitable *format string* for Axis' ticks values. Auto-string is intended to be as short as possible, but avoiding adjacent value to be rounded to same string/value.
For example, when numeric values are shown, the significant digits count is controlled by [zero-placeholder](https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings#the-0-custom-specifier) symbol (e.g. "0" "0.0", "0.000" etc.). However, only until 6 digits. If more precision is need label formatting switches to [Exponential notation](https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings#SpecifierExponent) (e.g. "E+0").
If user wants to know the last used label format string, one can call ***Axis.GetLabelsFormat()*** method. If axis range was changed, one should wait until rendering is done in order to read correct string format. Possible code excerpt:
```csharp
private void AxisX_RangeChanged(object sender, RangeChangedEventArgs e)
{
_chart.AfterRendering += _chart_AfterRendering;
}
private void _chart_AfterRendering(object sender, AfterRenderingEventArgs e)
{
_chart.AfterRendering -= _chart_AfterRendering;
string labelFormat = _chart.ViewXY.XAxes[0].GetLabelsFormat();
}
```
:::tip[Note]
If [DataCursor](data-cursors.md) is enabled (***ViewXY.DataCursor.Visible*** = True), then ***Axis.GetLabelsFormat()*** method returns format string used for Axis values formatting in ResultTable. Typically it is higher precision than Ticks labels.
:::
### Tick value labels formatting
***AutoFormatLabels*** allows the count of decimals, time format representation, or the use of exponential representation, to be calculated automatically to be suitable for visible range. To set the value formatting manually, ***AutoFormatLabels*** should be disabled.
```csharp
chart.ViewXY.YAxes[0].AutoFormatLabels = false;
```
***LabelsNumberFormat*** can be used to set the format of numeric values.
```csharp
// Always use two decimals
chart.ViewXY.YAxes[0].LabelsNumberFormat = "0.00";
// Exponential presentation with one decimal
chart.ViewXY.YAxes[0].LabelsNumberFormat = "0.0E+00";
```
:::tip
.NET support many [Standard](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom](https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings) *numeric format strings*.
:::
To set the time formatting manually, use ***LabelsTimeFormat*** property. It supports any count of second fractions (e.g. “.ffffffff”) allowing precise zoomed views.
```csharp
// Show hours, minutes, seconds and four significant digits
_chart.ViewXY.YAxes[0].LabelsTimeFormat = "HH:mm.ss.ffff";
```
:::tip
.NET support many [Standard](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom](https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings) *date and time format strings*.
:::
:::tip
Examples of usage (for custom label format string) could be found in our Demo application (see [Learning from Demo](/docs/getting%20started/RunningDemo.md)): *ExampleHighLow; ExampleTrillionDigital, ExampleCursorProjectOnAxes, ExampleECGPaperGrid*.
:::
### Range setting
Set the value range of an axis by giving values to ***Minimum*** and ***Maximum*** properties. ***Minimum*** should be less than ***Maximum***. When trying to set ***Minimum*** > ***Maximum***, or vice versa, internal limiter will limit the values near the other value. To set both values simultaneously, use ***SetRange(…)*** method. Passing ***Minimum*** > ***Maximum*** in ***SetRange()*** automatically flips these values so that ***Minimum*** < ***Maximum***.
```csharp
chart.ViewXY.YAxes[0].Minimum = 5;
chart.ViewXY.YAxes[0].SetRange(5, 10);
```
The value range of Y axis can be scrolled directly by dragging the axis with mouse when ***AllowScrolling*** is enabled. ***Minimum*** or ***Maximum*** can be modified by dragging the [ScaleNib](/docs/beginners%20guide/Zooming_panning.md#Zooming-with-axis-ScaleNibs) area (end of an axis) up or down when ***AllowScaling*** property is enabled.
```csharp
// Enabling / disabling dragging with mouse
chart.ViewXY.YAxes[0].AllowScrolling = true;
chart.ViewXY.YAxes[0].AllowScaling = true;
```
### Restoring range
Axis has properties ***RangeRevertEnabled***, ***RangeRevertMaximum*** and ***RangeRevertMinimum***. They can be used to revert axis ranges to specific values when mouse zooming is applied from right to left. See [RightToLeftZoomAction](/docs/inDetail/zooming_panning_InDetail.md#RightToLeftZoomAction) for details.
### Axis divisions, ticks' interval
***AutoDivSpacing*** -property allows the major divisions to be calculated automatically. It is enabled by default. The spacing is calculated based on value labels’ font size and ***AutoDivSeparationPercent*** properties to be as user-friendly as possible. ***AutoDivSeparationPercent*** leaves a space between the value labels. It is based on the label’s height, meaning that increasing the value reduces the amount of major divisions.
***AutoDivSpacing*** and ***AutoDivSeparationPercent*** do not affect minor divisions. Instead, they are calculated between major divisions based on the ***MinorDivCount*** property value. The default value is five minor ticks and they are enabled (***MinorDivTickStyle.Visible*** property)
```csharp
// 100 percent of value labels’ height left between each label
chart.ViewXY.YAxes[0].AutoDivSeparationPercent = 100;
// Enabling minor division ticks
chart.ViewXY.YAxes[0].MinorDivTickStyle.Visible = true;
chart.ViewXY.YAxes[0].MinorDiv = 5;
```
If ***AutoDivSpacing*** is disabled, the division spacing can be controlled manually with ***MajorDiv*** and ***MajorDivCount*** -properties. ***MajorDiv*** controls the spacing by magnitude, whereas ***MajorDivCount*** controls it by division count (only one of those 2 properties should be set, another will be calculated automatically). ***KeepDivCountOnRangeChange*** property can be used to force maintaining the divisions count the same whenever the axis range is changed, regardless of ***MajorDiv*** setting.
```csharp
// Major ticks after each 20 units (0, 20, 40, 60…)
chart.ViewXY.YAxes[0].MajorDiv = 20;
// Show exactly five major divisions
chart.ViewXY.YAxes[0].MajorDivCount = 5;
// Keep the division count the same even if the axis range is changed
chart.ViewXY.YAxes[0].KeepDivCountOnRangeChange = true;
```
:::tip[Note]
The position (interval) of standard axis labels are calculated is such way that overlap between them is prevented (even when automatic division spacing is not set).
When ***DivisionReduction*** property is enabled (default), ticks' count can be smaller than set with ***MajorDivCount*** (with ***AutoDivSpacing*** disabled). In contrast, when ***DivisionReduction*** is disabled ticks' count will be as set by ***MajorDiv*** or ***MajorDivCount*** -properties, but axis-labels will be drawn only to some of them (without overlapping).
Only [CustomTicks](#Custom-ticks) labels are allowed to overlap if ***DivisionReduction*** is disabled.
:::
### Tick Style
Major division tick style can be set from ***MajorDivTickStyle*** property. Edit the ticks and labels orientation by using ***MajorDivTickStyle.Alignment*** property. The value labels are drawn next to major division ticks. Respectively, the minor division properties can be modified with ***MinorDivTickStyle*** property.
```csharp
// Changing alignment and tick length of the major division ticks
chart.ViewXY.YAxes[0].MajorDivTickStyle.Alignment = Alignment.Far;
chart.ViewXY.YAxes[0].MajorDivTickStyle.LineLength = 20;
```
:::caution[Note!]
For ***AxisY*** class, the ticks (minor or major) ***Alignment*** property is taken into account only if ***ViewXY. AxisLayout. [YAxisAutoPlacement](/docs/inDetail/axis-layout-options.md)*** property is 'Off' or ***ViewXY. AxisLayout. AutoAdjustMargins*** property is disabled. Same applies for ***AxisX*** class (with corresponding names of properties).
:::
Other tick styling properties under ***MajorDivTickStyle*** / ***MinorDivTickStyle*** property are ***Color*** and ***Visible***.
### Labels Style
Axis' labels style can be changed with properties ***LabelsColor***, ***LabelsAngle*** and ***LabelsFont***. Label's formatting is discussed in chapter [Tick value labels formatting](#Tick-value-labels-formatting).
### LabelTicksGap
Gap between labels and ticks is controlled by ***LabelTicksGap*** property. Value is in pixels (default is 5).
### Grid
Horizontal grid lines are drawn on vertical positions of division ticks. Major grid for major division ticks, minor grid for minor division ticks. ***MajorGrid*** and ***MinorGrid*** properties can be used to edit the appearance of the grids.
```csharp
// Modifying the grid styles
chart.ViewXY.YAxes[0].MajorGrid.Color = Color.FromArgb(100, 200, 200, 200);
chart.ViewXY.YAxes[0].MinorGrid.Pattern = LinePattern.Dash;
```
### Custom ticks
Axis tick positions and label texts can be manually set by using custom ticks. Set ***CustomTicksEnabled*** true and define the positions of the ticks with the ***CustomTicks*** list property.

*Custom tick properties*
Custom ticks can consist of a tick, a grid or both. Use ***Style*** to select between *Tick*, *Grid* or *TickAndGrid* respectively. The color of a tick or a grid can be modified via ***Color*** property. Set tick length in ***Length*** property. The grid line pattern follows the setting of ***MajorGrid.Pattern*** and ***PatternScale*** properties of axis.
CustomAxisTick has ***AxisValue*** and ***LabelText*** properties to define their positions and corresponding label texts. When using custom ticks, disable ***AutoFormatLabels*** to show the custom label texts. Furthermore, ***InvalidateCustomTicks()*** should be called after setting new custom ticks in code.
```csharp
// Adding a custom tick with a green tick and grid line
_chart.ViewXY.YAxes[0].CustomTicks.Add(new CustomAxisTick(_chart.ViewXY.YAxes[0], 14, "Sell level\nUSD 14", 10, true, Colors.Green, CustomTickStyle.TickAndGrid));
// White tick with no grid line
_chart.ViewXY.YAxes[0].CustomTicks.Add(new CustomAxisTick(_chart.ViewXY.YAxes[0], 12.2, "Month\nmedian", 20, true, Colors.White, CustomTickStyle.Tick));
// Red tick and grid line
_chart.ViewXY.YAxes[0].CustomTicks.Add(new CustomAxisTick(_chart.ViewXY.YAxes[0], 11, "Buy level\nUSD 11", 10, true, Colors.Red, CustomTickStyle.TickAndGrid));
// Allow showing the custom tick strings
_chart.ViewXY.YAxes[0].CustomTicksEnabled = true;
_chart.ViewXY.YAxes[0].AutoFormatLabels = false;
_chart.ViewXY.YAxes[0].MajorGrid.Pattern = LinePattern.Dot;
_chart.ViewXY.YAxes[0].InvalidateCustomTicks();
```

*Custom ticks on Y axis. On the left, axis.AutoFormatLabels = false. On the right, AutoFormatLabels = True.*
Minor ticks or grids are not shown when ***CustomAxisTicksEnabled*** is true. To set arbitrary minor ticks or grids, just add ***CustomAxisTicks*** in the CustomTicks collection with different colors or line lengths.
:::info
To see feature demonstration as example, check *Custom axis ticks*, *Date axes and custom ticks* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### Event based axis value formatting
Besides ***CustomAxisTicks***, axis value labels can also be formatted via ***FormatValueLabel*** -event. It modifies each value label of the corresponding axis based on the returned string value. The event has ***e.Axis*** and ***e.Value*** properties, which can be used access the axis object and the label value being modified. Unlike ***CustomAxisTicks***, ***FormatValueLabel*** cannot be used to change the position of the labels, as they still follow the division settings ([Axis divisions](#Axis-divisions-ticks-interval)) for the axis.
```csharp
// Subscribing to FormatValueLabel -event for the Y-axis
_chart.ViewXY.YAxes[0].FormatValueLabel += Chart_FormatValueLabel;
// Modifying the value labels inside the event
private string Chart_FormatValueLabel(object sender, FormatValueLabelEventArgs e)
{
return "Y-axis value: " + e.Value.ToString();
}
```

*FormatAxisValues used with the lower y-axis. The values are shown as ”Y-axis value: ” + current value.*
***FormatValueLabel*** can be used with both Y- and X-axis as well as with every axis in View3D.
:::info
To see feature demonstration as example, check *Business dashboard*, *ExamplePersistentIntensitySignal*, *ExampleAxisLabelRangeEdit* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
How to create Axis labels with scientific notation could be found in our [special guide](/docs/how-to/scientific-notation.md).
### Reversed X and Y axis
By enabling ***Reversed*** property, X and Y axis can be shown reversed, so that minimum value is above/later than the maximum value. Handy feature when, for example, visually negating polarity of the series data assigned to the Y axis.
```csharp
chart.ViewXY.YAxes[0].Reversed = true;
```
### Logarithmic axes
Set ***ScaleType*** to *Logarithmic* to use a logarithmic presentation. Set the logarithm base value with ***LogBase*** property. The chart can also show logarithmic values between 0…1. Use ***LogZeroClamp*** to set the minimum value in the axis. To use typical minimum value of a log axis, set 1. To use values below zero, set a proper small positive value, like 1.0E-20, suitable for the used data. To use special formatting for tick labels, set ***LogLabelsType***.
```csharp
// Setting a logarithmic axis
chart.ViewXY.YAxes[0].ScaleType = ScaleType.Logarithmic;
chart.ViewXY.YAxes[0].LogBase = 10;
chart.ViewXY.YAxes[0].LogZeroClamp = 1;
chart.ViewXY.YAxes[0].LogLabelsType = LogLabelsType.Log10Exponential;
```
#### Exponential presentation for 10 base

*Logarithmic Y axis with values near zero. LogZeroClamp is set to 1.0E-20. LogBase is set to 10, LogLabelsType is set to Log10Exponential, to show the values in 1.0E presentation.*
#### Natural logarithm
Set ***LogBase*** to *Math.E*, and set ***LogLabelsType*** to *LogE_MultiplesOfNeper* option.

*Natural logarithm view. LogBase is set to Math.E LogLabelsType is set to LogE_MultiplesOfNeper.*
### Axis position
Axis vertical or horizontal position defined by ***ViewXY. AxisLayout*** options (see [Axis layout options](axis-layout-options.md)). X-axes is controlled by ***AxisLayout. XAxisAutoPlacement*** property, while Y-axes is controlled by ***AxisLayout. YAxisAutoPlacement*** property.
Only when auto-placement is *Off* the ***Axis.Position*** property is taken into account. ***Position*** set X-axis placement as percents of the graph height (where 0 sets the axis in top edge, 50 in the middle and 100 in bottom edge). While Y-axis placed as percents of the graph width (0 sets the axis in left edge, 50 in the middle and 100 in right edge).

*XAxisAutoPlacement = Off. Automatic axis placement is disabled, and Position and Alignment properties of each axis apply separately. First axis Position = 0, Second axis Position = 50 and Third axis position = 100.*

*YAxisAutoPlacement = Off. Automatic axis placement is disabled, and Position and Alignment properties of each axis apply separately. First axis Position = 0, Second axis Position = 20 and Third axis position = 80.*
### Converting between axis values and screen coordinates
Axes have methods to convert axis values (data point values) to screen coordinates and screen coordinates to axis values. Use ***ValueToCoord*** method to convert an axis value to a screen coordinate, and ***CoordToValue*** to convert a screen coordinate to an axis value. Set ***UseDIP = False***, if pixels are preferred, not Device independent pixels (DIPs) (see more about [DPI handling](/docs/inDetail/dpi-handling.md)).
```csharp
float screenCoordinate = _chart.ViewXY.XAxes[0].ValueToCoord(axisValue, true);
```
***ValueToCoord*** and ***CoordToValue*** methods are available after the chart has got its final size. For example, subscribe to ***chart. AfterRendering*** event to ensure the chart has been fully rendered.
To convert multiple values or coordinates at once, use ***ValuesToCoords*** and ***CoordsToValues*** methods. ***ValuesToCoords*** takes input as double array and returns screen coordinates as float array. ***CoordsToValues*** takes input as integer array for X axis (but as float array for Y axis) and return axis values as double array.
```csharp
chart.ViewXY.YAxes[0].CoordsToValues(coordArray, out doubleValueArray, false);
```
### Converting between axis values and DateTime
Although Axis labels can show time-date, internally LightningChart axis uses double type (and precision) values. While label type is controlled by [***Value*** property](#Value-type), the data itself should be converted from DateTime to double-type with ***DateTimeToAxisValue*** method. For example,
```csharp
lineSeriesPoints[point].X = _chart.ViewXY.XAxes[0].DateTimeToAxisValue(dataA[point].Date);
```
Note, if ***Value*** property is set to *Time* or *DateTime* option, when data point value is used as represented in seconds (this is what ***DateTimeToAxisValue*** method conversion is about).
When user wants to convert axis/series double-type value back to DateTime, one should use Axis ***AxisValueToDateTime*** method.
:::tip[Note!]
For best conversion accuracy, it is advised to set ***DateOriginYear***, ***DateOriginMonth*** and ***DateOriginDay*** just below (minimum) dates shown in the chart.
```csharp
xAxis.SetDateOrigin(new DateTime(2024, 12, 17));
// or
xAxis.DateOriginYear = 2024;
xAxis.DateOriginMonth = 12;
xAxis.DateOriginDay = 17;
```
:::
### Axis end point labels
Regular axis major ticks and labels are placed at uniform intervals. Therefore, axis minimum or maximum could be without a label, especially when the axis is panned, scrolled or logarithmic axis is zoomed deeply. The labels can be enforced to be shown at both ends of axis by enabling ***EndPointLabelsVisible*** property.
***PreferEndPointLabelsOverNearbyMajorTick*** property controls if the end label or a regular major tick label is preferred if their positions overlap. ***EndPointMajorTickThreshold*** property defines the number of major ticks that must be visible before the end point labels are hidden. The default -1 means the end point labels will always be visible. If logarithmic axis major tick count less than or equal to ***EndPointMajorTickThreshold***, then label next to minor tick will be shown.

*On the left chart’s X axis PreferEndPointLabelsOverNearbyMajorTick is disabled, while on the right this property is enabled. The left chart’s Y axis is set to always show end labels (EndPointLabelsVisible=true, EndPointMajorTickThreshold=-1), while the right chart’s Y axis is configured to show a minor tick in addition to one major tick (EndPointLabelsVisible=true, EndPointMajorTickThreshold=1).*
### Y Axis specific properties
#### MiniScale
***MiniScale*** is a miniature X and Y axis substitute. In some applications this kind of scale presentation is preferred for quick visual overview of data magnitude, or alternatively, when there’s no space for actual axes. ***MiniScale*** can be enabled via ***Visible*** -property. ***MiniScale*** is a sub-property of Y axis class. However, the X dimension is always bound to the first X axis (*XAxes[0]*). Set the visible units by modifying ***Units.Text*** property of X and Y axis. ***MiniScale*** cannot be used together with logarithmic axes.
```csharp
// Configuring a MiniScale
chart.ViewXY.YAxes[0].MiniScale.Visible = true;
chart.ViewXY.YAxes[0].MiniScale.VerticalAlign = AlignmentVertical.Bottom;
chart.ViewXY.YAxes[0].MiniScale.Offset.SetValues(-10, -30);
chart.ViewXY.YAxes[0].MiniScale.PreferredSize = new SizeDoubleXY(30, 30);
chart.ViewXY.XAxes[0].Units.Text = "s";
chart.ViewXY.YAxes[0].Units.Text = "µV";
```

*MiniScale in the bottom-right corner of the graph.*
#### UsePalette
The palette coloring can be set for Y axis line too. Enable [UsePalette](/docs/inDetail/advanced-line-coloring.md) property of Y axis and assign the preferred series in ***PaletteSeries*** property.
```csharp
//Color the Y axis too with the series palette
_chart.ViewXY.YAxes[0].PaletteSeries = pls;
_chart.ViewXY.YAxes[0].UsePalette = true;
```
### X Axis specific properties
#### Real-time monitoring scrolling
When making a real-time/streaming (monitoring) solution, the X axis must be scrolled to correctly show the current monitoring position, which usually is the time stamp of latest signal point. Set the latest time stamp to ***ScrollPosition*** property after the new signal points have been set to a series.
```csharp
// Set real-time monitoring scroll position to the latest X value
chart.ViewXY.XAxes[0].ScrollPosition = latestDataPoint.X;
```
LightningChart has several scrolling modes, selected using ***ScrollMode*** property.
```csharp
chart.ViewXY.XAxis[0].ScrollMode = XAxisScrollMode.Scrolling;
```
##### None
The default option. No scrolling is applied when setting ***ScrollMode*** to *None*. This is often the selection to use when not using real-time monitoring.
##### Stepping
When collected data reaches the end of the X axis, the axis with all series data is shifted left by a stepping interval. This shift is executed every time the X axis end is reached. ***SteppingInterval*** property is defined as value range.
```csharp
chart.ViewXY.XAxes[0].SteppingInterval = 3;
```

*X axis scroll mode: stepping*
##### Scrolling
X axis is kept stationary until scrolling gap has been reached, after which the X axis with all series is continuously shifted left. If the scrolling should take effect when the scroll position reaches the end of X axis, set ***ScrollingGap*** to 0. ***ScrollingGap*** property is defined as percents of graph width.
```csharp
chart.ViewXY.XAxes[0].ScrollingGap = 15;
```

*X axis scroll mode: scrolling*
Waveform stability during scrolling
LightningChart supports incremental rendering data construction of real-time signal, when using ***series. AddPoints()***, ***AddValues()*** or ***AddSamples()*** -methods. This means that rendering data is calculated only from the new part of data and combined with the existing rendering data.
***PointLineSeries***, ***SampleDataSeries***, ***AreaSeries*** and ***HighLowSeries*** have a specific property for ***ScrollMode*** = *Scrolling*, which effects the visual stability of scrolled series maintaining the waveform quality. The property is called ***ScrollingStabilizing***.
```csharp
chart.ViewXY.PointLineSeries[0].ScrollingStabilizing = true;
```
When ***ScrollingStabilizing*** is enabled, floating point coordinates are rounded to nearest integer coordinate, which results into a visually stable, non-fluctuating waveform. In most cases, this is the best approach. It may, however, distort the phase info slightly when rounding the coordinates.
When ***ScrollingStabilizing*** is disabled, data rendering uses floating point coordinates which appear as slightly fluctuating waveform when GPU decides the pixel coordinate. This gives better visual quality especially when displaying sine data where there’s a transition going up and down nearly every other pixel.
To use incremental rendering data construction, add new points as follows
```csharp
chart.BeginUpdate();
series.AddPoints(array,false);
xAxis.ScrollPosition = latestXValue;
chart.EndUpdate();
```
Full refresh of rendering data can be made any time with ***InvalidateData()*** call of series.
```csharp
chart.BeginUpdate();
series.AddPoints(array,false);
series.InvalidateData();
xAxis.ScrollPosition = latestXValue;
chart.EndUpdate();
```

*Waveform stability during scrolling*
##### Sweeping
Sweeping mode gives probably the most user-friendly real-time monitoring view. Sweeping uses two X axes. The first axis is collected full after which a sweeping gap appears. The second X axis is then swept over the first one. Both X axes show their own value labels. ***SweepingGap*** property is defined as percents of graph width.
```csharp
chart.ViewXY.XAxes[0].SweepingGap = 5;
```

*X axis scroll mode: sweeping*
##### Triggering
The X axis position is determined by a series value exceeding or falling below a trigger level. Use ***Triggering*** property to set the triggering options. Triggering can be set active by enabling ***Triggering. TriggeringActive*** property.
One series has to be set as a triggering series. Accepted triggering series types are ***PointLineSeries*** and ***SampleDataSeries***. Set the triggering Y level with ***Triggering. TriggerLevel***. Use ***Triggering. TriggeringXPosition*** to order where the level triggered point will be drawn horizontally, as percents of graph width.

*X axis scroll mode: Triggered with static X grid.*
When using a triggered X-axis scroll position, it usually is not suitable to show the regular X axis with values and grid because of jumping from place to another based on the incoming series data.
- Approach 1: Use static X grid. Hide the regular X axis objects by setting ***XAxis.Visible*** = *false* (or ***LabelsVisible*** = *false*, ***MajorGrid.Visible*** = *false* and ***MinorGrid.Visible*** = *false*). Then, show the static X grid by setting ***Triggering.StaticMajorXGridOptions*** and ***Triggering.StaticMinorXGridOptions***.
- Approach 2: Create another X axis, with preferred scale, and set it to ViewXY collection. Don’t assign the second XAxis for the series.
For scale indication, use Y axis [***MiniScale***](#MiniScale) or define an [AnnotationXY](/docs/inDetail/annotation-XY.md) to show range like “200 ms/div”.
:::info
To see feature demonstration as example, check *Oscilloscope* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
#### Scale breaks
Starting from version 8, X axes support ***ScaleBreaks***. ***ScaleBreaks*** allow excluding specific X ranges, e.g. inactive trading hours/dates or machinery off-production hours. All the series, that have been assigned to the specified X axis, are clipped, including axis and labels themselves.
There are limitations of when ***ScaleBreaks*** can be used: ***ScrollMode*** must be set to *‘None’* and ***ScaleType*** to *‘Linear’*.
Insert the ***ScaleBreak*** objects in ***ScaleBreaks*** collection of X axis.

*ScaleBreak properties*
Specify the range of the break with ***Begin*** and ***End***. They are given as axis values, not DateTimes. Use ***axis. DateTimeToAxisValue*** method to convert them if using DateTimes.
Gap width can be adjusted with ***Gap***, also 0 is accepted if no gap should be visible. Gap appearance can be configured with ***Style***.
- With ***Style*** = *‘Fill’*, adjust the fill with ***Fill*** property.
- With ***Style*** = *‘DiagonalLineUp’* or *‘DiagonalLineDown’*, adjust the appearance with ***DiagonalLineSpacing*** and ***LineStyle*** properties.
By setting ***Enabled*** = False, the break is made not effective.
***PointLineSeries***, ***AreaSeries*** and ***HighLowSeries*** have ***ContinuousOverScaleBreak*** property. By enabling it, a connecting line will be rendered over the gap.

*Original trading data, Monday to Friday, 10 AM – 6 PM. ScaleBreaks haven’t been applied. Majority of the time range doesn’t have data as stock exchange has been closed making it harder to see the essential info. PointLineSeries jumping from Close-to-Close values.*

*ScaleBreaks applied to exclude non-active trading hours. More screen space is available for essential data. Style = Fill, Gap = 10. PointLineSeries jumping from Close-to-Close values, PointLineSeries.ContinuousOverScaleBreak = True.*

*ScaleBreaks applied, during non-active trading hours. Style = DiagonalLinesUp, Gap = 20. PointLineSeries.ContinuousOverScaleBreak = True.*

*PointLineSeries.ContinuousOverScaleBreak = False. The lines are not connected from previous point to next point over the gap. Instead, they continue to their original direction as if no scale break has been defined.*
:::info
To see feature demonstration as example, check *ExampleTradingScaleBreaks*, *ExampleLineSeriesXYFeatures* from [our Demo](/docs/getting%20started/RunningDemo.md).
Mode details about ScaleBreaks could be found in [following blog](https://lightningchart.com/blog/using-scale-breaks-data-visualization/)
:::
---
## Axis layout options (XY)
The general properties adjusting axis placement, automatic margins etc. can be found in ***ViewXY.AxisLayout*** properties and sub-properties.

*AxisLayout property tree*
### Margins
Margins are empty spaces around the graph area. All the contents of the view are fitted inside the margins except for annotations, markers, legend boxes and the chart title.

*Margins surrounding the graph area. Content is fitted inside the margin area. Chart title and legend box can be positioned on margins.*
When ***ViewXY.AxisLayout. AutoAdjustMargins*** is enabled, the graph size is adjusted so that there is enough space for all the axes and chart title. When it is disabled, ***ViewXY. Margins*** property applies allowing setting margins manually.
By default, a customizable border rectangle, ***ViewXY. Border***, is drawn around the graph area in the location of margins. It can be turned off by setting ***Border.Visible*** = False. The color of the ***Border*** can also be changed via ***Color*** property. Furthermore, ***Border*** can also be rendered behind the series by setting ***RenderBehindSeries*** to True. In version 12.4 ***Border. Width*** property is added. Therefore, border line's thickness can be set to values other than (default) 1 px.

*ViewXY with 25px Border*
During the run time, the margin rectangle in pixels can be retrieved by calling ***ViewXY. GetMarginsRect()*** method, which applies to both automatic and manual margins. It is useful when needing to do screen-coordinate based computation or object placement.
***ViewXY. MarginsChanged*** event can be set to trigger when a margin rectangle has been changed because of (for example) resizing it.
### X-axis placement
***ViewXY.AxisLayout.XAxisAutoPlacement*** controls how the X axes are placed vertically. For example,
```csharp
chart.ViewXY.AxisLayout.XAxisAutoPlacement = XAxisAutoPlacement.AllBottom;
```

*XAxisAutoPlacement = AllBottom. Three X axes added, all are positioned below the graph.*

*XAxisAutoPlacement = AllTop. All X axes are positioned above the graph.*

*XAxisAutoPlacement = BottomThenTop. Axes are distributed below and above the graph, every other axis to the opposite side, starting from bottom.*

*XAxisAutoPlacement = TopThenBottom. Axes are distributed below and above the graph, every other axis to the opposite side, starting from top.*

*XAxisAutoPlacement = Explicit. The axis appears on the side of the selected explicitly. XAxis1 has ExplicitAutoPlacementSide property set to Bottom, whereas XAxis2 and XAxis3 to Top.*

*XAxisAutoPlacement = Off. Automatic axis placement is disabled, and [Position](axis-class-properties.md#Axis-position) and Alignment properties of each axis apply separately. First axis Position = 0, Second axis Position = 50 and Third axis position = 100.*
:::info
To see feature demonstration as example, check *Automatic axis placements*, *Several axes* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### Y-axis placement
***ViewXY.AxisLayout.YAxisAutoPlacement*** controls how the Y-axes are placed horizontally. For example,
```csharp
chart.ViewXY.AxisLayout.YAxisAutoPlacement = YAxisAutoPlacement.AllLeft;
```

*YAxisAutoPlacement = AllLeft. Three Y axes added, all are positioned to the left side of the graph.*

*YAxisAutoPlacement = AllRight. All Y axes are positioned to the right side of the graph.*

*YAxisAutoPlacement = LeftThenRight. Axes are distributed to left and right side of the graph, every other axis to the opposite side, starting from the left side.*

*YAxisAutoPlacement = RightThenLeft. Axes are distributed to left and right side of the graph, every other axis to the opposite side, starting from the right side.*

*YAxisAutoPlacement = Explicit. The axis appears on the side of the selected explicitly. YAxis1 and YAxis2 have ExplicitAutoPlacementSide property set to Left, and YAxis3 to Right.*

*YAxisAutoPlacement = Off. Automatic axis placement is disabled, and [Position](axis-class-properties.md#Axis-position) and Alignment properties of each axis apply separately. First axis Position = 0, Second axis Position = 20 and Third axis position = 80.*
:::info
To see feature demonstration as example, check *Y-axes layouts*, *Automatic axis placements*, *Several axes* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### Graph segments and Y axes placement in them
If there are several Y axes defined, they can be vertically aligned in 3 different ways: *Layered*, *Stacked* and *Segmented*. This can selected by ***ViewXY.AxisLayout. YAxesLayout*** property.
#### Layered
In *Layered* view, all the Y axes start from the top of the graph and stretch to the bottom of the graph. The axes and the series bound to them share the same vertical space.
```csharp
chart.ViewXY.AxisLayout.YAxesLayout = YAxesLayout.Layered;
```

*An example view of 4 Y axes in YAxesLayout = Layered.*
:::info
To see feature demonstration as example, check *Y-axes layouts*, *Automatic axis placements*, *Several axes* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
#### Stacked
In *Stacked* view each Y axis gets its own vertical space. All Y axes have equal height.
```csharp
chart.ViewXY.AxisLayout.YAxesLayout = YAxesLayout.Stacked;
```

*An example view of 4 Y axes in YAxesLayout = Stacked.*
:::info
To see feature demonstration as example, check *Y-axes layouts*, *Multi-channel cursor tracking*, *Data breaking in series* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
#### Segmented
In *Segmented* view the vertical space is divided between ***Segments***. Each segment can contain several Y axes. The relational height of each segment can be set, and every Y axis within a segment gets the segment's height.
```csharp
chart.ViewXY.AxisLayout.YAxesLayout = YAxesLayout.Segmented;
```
***Segments*** must be created in ***AxisLayout.Segments*** collection. The segment added first will be placed on the top of the chart. A segment has only one property, ***Height***. It is a relative size versus other segments. It is not defined in screen pixels, as the segments need to rescale with the chart's size.
```csharp
// Adding two segments, the second one is twice as high as the first one
chart.ViewXY.AxisLayout.Segments.Add(new YAxisSegment());
chart.ViewXY.AxisLayout.Segments.Add(new YAxisSegment());
chart.ViewXY.AxisLayout.Segments[0].Height = 1;
chart.ViewXY.AxisLayout.Segments[1].Height = 2;
```
The Y axes can be assigned with a segment by setting ***yAxis.SegmentIndex*** property. The ***SegmentIndex*** is the index in the ***AxisLayout.Segments*** collection.
```csharp
chart.ViewXY.YAxes[0].SegmentIndex = 0;
chart.ViewXY.YAxes[1].SegmentIndex = 1;
```

*An example view of 4 Y axes in YAxesLayout = Segmented.*
:::tip[Tip]
In comparison to many instances of LightningChart control (each with one pair of X- and Y-axis), *Segmented* or *Stacked* ***YAxesLayout*** is far more efficient in rendering. While each instance of LightningChart reserves same amount of memory, stacking a lot of Y-axes has almost no memory cost and performance is better.
:::
When a *Stacked* or *Segmented* view is selected, the vertical space between graph segments can be adjusted by using ***ViewXY.AxisLayout. SegmentsGap*** property.
```csharp
// Sets 10 scree-pixel gap between each segment
chart.ViewXY.AxisLayout.SegmentsGap = 10;
```
***ViewXY.GetGraphSegmentInfo()*** -method can be used to find out where the graph segment borders are, if there is a need to implement segment specific user interface logic.
```csharp
// Getting top and bottom coordinates of every segment
float[] topCoords = chart.ViewXY.GetGraphSegmentInfo().SegmentTops;
float[] bottomCoords = chart.ViewXY.GetGraphSegmentInfo().SegmentBottoms;
```
:::info
To see feature demonstration as example, check *Y-axes layouts*, *Multiple legends*, *Segments with splitters* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### Axis grid strips
The axis grid (division) intervals can be shown over the graph background as fills. By setting ***ViewXY.AxisLayout.AxisGridStrips*** to *X*, X-axis is used to set the strips. Respectively, by setting ***AxisGridStrips*** to *Y*, Y-axis is used to set the strips. *Both* -option sets the strips for both X and Y axis, while *None* shows no grid strips are used at all.
```csharp
chart.ViewXY.AxisLayout.AxisGridStrips = XYAxisGridStrips.X;
```
***XGridStripAxisIndex*** sets the X-axis that is to be used for strips in case several axes are used. Only one X-axis can be set at a time.
```csharp
chart.ViewXY.AxisLayout.XGridStripAxisIndex = 0;
```
***YGridStripAxisIndexLayered*** property is used only when ***AxisLayout.YAxisLayout*** sets as *Layered*, and specifies which of Y-axis will be showing strips. If *Stacked* option of ***YAxisLayout*** is used, then all Y-axes have their own strips.
```csharp
chart.ViewXY.AxisLayout.YGridStripAxisIndexLayered = 0;
```
The strip colors can also be adjusted in ***GridStripColor*** property of X- or Y-axis object.
```csharp
chart.ViewXY.YAxes[0].GridStripColor = Color.FromArgb(80, 0, 0, 100);
```

*AxisGridStrips = None*

*AxisGridStrips = X*

*AxisGridStrips = Y*

*AxisGridStrips = Both. In addition, GridStripColor changed to other than default for the Y-axis.*
:::info
To see feature demonstration as example, check *Historic data review*, *Zoom bar chart* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### AutoAdjustAxisGap
***AutoAdjustAxisGap*** sets the space between two adjacent axis areas in pixels, when ***XAxisAutoPlacement*** is enabled.
```csharp
chart.ViewXY.AxisLayout.XAxisAutoPlacement = XAxisAutoPlacement.AllBottom;
chart.ViewXY.AxisLayout.AutoAdjustAxisGap = 10;
```
### Axis Title Placement
By enabling ***XAxisTitleAutoPlacement*** (or ***YAxisTitleAutoPlacement***), the axis title distance is automatically calculated based on value labels’ length, alignment options of axes and tick lines. If ***XAxisTitleAutoPlacement*** (or ***YAxisTitleAutoPlacement***) is disabled, ***Title. DistanceToAxis*** of axis object property sets the distance to axis line instead.
```csharp
chart.ViewXY.AxisLayout.XAxisTitleAutoPlacement = false;
chart.ViewXY.XAxis[0].Title.DistanceToAxis = -20;
```
:::tip
Note that properties ***Title. VerticalAlign*** (for x-axis) ***Title. HorizontalAlign*** (for Y-axis) set the direction where ***DistanceToAxis*** is applied (unless it is *Center*). So is negative values of ***Title. DistanceToAxis***.
:::
---
## Setting background fill
### Chart Background
All views have a common background fill.
- in WinForms use ***chart. Background*** property
```csharp
chart.Background.Color = Color.DarkBlue;
```
- in WPF use ***chart. ChartBackground*** property
```csharp
chart.ChartBackground.Color = Colors.DarkBlue;
```
The background fill (and ***Fill*** class in general) supports: solid, gradient and bitmap fills.
- Solid color fills. Set ***GradientFill*** = *Solid* and use ***Color*** to define the color.
- Gradient fills, going from ***Color*** to ***GradientColor***. Set ***GradientFill*** = *Linear* / *Radial* / *RadialStretched* / *Cylindrical*. Use ***GradientDirection*** to control the fill direction in *Linear* and *Cylindrical* gradients.
```csharp
chart.ChartBackground.GradientFill = GradientFill.Cylindrical;
chart.ChartBackground.GradientColor = Colors.Black;
chart.ChartBackground.GradientDirection = -45;
```
- Bitmap fills, with different tiling and stretching options. Bitmap tint and alpha also are supported to, to make translucent bitmap fills.

*Setting background underneath ViewXY. GradientFill = Solid, and Color = DimGray.*

*Setting Background to gradient cylindrical, under GradientFill = Cylindrical, Color = Maroon, GradientColor = Black. GradientDirection = -45 degrees.*

*Setting Background to tiled bitmap fill. Style = Bitmap, a picture set to Bitmap.Image, and Bitmap.Layout = Tile, under ViewPolar.*
#### Setting transparent background
In WPF, the chart can be made appear transparent, so the objects placed underneath the chart will show through.
Set ***ChartBackground.Color*** = #00000000 (Black transparent).
:::note
Note! Do NOT set ‘Transparent’ (#00FFFFFF). It may not show through.
:::

*Transparent background in WPF chart*
:::warning
WinForms does not support transparent background of controls.
:::
### Graph(XY) background
:::tip
Graph is the area where all grids, series, series cursors, event markers etc. are rendered.
:::
In ViewXY GraphArea has own background. It is controlled by ***ViewXY. GraphBackground*** property. ***GraphBackground*** is the same ***Fill*** type as chart-background described above. Therefore, users can apply solid, gradient and bitmap fills. For example,
```csharp
chart.ViewXY.GraphBackground.Color = Colors.DarkBlue;
```
There is one noticeable difference from chart-background. If user wants to make ***GraphBackground*** transparent, then one should set ***ViewXY.GraphBackground.Style*** to *None*
```csharp
chart.ViewXY.GraphBackground.Style = RectFillStyle.None;
```

*GraphBackground.Style is None, while ChartBackground.GradientFill is Linear between Crimson and Blue colors.*
---
## Bands
***Band*** can be considered as a series. They have the same user interface actions as other series, but one band series contains only one band (although it could be many bands in ***ViewXY.Bands*** collection). A band is a vertical or horizontal area reaching from a margin across to another. A band can be bound to a Y axis or X axis using the ***Binding*** property. If the band is bound to Y axis, ***AssignYAxisIndex*** property must also be set. If the series is bound to X axis, ignore ***AssignYAxisIndex*** property, or set it as unassigned (-1).
If the band should be behind the line or bar series, set ***Behind*** property true. ***Band*** edges are set by ***ValueBegin*** and ***ValueEnd*** properties, which are values of the bound axis. ***Band*** can be dragged to another location with mouse. Resize the band by dragging it from the edge, which updates then the dragged edge value, ***ValueBegin*** or ***ValueEnd***.
When ***Band*** is dragged or resized, the ***ValuesChanged*** event is raised. If an application is subscribing to this event, then event handler could be used append any additional functionality to the chart. To prevent interaction with band the ***AllowUserInteraction*** property should be disabled.

*A couple of bands with line series*
:::info
To see feature demonstration as example, check *Bands*, *Statistic analytics*, *Long data analysis* and *Zoom bar chart* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## BarSeries
***BarSeries*** allows displaying data as horizontal or vertical bars.

*Bars series, vertical and horizontal.*
### BarSeriesValue
Use ***Values*** array property to store the values of a bar series. Add values with ***AddValue(…)*** method. Update an existing value by given value index with ***SetValue(…)*** method. The values are of type ***BarSeriesValue***, which has the following fields:
- ***Value*** The bar length.
- ***Location*** X axis location of the bar (vertical presentation) or Y axis location (horizontal
presentation).
- ***Text*** The text that appears in the bar.
### BaseLevel
***BaseLevel*** property in ***BarSeries*** is the series minimum value for all values and sets bar start position. In [Stacked](#Stacking) view, it will increase (if positive) or decrease (if negative) the size of the bar. If [StackedToSum](#Stacking), the bar size is relative and calculated like *Stacked*.

*BaseLevel set to -10. Bar values are 10, 20, 35, 50, 58, 45, 30, 25, 20, 5.*
### LabelStyle
Use ***LabelStyle*** property of a bar series to control how the bar value label appears on the chart. The label value text is set by parameter of ***AddValue(…)*** or ***SetValue(…)*** method. Various fill styles can be used by setting ***Fill*** property and its sub-properties. ***Angle***, ***Border***, ***Color***, **Font**, ***Offset***, ***VerticalAlign***, ***HorizAlign*** are among other properties control label's style.
### BarViewOptions
Some of more general ***bars*** rendering properties are controlled by ***ViewXY. BarViewOptions***. Use ***BarViewOptions*** property of the chart to control how the bars are displayed: including orientation, stacking, stretching etc.
#### Orientation
***BarViewOptions. Orientation*** properties is to select between *Horizontal* and *Vertical* bar orientation (as in above picture).
#### Grouping
***BarViewOptions. Grouping*** allows grouping the bars by value indices (*ByIndex*), by indices using width fitting (*ByIndexFitWidth*) or by location values (*ByLocation*). It brings values from different ***BarSeries*** visually together. If no grouping is wanted, user should use **Grouping = BarsGrouping.ByLocation** and set different ***Location*** field for every [BarSeriesValue](#BarSeriesValue) object.
:::note
Axis value has meaning only for *BarsGrouping. ByLocation*. Then bars are centered around ***Location*** value. If ***BarViewOptions. Grouping*** set as *ByIndex* or *ByIndexFitWidth*, bars are not bind axis and corresponding axis panning has no effect on bar position.
:::
##### Bar width control for different Grouping
- When ***Grouping*** is set for *ByIndexFitWidth*, ***BarSpacing***, ***IndexGroupingFitGroupDistance*** and ***IndexGroupingFitSideMargins*** properties control distance between bars in the same group, between groups (group is formed for each BarSeries.Values index) and from graph edge in pixels respectively. Therefore, individual bar width will be adjusted to fit all bars in available graph area with predefined spacing.
- In contrast, when ***Grouping*** is set for *ByIndex* or *ByLocation*, the ***BarThickness*** property of the bar series determines the bar width.
#### Stacking
The groups can be stacked by setting ***BarViewOptions. Stacking*** to *Stack* or to *StackStretchToSum*. When using ***StackStretchToSum***, define the target sum by setting ***StackSum*** property. It is 100 by default to represent 100 %.

*Bars series Grouping = ByIndex, Stacking = None.*

*Bars series Grouping = ByIndex, Stacking = Stack.*

*Bars series Grouping = ByIndex, Stacking = StackStretchToSum. StackSum = 100.*
:::info
To see feature demonstration as example, check *BarSimple*, *BarSimpleHorizontal*, *Negative values* and *StackedBars* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
:::tip
If only solid color bars are needed without labels, and especially when bars count is more than 100, the ***LineCollection*** is recommended to be used instead of ***BarSeries***. With ***LineCollection*** simply bars can be drawn and performance and will be better.
:::
---
## BarSeries3D
***BarSeries3D*** allows bar data visualization in 3D.
### Bars grouping
Bar series can be grouped with many options available in ***BarViewOptions*** property of View3D. ***BarViewOptions. ViewGrouping*** controls how the bars are grouped in the 3D view. It has some resemblance how XY [BarSeries](/docs/inDetail/BarSeries.md) does grouping.
#### GroupedIndexedFitWidth
When ***ViewGrouping*** is set for *GroupedIndexedFitWidth*, ***BarSpacing***, ***IndexGroupingFitGroupDistance*** and ***IndexGroupingFitSideMargins*** properties control distance between bars in the same group, between groups (group is formed for each BarSeries3D.Values index) and from 3D world edge in [World coordinates](/docs/inDetail/3D-overview.md) respectively. Therefore, individual bar width (along XAxis) will be adjusted to fit all bars in available 3D world width with predefined spacing.

*BarViewOptions.ViewGrouping = GroupedIndexedFitWidth. Bars are grouped according to their index. Bar
widths and group gaps are arranged to fit the width (along XAxis) nicely.*
#### GroupedIndexed
When ***ViewGrouping*** is set for *GroupedIndexed*, the ***BarWidth*** and ***BarDepth*** properties of the bar series determines the bar width (along XAxis) and depth (along ZAxis) respectively.

*BarViewOptions.ViewGrouping = GroupedIndexed. Original bar widths apply, and groups are arranged to fit the chart width.*
#### GroupedByXValue
When ***ViewGrouping*** is set for *GroupedByXValue*, the ***BarWidth*** and ***BarDepth*** properties of the bar series determines the bar width (along XAxis) and depth (along ZAxis) respectively.

*BarViewOptions.ViewGrouping = GroupedByXValue. Bar X values apply*
#### StackedIndexed

*BarViewOptions.ViewGrouping = StackedIndexed. All bars having same index are stacked.*
#### StackedByXValue

*BarViewOptions.ViewGrouping = StackedByXValue. All bars having same X value are stacked. This example looks same than with StackedIndexed, as the X values and indices are same.*
#### StackedStretchedToSum
All bars having same X value are stacked and stretched to ***BarViewOptions. StackSum*** value/property.

*BarViewOptions.ViewGrouping = StackedStretchedToSum. All bars having same X value are stacked and
stretched to StackSum, in this case 25.*
#### Manhattan
he first series values are shown nearest to the camera and the last series farthest. Bar X values control the bar position in X dimension.

*BarViewOptions.ViewGrouping = Manhattan. The first series values are shown nearest to the camera and
the last series farthest. Bar X values control the bar position in X dimension.*
### Bar styles
***BarSeries3D*** has ***Shape*** property for controlling the bar shape. In addition, with some shapes, ***CornerPercentage*** can be used to change corner rounding and ***DetailLevel*** to change the visual quality.

*Bar shapes: Simple, Cylinder and RoundedCylinder*

*Bar shapes: Cone, ReversedCone and Pyramid.*

*Bar shapes: ReversedPyramid, Ellipsoid and Beveled.*
### Setting bar series data
Bar series data can be added as ***BarSeriesValue3D*** -structures, which contains ***X***, ***Y***, ***Z*** and ***Text*** fields.
```csharp
// create new values array
BarSeriesValue3D[] values = new BarSeriesValue3D[3];
values[0] = new BarSeriesValue3D(20, 45, 5, “”);
values[1] = new BarSeriesValue3D(30, 50, 5, “”);
values[2] = new BarSeriesValue3D(40, 35, 5, “”);
// add values to series
chart.View3D.BarSeries3D[0].AddValues(values, false);
```
### Showing bars horizontally
Bars are drawn in Y axis direction. To show the bars vertically, rotate the camera 90 degrees.

*Vertical bars view on the left, horizontal bars view on the right.*
The code setting up the **vertical bars** view of the previous figure:
```csharp
chart.BeginUpdate();
chart.View3D.Dimensions.Y = 100;
chart.View3D.Dimensions.X = 150;
chart.View3D.YAxisPrimary3D.Location = AxisYLocation3D.FrontLeft;
chart.View3D.Camera.RotationX = 0;
chart.View3D.Camera.RotationY = 0;
chart.View3D.Camera.RotationZ = 0;
chart.View3D.Camera.ViewDistance = 170;
chart.EndUpdate();
```
The code setting up the **horizontal bars** view of the previous figure:
```csharp
chart.BeginUpdate();
chart.View3D.Dimensions.Y = 150;
chart.View3D.Dimensions.X = 100;
chart.View3D.YAxisPrimary3D.Location = AxisYLocation3D.FrontRight;
chart.View3D.Camera.RotationX = 0;
chart.View3D.Camera.RotationY = 0;
chart.View3D.Camera.RotationZ = 90; // <<=== !!!
chart.View3D.Camera.ViewDistance = 170;
chart.EndUpdate();
```
### Examples
:::info
To see feature demonstration as example, check *ExampleBars3D*, *HorizontalBars3D* and *BarsParty3D* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## ChartManager component
***ChartManager*** control can be used to coordinate interoperation of several LightningChart controls. Add ***ChartManager*** control to your form. Then, assign the manager control to ***ChartManager*** property of all LightningChart controls.
### Chart interoperation, drag-drop
***ChartManager*** enables series drag-drop from chart to another in WinForms. For WPF it’s not usable for technical reasons.
Series have ***DisableDragToAnotherAxis*** property which must be set to *False* to enable the dragging. It is *True* by default.
:::tip
Drag and drop series over YAxis in the same chart works in WinForms and WPF and does not require ***ChartManager***.
:::
Axes have ***AllowSeriesDragDrop*** property which can be set to *False* to prevent dragging over specific axis. Default value is *True*.
Move mouse over the series to be dragged, press left mouse button down to start dragging.
Dragging over Y axis: Drag the series over Y axis of another chart and release the button. The other chart takes the ownership of the series and the series is assigned to the target Y axis. This also assigns **the first X axis** for the series.
Dragging over X axis: Drag the series over X axis of another chart and release the button. The other chart takes the ownership of the series and the series is assigned to the target X axis. This also assigns **the first Y axis** for the series.
:::tip
More general solution for drag-and-drop series in the same chart can be implemented with mouse-cursor event handlers (MouseDown, MouseMove, MouseUp etc.). And 'drop' can be made on any place in the chart.
For creating between charts or windows data transfer, user can use .NET class [DragDrop](https://learn.microsoft.com/en-us/dotnet/api/system.windows.dragdrop?view=netframework-4.8).
:::
### Memory management enhancement
In some extreme real-time monitoring applications, the .NET garbage collector does not free unused memory well enough if the application is run with high CPU load. Garbage collector frees all the memory at once, causing a visible ‘freeze’ or ‘pause’ when updating a chart. To make the chart updates smoother, enable ChartManager’s ***MemoryGarbageCollecting*** property. This allows a separate thread to be used to free the memory more often regardless of the CPU load. Using ***MemoryGarbageCollecting*** is recommended to be used with multi-core processors, as the thread running will slightly load the CPU.
---
## ChartTools Class
`ChartTools` provides a versatile collection of static utility methods used across various layout managers and components for math operations, grid manipulations, and cross-platform media helpers.
```csharp
public class ChartTools
```
Example of usage in the code behind:
```csharp
ChartTools.LoadImages(pathToFile);
// or
ChartTools.CalcGradient(toneColor, Color.Black, 65);
```
---
### Public Methods
#### AdjustBitmapAlpha (Desktop Only)
Adjusts bitmap alpha to given level for every pixel. Doesn't modify the input bitmap.
```csharp
public static Bitmap AdjustBitmapAlpha(Bitmap bitmapIn, int alpha);
```
##### Returns
* **Description:** Bitmap with selected alpha.
---
#### AntiAliasBitmap (Desktop Only)
Anti-alias bitmap. Makes anti-aliasing for image, or blur-effect.
```csharp
public static Bitmap AntiAliasBitmap(Bitmap bitmapIn, BitmapAntialiasOptions options);
```
##### Returns
* **Description:** Creates the correct size output bitmap and returns it. If invalid parameters are given, returns null.
---
#### BitmapFrameTo32BGRA (Desktop Only)
Covert BitmapFrame to 32 BGRA.
```csharp
public static BitmapFrame BitmapFrameTo32BGRA(BitmapFrame img);
```
##### Returns
* **Description:** 32BGRA BitmapFrame.
---
#### BitmapSegmentFromBitmap (Desktop Only)
Get a segment (sub-region) of a bitmap.
```csharp
public static Bitmap BitmapSegmentFromBitmap(Bitmap bitmapIn, int firstColumnIndex, int segmentWidth, int firstRowIndex, int segmentHeight);
```
##### Returns
* **Description:** Bitmap segment as a new bitmap.
---
#### CalcGradient
Calculates the gradient color between two colors.
```csharp
public static PublicColor CalcGradient(PublicColor colorFrom, PublicColor colorTo, double position percents);
```
##### Returns
* **Description:** Gradient color.
---
#### CalcPolygonArea
Get polygon area.
```csharp
public static double CalcPolygonArea(PointDouble2D[] points);
```
##### Returns
* **Description:** Area of polygon.
---
#### CalcPolygonCenterOfGravity
Calculate center of gravity (centroid) of a homogenous polygon.
```csharp
public static PointDouble2D CalcPolygonCenterOfGravity(PointDouble2D[] points);
```
##### Returns
* **Description:** Center of gravity point.
---
#### CalculateMapCoordSphericalAngles
Calculate map coordinate spherical angles, phi and theta.
```csharp
public static void CalculateMapCoordSphericalAngles(MapCoordinate coordinate, double sphereRadius,
out double phi, out double theta);
```
##### Returns / out
* **Description:** Phi angle in degrees and Theta angle in degrees.
---
#### CalculateMapDistance
Calculate distance between two coordinates in world map, by using latitude and longitude.
```csharp
public static double CalculateMapDistance(PointFloat coord1, PointFloat coord2);
public static double CalculateMapDistance(MapCoordinate coordinate1, MapCoordinate coordinate2);
```
##### Returns
* **Description:** Distance in kilometers.
---
#### CalculateSphereFullGreatCircleCoords
Calculate great circle coords for sphere.
```csharp
public static MapCoordinate[] CalculateSphereFullGreatCircleCoords(MapCoordinate beginPoint, MapCoordinate endPoint, double angleStep);
```
##### Returns
* **Description:** Array of MapCoordinate.
---
#### CalculateSphericalRoute
Calculate a spherical route (going shortest way, in sphere surface). This is also known as Great Circle route.
```csharp
public static MapCoordinate[] CalculateSphericalRoute(MapCoordinate beginPoint, MapCoordinate endPoint,
double sphereRadius, double angleStep);
```
##### Returns
* **Description:** Route waypoints.
---
#### CaptureControlToBitmap (Desktop Only)
Captures a Control area to a bitmap, very fast. Great for making Chart, Any other Control, or Form capture into set of images.
```csharp
public static Bitmap CaptureControlToBitmap(Control control);
```
##### Returns
* **Description:** Bitmap.
---
#### ColorHSVA
Hue: angle of color circle where 0 deg = red, 120 deg = green, 240 deg = blue.
Saturation: defines the brilliance and intensity of a color. Default = 1, range = 0-1.
Value refers to the lightness or darkness of a color; default = 1, range = 0-1
Alpha describes the transparency; default = 1. range = 0-1.
```csharp
public static PublicColor ColorHSVA(double hue, double saturation = 1, double value = 1, double alpha = 1);
```
---
#### ColorToInt
Media color to integer. / Drawing color to integer.
```csharp
public static int ColorToInt(PublicColor color);
```
##### Returns
* **Description:** Media color as ARGB value. / Drawing color as ARGB value.
---
#### ColorWithAlpha
Create color from known color by given alpha value.
```csharp
public static PublicColor ColorWithAlpha(PublicColor color, byte alpha);
```
---
#### Convert2DArrayTo1D
Convert 2-dimensional array to 1-dimensional, row by row
```csharp
public static T[] Convert2DArrayTo1D(T[,] array) where T : struct;
```
##### Returns
* **Description:** 1D array
---
#### ConvertDataToColorsByFixedIntervalPalette
Convert data values to colors, by given palette. Palette is defined by steps, consisting of value and corresponding color. E.g. 0 : Black, 50: Yellow, 100: Red. The output colors are interpolated based on their position between steps. E.g. in this example palette, data value 60 will be almost yellow, but a little bit blending with red.
```csharp
public static int[] ConvertDataToColorsByFixedIntervalPalette(double[] dataValues, double[] paletteStepValues, PublicColor[] paletteStepColors);
```
##### Returns
* **Description:** Colors as ARGB integer values.
---
#### ConvertDoubleArrayToBitmap / ConvertDoubleArrayToIndexed8Bitmap
Convert double array into colors, by using gradient fixed-interval palette. / Convert double array into Indexed8 bitmap, by using uniform fixed-interval palette. NOTE! Can't use more than 256 colors. If input contains more colors, last ones will be truncated.
```csharp
// Double Array Variant
public static Bitmap ConvertDoubleArrayToBitmap(double[][] array, System.Drawing.Color[] colors, double minValue, double maxValue);
// Indexed8 Variant
public static Bitmap ConvertDoubleArrayToIndexed8Bitmap(double[][] array, System.Drawing.Color[] colors, double minValue, double maxValue);
```
##### Returns
* **Description:** Bitmap.
---
#### ConvertFromString
Convert Hex to Winforms color / Convert Hex to UWP color / Convert Hex to Winforms color
```csharp
public static PublicColor ConvertFromString(string hex);
```
##### Returns
* **Description:** Converted color. If unable to convert a color channel (a, r, g, b), returns 0 to that channel.
---
#### ConvertMapCoordDMSToDegrees
Convert DMS (Degrees, minutes, seconds) value to decimal degrees value, with given post-fix (N,E,S,W). / Convert DMS (Degrees, minutes, seconds) value to decimal degrees value.
```csharp
public static double ConvertMapCoordDMSToDegrees(uint degrees, uint arcMinutes, double arcSeconds, CoordPostfix postfix);
public static double ConvertMapCoordDMSToDegrees(int degrees, uint arcMinutes, double arcSeconds);
```
##### Returns
* **Description:** Degrees value.
---
#### ConvertMapCoordTo3DPointOnSphere
Convert map coordinate to a point in 3D space. The 3D space has origin in (0,0,0).
```csharp
public static PointDouble3D ConvertMapCoordTo3DPointOnSphere(MapCoordinate mapCoordinate, double sphereRadius);
```
##### Returns
* **Description:** 3D point.
---
#### ConvertTicksToSeconds
Converts time ticks to seconds, accurately.
```csharp
public static double ConvertTicksToSeconds(long ticks);
```
##### Returns
* **Description:** Seconds value.
---
#### ConvertImageToFormat32bppArgb (Desktop Only)
Converts image format to 32 bits ARGB.
```csharp
public static Image ConvertImageToFormat32bppArgb(Image sourceImage);
```
##### Returns
* **Description:** Image in 32bbArgb format.
---
#### CreateGrayscaleAlphaMap (Desktop Only)
Create a grayscale bitmap of source bitmap's pixels' alpha level. White output pixel means A = 255, Black means A = 0, and grayscales values between them.
```csharp
public static Bitmap CreateGrayscaleAlphaMap(Bitmap bitmapIn);
```
##### Returns
* **Description:** Bitmap having alpha RGB values as grayscale, and alpha 255 in each output pixel.
---
#### CreateMap
Load all images from the folder and return them as texture map. / Create texture map packed for VolumeRendering.
**WPF**
```csharp
public static BitmapFrame CreateMap(string filePath);
public static BitmapFrame CreateMap(BitmapFrame[] imgs);
public static BitmapFrame CreateMap(double[][][] data, System.Windows.Media.Color[] colors, double minValue, double maxValue);
```
**WinForms**
```csharp
public static Bitmap CreateMap(string filePath);
public static Bitmap CreateMap(Bitmap[] imgs);
```
**UWP**
```csharp
public static WriteableBitmap CreateMap(WriteableBitmap[] imgs);
```
##### Returns
* **Description:** Texture Map. / WriteableBitmap / Bitmap frame.
---
#### ExtractValues
Create a jagged array of Intensity series data (IntensityPoint array). Extracts IntensityPoint.Value fields.
```csharp
public static double[][] ExtractValues(IntensityPoint[,] data);
```
##### Returns
* **Description:** Values array.
---
#### GatherApplicationInformation
Gathers various information for debugging purposes as a string and optionally saves the output to a text file. Gathered data (if GatherDataOptions is set to All): system information, LightningChart object information, list of running processes, DxDiag output, installed Windows hotfixes.
```csharp
[SecurityCritical]
public static string GatherApplicationInformation(GatherDataOptions options, LightningChart chart = null, string path = null, string fileName = null);
```
##### Returns
* **Description:** The gathered data as a string.
---
#### GetAllControls (Desktop Only)
Get all controls and its subcontrols
```csharp
public static List GetAllControls(Control control, bool getSubControls);
```
##### Returns
* **Description:** List of controls
---
#### GetPixelColors (Desktop Only)
Get pixel color of a bitmap. This is much faster method than calling GetPixel() separately for each pixel of a bitmap.
```csharp
public static System.Drawing.Color[,] GetPixelColors(Bitmap bitmapIn);
```
##### Returns
* **Description:** Pixel colors as an array.
---
#### GetPixelWpfColors (WPF Only)
Gets pixels of System.Drawing.Bitmap object in System.Windows.Media.Color two-dimensional array.
```csharp
public static System.Windows.Media.Color[][] GetPixelWpfColors(Bitmap bitmapIn);
```
##### Returns
* **Description:** Two-dimensional System.Windows.Media.Color array.
---
#### Grib2WindCsvConverter -> ConvertToCsv
Converts GRIB2 10-metre wind fields to x,y,U,V CSV without native dependencies. Supports product template 4.0, regular latitude/longitude template 3.0, and complex packing with spatial differencing (template 5.3). Bitmaps, embedded missing values and other templates are deliberately rejected. Format references: https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/
```csharp
public static int ConvertToCsv(string gribPath, string csvPath, int longitudeCount = 0, int latitudeCount = 0);
```
##### Parameters
| Parameter | Type | Required | Description |
| :--- | :--- | :---: | :--- |
| `gribPath` | `string` | **Yes** | Path to the GRIB input file. |
| `csvPath` | `string` | **Yes** | Path to the target CSV file. |
| `longitudeCount` | `int` | No | Sample counts (e.g. 100). A zero count retains all points. |
| `latitudeCount` | `int` | No | Sample counts (e.g. 50). A zero count retains all points. |
##### Returns
* **Type:** `int`
* **Description:** Returns the number of written vectors.
---
#### ImageFromAppContent (UWP Only)
Read image file from application content. Will throw exception, if anything fails.
```csharp
public async static Task ImageFromAppContent(string path);
```
##### Returns
* **Description:** WriteableBitmap
---
#### ImageFromResource / ImageFromResourceFullName (Desktop Only)
Create image from assembly embedded resource. Includes assembly name in the beginning of resource name. / Create image from assembly embedded resource
```csharp
public static Image ImageFromResource(string resourceName, Assembly resourceAssembly);
public static Image ImageFromResourceFullName(string fullyQualifiedName, Assembly resourceAssembly);
```
##### Returns
* **Description:** Image if success, else null / Image if success, otherwise null.
---
#### IntensityValuesToIntensityGridPoints
Convert intensity values jagged array to intensity grid points. Fills IntensityPoint.Value fields only.
```csharp
public static IntensityPoint[,] IntensityValuesToIntensityGridPoints(double[][] values);
```
##### Returns
* **Description:** Rectangular array of intensity points.
---
#### InterpolateBilinear
Makes bilinear interpolation for given data array.
```csharp
public static double[][] InterpolateBilinear(double[][] sourceArray, int factorX, int factorY);
```
##### Returns
* **Description:** Interpolated data array.
---
#### Is64BitProcess
Find out if this process needs 64-bit DLLs.
```csharp
public static bool Is64BitProcess();
```
##### Returns
* **Description:** True if 64-bit DLLs are needed. False if it's happy with 32-bit DLLs.
---
#### LoadImages
Load images from folder and return them as array of Bitmap / WriteableBitmaps. Will throw exception, if anything fails.
**WinForms / WPF default**
```csharp
public static Bitmap[] LoadImages(string folderName);
```
**UWP**
```csharp
public async static Task LoadImages(string folderName);
```
##### Returns
* **Description:** Array of WriteableBitmap objects in the given folder. / Array of images from folder.
---
#### MediaColorToDrawingColor
(System.Windows.)Media color to (System.)Drawing color.
```csharp
public static System.Drawing.Color MediaColorToDrawingColor(System.Windows.Media.Color color);
```
##### Returns
* **Description:** Media color as Drawing color.
---
#### Rotate3DCoordinate
Rotate 3D coordinate with yaw - pitch - roll method.
```csharp
public static PointDouble3D Rotate3DCoordinate(PointDouble3D point, double angleAboutXAxis, double angleAboutYAxis, double angleAboutZAxis);
```
##### Returns
* **Description:** Rotated coordinate.
---
#### RoundToNearestInterval
Rounds the value to nearest multiple of Interval.
```csharp
public static double RoundToNearestInterval(double value, double interval);
```
##### Returns
* **Description:** Nearest interval multiple.
---
#### SamePoint
Test if two point equals.
```csharp
public static bool SamePoint(PointFloat p1, PointFloat p2);
```
##### Returns
* **Description:** True is points are at about same locations.
---
#### ShowLoadedAssemblies (Desktop Only)
Show list of loaded assemblies by this application in MessageBox.
```csharp
public static void ShowLoadedAssemblies();
```
---
#### SolvePointBetweenPoints
Solve point within a line going from Point1 to Point2.
```csharp
public static bool SolvePointBetweenPoints(PointFloat point1, PointFloat point2, float distanceFromP1, out PointFloat result);
public static PointFloatXYZ SolvePointBetweenPoints(PointFloatXYZ point1, PointFloatXYZ point2, float fPointPositionFromP1);
```
##### Returns
* **Description:** Returns true if successfully solved (length is not 0). / Point in position.
---
#### WriteLog (Desktop Only)
Write a string to log file. If second parameter is not given, then log file is c:\temp\LightningChartLog.txt.
```csharp
public static void WriteLog(string entry);
public static void WriteLog(string entry, string fileName);
```
---
#### ZoomToDataAndLabelsArea
Zoom to data and label area.
```csharp
public static void ZoomToDataAndLabelsArea(LightningChart chart);
```
---
## ClipAreas
Like [DataBreaking](/docs/inDetail/data-breaking.md), ***ClipAreas*** can be used to prevent part of the series data from rendering. They can be used to filter out bad data ranges, out-of-range data by Y value, etc.
ViewXY's series have ***SetClipAreas*** method for setting or updating the clipping areas. It accepts an array of ***ClipArea*** structures. The ***ClipAreas*** array can be changed frequently, and performance stays good up to thousands of ***ClipAreas***.
The ***ClipArea*** applies for the series that it has been assigned to. Note that this is a rendering-stage clipping and mouse operations will respond to series when placed over the ***ClipArea*** if there's actual data under it.

*ClipAreas defined for 3 series. For PointLineSeries, AreaSeries, and IntensityGridSeries. On the left, the ClipAreas are not used. On the right, ClipAreas are enabled. For yellow PointLineSeries, X dimensional clipping areas have been defined to mask off low-amplitude data. For red AreaSeries, Y-dimensional ClipArea cuts too high-amplitude data from the top. For IntensityGridSeries, X- and Y-dimensional ClipAreas are used to prevent the series from rendering in specific areas.*
:::info
To see feature demonstration as example, check *Clip areas* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Color themes
The overall color theme of a chart can be set with ***ColorTheme*** property. Setting the theme will override majority of the object colors in the created chart. Therefore, every manually assigned color will be lost in the Visual Studio property grid without a warning. It is advised to first set the ***ColorTheme*** and then modify the individual object colors.
```csharp
chart.ColorTheme = ColorTheme.SkyBlue; // Changing the color theme
```

*Two color themes. On the left, default Dark theme with some custom colors. On the right, Aurora theme.*
### Custom themes
LightningChart allows creating custom color themes by updating ***CustomDynamicTheme*** -property. There are two ways to do this. Either get the custom theme to a variable and update that, or set ***ColorTheme*** to *CustomDynamicTheme* option and update its properties.
```csharp
// Method 1
ThemeBasics theme = _chart.CustomDynamicTheme;
theme.BackgroundColor = Colors.Black;
theme.ChartTitleColor = Colors.Green;
_chart.CustomDynamicTheme = theme;
_chart.UpdateCustomTheme();
// Method 2
_chart.ColorTheme = ColorTheme.CustomDynamicTheme;
_chart.CustomDynamicTheme.ChartTitleColor = Colors.Green;
_chart.UpdateCustomTheme();
```
Some themes use automatic coloring for axes and series. To manually set axis or series colors, disable ***MultiColorAxis*** or ***MultiColorSeries*** respectively, then set the colors.
```csharp
ThemeBasics theme = _chart.CustomDynamicTheme;
theme.MultiColorAxis = false;
theme.AxisColor = Colors.Blue;
_chart.CustomDynamicTheme = theme;
```
### Examples
:::info
[Interactive Examples demo](/docs/getting%20started/RunningDemo.md) application has ThemeCreator example, which allows investigating the color themes and creating new ones.
:::
---
## Line-series comparison
## Which line series should be used?
LightningChart® .NET component offer wide range 2D ([ViewXY](/docs/beginners%20guide/ViewXY-series/xy_chart.md)) charts. For each type of data one or more Series can be used. In particular, line-series type of chart/plot has very broad selection of Series. This article is to explain why particular line-series type should be used, what are tradeoff and what are the assumption of each line-series.
From LightningChart version 10.3.1 the list (of line-series) expanded to 10 series: ***AreaSeries***, ***DigitalLineSeries***, ***FreeformPointLineSeries***, ***HighLowSeries***, ***LiteFreeformLineSeries***, ***LiteLineSeries***, ***PointLineSeries***, ***SampleDataBlockSeries***, ***SampleDataSeries***, ***LineCollection***.
### Summary table
Features | [SampleDataBlockSeries](/docs/inDetail/SampleDataBlockSeries.md) | [SampleDataSeries](/docs/inDetail/SampleDataSeries.md) | [LiteLineSeries](/docs/inDetail/LiteLineSeries.md) | [PointLineSeries](/docs/inDetail/PointLineSeries.md) | [LiteFreeformLineSeries](/docs/inDetail/LiteFreeformLineSeries.md) | [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md) | [AreaSeries](/docs/inDetail/AreaSeries.md) | [HighLowSeries](/docs/inDetail/HighLowSeries.md) | [DigitalLineSeries](/docs/inDetail/DigitalLineSeries.md) | [LineCollection](/docs/inDetail/LineCollection.md)
[Progressive increase of X-values](#Progressive-increase-of-X-values) | ✓ | ✓ | ✓ | ✓ | | | ✓ | ✓ | ✓ |
[Fixed interval](#Progressive-increase-of-X-values) | ✓ | ✓ | | | | | | | |
[Optimize memory and GC usage](#Optimized-memory-and-GC-usage) | ✓ | | ✓ | | ✓ | | | | ✓ |
[Line Visible](#Points-Visible-feature) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓
[Points Visible](#Points-Visible-feature) | | ✓ | | ✓ | | ✓ | ✓ | ✓ | |
[Coloring points individually](#Coloring-points-individually) | | | | ✓ | | ✓ | ✓ | ✓ | |
[Y precision is double](#Y-value-precision) | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓
[Y precision is float](#Y-value-precision) | ✓ | ✓ | | | | | | | |
[Y-value based coloring of line/area](#Y-value-based-coloring-of-line-or-fill) | | ✓ | | ✓ | | ✓ | ✓ | ✓ | |
[Custom shaping and coloring](#CustomLinePointColoringAndShaping-event) | | ✓ | | ✓ | | ✓ | | | |
[XAxis ScaleBreaks](#XAxis-ScaleBreaks) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓
[DataBreaking by NaN or other value](#DataBreaking-by-NaN-or-other-value) | | ✓ | | ✓ | | ✓ | ✓ | ✓ | |
[ClipAreas](#ClipAreas) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓
[Tracking value with LineSeriesCursor](#Tracking-Y-value-with-LineSeriesCursors) | ✓ | ✓ | ✓ | ✓ | | | ✓ | ✓ | ✓ |
[Tracking with DataCursor](#Tracking-with-DataCursor) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓
[Polynomial regression](#Polynomial-regression) | | | | ✓ | | | | | |
[LimitYToStackSegment](#Limit-Y-value-To-Stack-Segment) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓
[Line Pattern](#Line-Style-pattern) | | ✓ | | ✓ | | ✓ | ✓ | ✓ | | ✓
[Series TitlesAutoPlacement](#Automatic-Series-title-placement) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓
[Rendering data into the Persistent-Rendering-Layer](#Rendering-data-into-the-Persistent-Rendering-Layer) | | ✓ | | ✓ | | ✓ | ✓ | ✓ | |
ErrorBars | | | | ✓ | | ✓ | | | |
Support Logarithmic axes | | ✓ | | ✓ | | ✓ | ✓ | ✓ | | ✓
Features | [SampleDataBlockSeries](/docs/inDetail/SampleDataBlockSeries.md) | [SampleDataSeries](/docs/inDetail/SampleDataSeries.md) | [LiteLineSeries](/docs/inDetail/LiteLineSeries.md) | [PointLineSeries](/docs/inDetail/PointLineSeries.md) | [LiteFreeformLineSeries](/docs/inDetail/LiteFreeformLineSeries.md) | [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md) | [AreaSeries](/docs/inDetail/AreaSeries.md) | [HighLowSeries](/docs/inDetail/HighLowSeries.md) | [DigitalLineSeries](/docs/inDetail/DigitalLineSeries.md) | [LineCollection](/docs/inDetail/LineCollection.md)
### Progressive increase of X-values
Or assumption about order of X-value in data array. One of primary criteria for selection of optimal line-series is the order of X-values in data array. If X-values in progressively increasing order at fixed interval, then [SampleDataBlockSeries](/docs/inDetail/SampleDataBlockSeries.md), [SampleDataSeries](/docs/inDetail/SampleDataSeries.md) should be used. This is generally used in real-time Digital signal processing (DSP) applications. The digital signal would be represented as sequence of numbers that samples a continues variable in time or space. Both series types are made for fixed-interval data monitoring, used typically in waveform visualization, e.g., medical monitoring (ECG/EKG, EEG, EMG, ExG), vibration monitoring, telemetric and data logger systems, and the audio engineering industry. Use the series ***SamplingFrequency*** property (1 / sample interval) to set the fixed sample interval. To set the X value (time stamp) where the samples begin, set ***FirstSampleTimeStamp*** property.
When assumption of fixed interval progressive X-Value order is met, user should use ***SampleDataBlockSeries*** or ***SampleDataSeries***, because those are the fastest series and use less memory. However, if data is progressive but not at fixed interval (**Points[i+1].X ≥ Points[i].X**), then user should choose second best (performing series) - [LiteLineSeries](/docs/inDetail/LiteLineSeries.md) or [PointLineSeries](/docs/inDetail/PointLineSeries.md). Other series, which require at least progressive X-Value order are ***AreaSeries***, ***HighLowSeries*** and [DigitalLineSeries](/docs/inDetail//DigitalLineSeries.md).
Only series which does not have assumption about point order are [LiteFreeformLineSeries](/docs/inDetail/LiteFreeformLineSeries.md), [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md) and ***LineCollection***. Those Series allow drawing line point to any direction from previous point. However, those series will have reduced performance as compared to other line series (with more strict assumptions).

*Only 3 series don’t have progressive x-value requirement/assumption (arrow).*
### Optimized memory and GC usage
In general, LightningChart performance is excellent for all series. Especially if point count is low (e.g. less than 1000 points). If user is building very demanding real-time application with millions/billions points to visualize, this feature (optimized memory and .NET garbage collector (GC) usage) becomes critical. More and more data are generated every day, and hence more points should be handled by user application. This puts a lot of pressure on memory and GC. To address this issue (i.e., lower the pressure) we added several new series relatively recently. [SampleDataBlockSeries](/docs/inDetail/SampleDataBlockSeries.md) was added in library version 10.1, [LiteLineSeries](/docs/inDetail/LiteLineSeries.md), [LiteFreeformLineSeries](/docs/inDetail//LiteFreeformLineSeries.md) and [DigitalLineSeries](/docs/inDetail/DigitalLineSeries.md) was added in 10.3. The first three is counterpart to older series: ***SampleDataSeries***, ***PointLineSeries***, ***FreeformPointLineSeries***. New series could handle (chart could render) at least 10 times more points with same RAM usage and smoothness of sweeping/scrolling of X-axis. The tradeoff for greatly improved performance (especially for more than million points) is reduced number of features supported by new series (see table above).
### Points Visible feature
While line connecting two data points could be drawn for all line-series types (controlled by ***LineVisible*** or ***Visible*** properties), only half of series could draw symbol/point. Series which could draw symbol/point (controlled by ***PointsVisible*** property) are ***SampleDataSeries***, ***PointLineSeries***, **FreeformPointLineSeries**, ***AreaSeries*** and ***HighLowSeries***. Alter the point style by setting [PointStyle](/docs/inDetail/points-style.md) (or ***PointStyleHigh*** or ***PointStyleLow***) properties. Select the shape from many pre-defined styles from ***PointStyle.Shape***. One of the shape styles is *Bitmap*, which allows drawing any bitmap image in the point location.
### Coloring points individually
Starting from v.7.2, the ***PointLineSeries***, ***FreeformPointLineSeries***, ***AreaSeries*** and ***HighLowSeries*** have *PointColor* field in the data point structures. To enable individual point coloring, set ***IndividualPointColoring*** to *Color1*, *Color2*, *Color3* or *BorderColor* setting. To disable individual point coloring, set ***IndividualPointColoring*** = *Off*. The color options settings correspond to that color-properties in [PointStyle](/docs/inDetail/points-style.md) property tree.

*Only PointLineSeries, FreeformPointLineSeries, AreaSeries and HighLowSeries could have point-symbol. And those points could have individually color. SampleDataSeries could show points, but they all same style.*
### Y-value precision
Only [SampleDataBlockSeries](/docs/inDetail/SampleDataBlockSeries.md), [SampleDataSeries](/docs/inDetail/SampleDataSeries.md) support single precision sample Y values. While for ***SampleDataBlockSeries*** it is only option, the ***SampleDataSeries*** supports single and double precision. Using single precision values is recommended when keeping the memory reserving as low as possible. Select the sample format with ***SampleFormat*** property. Note, that ***SampleDataSeries*** has 2 separate properties/array to keep different precision data (***SamplesSingle*** and ***SamplesDouble*** respectively).
### Y-value based coloring of line or fill
By enabling ***UsePalette*** property of ***SampleDataSeries***, ***PointLineSeries***, ***FreeformPointLineSeries***, ***AreaSeries*** or ***HighLowSeries*** the coloring of line (or ***Fill*** for the last two) is applied by the ***ValueRangePalette*** property. ***ValueRangePalette*** contains Y value and color pairs. ***ValueRangePalette.Type*** sets the *Gradient* or *Uniform* steps palette (see Y-value based coloring of [Line](/docs/inDetail/advanced-line-coloring.md) and [Fill](/docs/inDetail/HighLowSeries.md)).

*Only SampleDataSeries, PointLineSeries, FreeformPointLineSeries, AreaSeries or HighLowSeries could be colorized with ***ValueRangePalette*** (Y-value based color)*
### CustomLinePointColoringAndShaping event
Custom coloring and coordinate adjustment can be made with ***CustomLinePointColoringAndShaping*** event, which is called just before entering the rendering stage of the chart. Customized coloring and coordinate adjustment could be done only for ***SampleDataSeries***, ***PointLineSeries*** and ***FreeformPointLineSeries*** (see [Custom shaping and coloring](/docs/inDetail/advanced-line-coloring.md)).

*Only SampleDataSeries, PointLineSeries or FreeformPointLineSeries could have ***CustomLinePointColoringAndShaping*** event handler, where be color and color could be modified before final rendering.*
### XAxis ScaleBreaks
***ScaleBreaks*** allow excluding specific X ranges. For example, inactive trading hours/dates or machinery off-production hours. All the series, that have been assigned to the specified X axis, are clipped, including axis and labels themselves.
There are limitations of when ***ScaleBreaks*** can be used: ***ScrollMode*** must be set to *‘None’* and ***ScaleType*** to *‘Linear’*. Specify the range of the break with ***Begin*** and ***End***. They are given as axis values, not *DateTimes*. Use ***axis. DateTimeToAxisValue*** method to convert them if using *DateTimes*. Gap style could be configured. ***PointLineSeries***, ***AreaSeries*** and ***HighLowSeries*** have ***ContinuousOverScaleBreak*** property. By enabling it, a connecting line will be rendered over the gap. (for more information see [X Axis specific properties](/docs/inDetail/axis-class-properties.md)).

***ScaleBreaks** allow excluding specific X ranges (here 5-10). All the series, that have been assigned to the specified X axis, are clipped, including axis and labels themselves.*
### DataBreaking by NaN or other value
LightningChart skips rendering of the data points that match with specified breaking Value. All other values it renders normally. Only ***PointLineSeriesBase*** class series support data breaking: ***SampleDataSeries***, ***PointLineSeries***, ***FreeformPointLineSeries***, ***AreaSeries*** or ***HighLowSeries***. Feature is enabled by enabling ***Series. DataBreaking. Enabled*** property and setting desired value (***Series. DataBreaking. Value*** default NaN) (see [DataBreaking by NaN or other value](/docs/inDetail/data-breaking.md)).
:::note
When **DataBreaking.Enabled** = True, it will cause significant extra overhead, and is not recommended for solutions needing a very high real-time data rates. Consider using [ClipAreas](/docs/inDetail/ClipAreas.md) instead.
:::

***DataBreaking** by NaN or other value. SampleDataSeries, PointLineSeries, FreeformPointLineSeries, AreaSeries or HighLowSeries may have specific value (X or Y), which indicated that line rendering should be broken (point/segment ignored).*
### ClipAreas
Like [DataBreaking](/docs/inDetail/data-breaking.md), [ClipAreas](/docs/inDetail/ClipAreas.md) can be used to prevent part of the series data from rendering. They can be used to filter out bad data ranges, out-of-range data by Y value, etc. The ***ClipArea*** applies for the series (applicable for all XY series) that it has been assigned to. Note that this is a rendering-stage clipping and mouse operations will respond to series when placed over the ***ClipArea*** if there's actual data under it. Using ***ClipAreas*** is the performance-wise preferred way to break a line to several data segments instead of using ***DataBreaking*** feature. (see [ClipAreas](/docs/inDetail/ClipAreas.md)).

***ClipAreas** can be used to prevent part of the series data from rendering. Here ‘clip band’ between XAxis {3,5} and between YAxis {-2,2}. Clipping is applied for all series.*
### Tracking Y-value with LineSeriesCursors
Line series cursors allow tracking of many line-series at once by tracking the Y-values at X coordinate. Series values can only be resolved with series implementing *ITrackable* interface (***SampleDataSeries***, ***SampleDataBlockSeries***, ***PointLineSeries***, ***LiteLineSeries***, ***DigitalLineSeries***, ***AreaSeries***, ***HighLowSeries***).
[LineSeriesCursors](/docs/inDetail/LineSeriesCursor.md), can snap-to-points or show interpolated value (***SnapToPoints*** property). In addition, it has several styles: ***PointTracking*** (configurable shape and size of tracking point), *HairCrossTracking* (thick and thin-hair, coloring mixing etc.) and *VerticalNoTracking* (no tracking point or line just vertical line). (see [LineSeriesCursors](/docs/inDetail/LineSeriesCursor.md)).

***LineSeriesCursor** tracks the Y-values at X coordinate for all ‘progressive’ line-series (all but LiteFreeformLineSeries, FreeformPointLineSeries and LineCollection). Here is HairCrossTracking style is shown, although various style markers could be used instead.*
### Tracking with DataCursor
Starting from v10.4 new type of ***DataCursor*** is added. [DataCursor](/docs/inDetail/data-cursors.md) tracks all XY series, including line-series discussed here. It finds closest data point to mouse-cursor and show it X-Y values, series title and other relevant information in ‘Result table’. ‘Hair Cross’ lines (vertical and horizontal) could be shown. ‘Labels’ with point’s x/y value are shown on the axis Series is assigned to. The style and visibility of each ***DataCursor*** item (‘Tracking Point’, ‘Result table’, ‘Hair Cross’, ‘Labels’) could be configured. ‘Result table’ header and ‘Labels’ box fill’s color is defined by line-series color, bar-series color or heatmap pixel color. ‘Result table’ text color is defined by series title color. (see [DataCursor](/docs/inDetail/data-cursors.md)).

*Data points of all series could be tracked with ***DataCursor***. Series title, point color and values of closest point to mouse-cursor is shown.*
### Polynomial regression
Only [PointLineSeries](/docs/inDetail/PointLineSeries.md) has properties/feature to do [regression fitting](/docs/inDetail/polynomial-regression.md) for data points. Regression fitting, utilizing ***RegressionFitting*** and ***RegressionPolyOrder*** properties of ***PointLineSeries***. When ***RegressionFitting*** is set other than *None* option, line and points replaced with fitted curve.
For other series it is possible to use ***MathRoutines.PolynomialRegression()*** method and replace data with fitted points.
### Limit Y-value To Stack Segment
Each XY series has boolean ***LimitYToStackSegment*** property. This limits Y draw range to segment area when y-axes are stacked. For most of XY series, if property is enabled simple clipping of data is done. However, newer series (***SampleDataBlockSeries***, ***LiteLineSeries*** and ***LiteFreeformLineSeries***) has additional options. There ***LimitYToSegment*** is enumerated type: *None*, *Clip* (line will be clipped as for old series) and *ClampToSegment* (if line exceeds segment’s edge, it will be rendered horizontally on y-axis edge). Note, ***LiteFreeformLineSeries*** *ClampToSegment* line will be rendered along the edge as far as the real point x-value would be, therefore, may be longer than other series clamping line. (see [LimitYToStackSegment](/docs/inDetail/limit-y-value.md)).

*When series has Boolean ***LimitYToStackSegment*** property is enabled, y-value is clipped at minimum and maximum. Applicable for all XY series.*
### Automatic Series title placement
Each XY series has title (by default hidden), for which style and position could be modified through properties. User could enable ***ViewXY. TitlesAutoPlacement. Enabled***, which inform chart that Series’ Title location should be calculated in order to avoid multiple titles overlap. Title position could be locked (at current X-Y value) by enabling ***series. Title. LockAutoPosition*** property. Auto positioning is reset with ***ViewXY. TitlesAutoPlacement. Reset()*** method.
### Line Style (pattern)
All (10) line-series could render line (between 2 or more points). However, line styling is very limited for [SampleDataBlockSeries](/docs/inDetail/SampleDataBlockSeries.md), [LiteLineSeries](/docs/inDetail/LiteLineSeries.md), [LiteFreeformLineSeries](/docs/inDetail/LiteFreeformLineSeries.md) and [DigitalLineSeries](/docs/inDetail/DigitalLineSeries.md), as those series has only ***Color*** and ***Width*** properties, while pattern can only be *Solid*.
In contrast, other series support [LineStyle](/docs/inDetail/line-style.md) fully. Those are ***SampleDataSeries***, ***PointLineSeries***, ***FreeformPointLineSeries***, ***AreaSeries***, ***HighLowSeries*** and ***LineCollection***.
### Rendering data into the Persistent-Rendering-Layer
Either [PersistentSeriesRenderingLayer](/docs/inDetail/persistent-layer.md) or [PersistentSeriesRenderingIntensityLayer](/docs/inDetail/persistent-intensity-layer.md) can be created.
Persistent-Rendering-Layer can be used for extremely fast rendering of repetitive line/points data, or line/points/high-low/area fill data, which is plotted in same X and Y range over and over again.
Render the data into the (bitmap kind of) layer by using any of [PointLineSeries](/docs/inDetail/PointLineSeries.md), [SampleDataSeries](/docs/inDetail/SampleDataSeries.md), [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md), [HighLowSeries](/docs/inDetail/HighLowSeries.md) or [AreaSeries](/docs/inDetail/AreaSeries.md) objects (all belong to ***PointLineSeriesBase*** class).
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Constant lines
Like [bands](/docs/inDetail/bands.md), ***ConstantLine*** can be considered as a series. ***ConstantLine*** is bound to Y axis, and it represents one horizontal line, ranging from graph left edge to right edge. Set the level via ***Value*** property. Constant lines can be vertically moved by dragging with mouse. By setting ***Behind*** property true, the constant line is drawn behind line and bar series, otherwise it is drawn in front of them.
When ***ConstantLine*** is dragged/moved the ***ValueChanged*** event is raised. If an application is subscribing to this event, then event handler could be used append any additional functionality to the chart. To prevent interaction with band the ***AllowUserInteraction*** property should be disabled.

*Some constant lines around a sine line series.*
:::info
To see feature demonstration as example, check *Oscilloscope*, *Lissajous monitor*, *Signal reader* and *ExampleTradingMultiSegment* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Coordinate system converters
The following coordinate system converters are available in ***CoordinateConverters*** namespace, which complements View3D usage.
- Cartesian 3D ⇔ Spherical 3D
- Cartesian 3D ⇔ Cylindrical 3D
### SphericalCartesian3D
***SphericalCartesian3D*** converter class converts between spherical and 3D cartesian coordinates.

*Example created with SphericalCartesian3D converter. Data points of SurfaceMeshSeries3D and the grid are defined in spherical coordinates. Annotation tracks the nearest data point and displays its value in spherical coordinates.*
Spherical data points are defined by ***SphericalPoint*** objects which contain the following fields:
- ***Distance***: Distance from origin (0,0,0)
- ***ElevationAngle***: Elevation angle. Also called as Elevation or Altitude, measured from XZ plane. ElevationAngle is 90 degrees - Inclination angle.
- ***HeadingAngle***: Heading angle. Also called as azimuth and absolute bearing
For elevation, the XZ plane is the reference plane. (e.g. equatorial plane). Elevation is an angle measured from that plane.
:::note
This converter class expects the View3D.Dimensions to be equal (cubic), otherwise the conversion result may have to be scaled by user-side code.
:::
View3D’s series typically take the data input as X, Y, Z values. These values can be found e.g. in ***SeriesPoint3D***, ***SurfacePoint3D*** and ***PointDouble3D*** objects.
#### Converting from spherical to cartesian
To convert a ***SphericalPoint*** to cartesian coordinate, use ***SphericalCartesian3D. ToCartesian()*** method. It accepts data input as
- SphericalPoint point
- SphericalPoint[] array
- SphericalPoint[,] matrix
Alternatively, convert by using ***ToCartesian()*** extension method for spherical points.
```csharp
// Create spherical points matrix
SphericalPoint[,] sphericalData = CreateSurfaceData();
// Convert matrix to cartesian matrix
SurfacePoint[,] xyzData = sphericalData.ToCartesian();
```
#### Converting from cartesian to spherical
To convert a cartesian point to spherical point, use ***SphericalCartesian3D. ToSpherical()*** method. It accepts data input as ***PointDouble3D*** point with X, Y and Z fields.
Alternatively, convert a point by using ***ToSpherical()*** extension method.
```csharp
// Define cartesian point
PointDouble3D point = new PointDouble3D(50, 20, 40);
// Convert to spherical point
SphericalPoint sp = point.ToSpherical();
```
### CylindricalCartesian3D
Converter class to convert between cylindrical and 3D cartesian coordinates.

*Example created with CylindricalCartesian3D converter. Data points of SurfaceMeshSeries3D and the grid are defined in cylindrical coordinates. Annotation tracks the nearest data point of a PointLineSeries3d and displays its value in cylindrical coordinates.*
Cylindrical points are defined by ***CylindricalPoint*** objects, which contain the following fields:
- ***Distance***: Distance along XZ plane
- ***Y***: Y value
- ***Angle***: Heading angle, also called as azimuth and absolute bearing
:::note
This converter class expects View3D.Dimensions.X and View3D.Dimensions.Z to be equal, otherwise the conversion result regarding Angle and Distance (or X and Z) may have to be scaled by user-side code.
:::
View3D’s series typically take the data input as X, Y, Z values. These values can be found e.g. in ***SeriesPoint3D***, ***SurfacePoint3D*** and ***PointDouble3D*** objects.
#### Converting from cylindrical to cartesian
To convert a ***CylindricalPoint*** to cartesian coordinate, use ***CylindricalCartesian3D. ToCartesian()*** method. It accepts data input as
- CylindricalPoint point
- CylindricalPoint[] array
- CylindricalPoint[,] matrix
Alternatively, convert by using ***ToCartesian()*** extension method for cylindrical points.
```csharp
// Create cylindrical points matrix
CylindricalPoint[,] cylindricalData = CreateData();
// Convert matrix to cartesian matrix
SurfacePoint[,] xyzData = cylindricalData.ToCartesian();
```
#### Converting from cartesian to cylindrical
To convert a cartesian point to cylindrical point, use ***CylindricalCartesian3D. ToCylindrical()*** method. It accepts data input as ***PointDouble3D*** point with X, Y and Z fields.
Alternatively, a point can be converted by using ***ToCylindrical()*** extension method.
```csharp
// Define cartesian point
PointDouble3D point = new PointDouble3D(50, 20, 40);
// Convert to cylindrical point
CylindricalPoint sp = point.ToCylindrical();
```
### Examples
:::info
To see feature demonstration as example, check *SphericalSurface* and *ExampleCylindrical* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Creating UWP project
[Universal Windows Platform (UWP)](https://learn.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide) is a computing platform created by Microsoft and introduced in Windows 10. UWP is one of many ways to create client applications for Windows, which run on Windows 10 and Windows 11 devices. Application will run on any Windows device no matter whether you are targeting a desktop PC, Xbox, Mixed-reality headset, and so on.
App packages are configured to run on a [specific processor architecture](https://learn.microsoft.com/en-us/windows/msix/package/device-architecture). By selecting an architecture, you are specifying which device(s) you want your app to run on. UWP apps can be configured to run on the following architectures:
- x86
- x64
- ARM
- ARM64
It is highly recommended that you build your app package to target all architectures. By deselecting a device architecture, you are limiting the number of devices your app can run on, which in turn will limit the amount of people who can use your app!
### LightningChart for UWP
Using [LightningChart in UWP](/docs/beginners%20guide/ChartEditionsV11.md) works similarly to bindable WPF chart as it has similar binding and MVVM capabilities. As with bindable WPF chart, the collection properties of UWP charts (such as ViewXY axes, 3D lights) are empty by default. Windows 10 and Visual Studio 2017 onwards are required to develop UWP applications with LightningChart. Universal Windows Platform development workload should also be installed on Visual Studio, including the following:
- Microsoft.NETCore.UniversalWindowsPlatform: 6.2.8 or later (Nuget package).
- Microsoft.Toolkit.Uwp: v 4.0.0 or later, 6.0.0 or later recommended. Note that the latest toolkits may not be compatible with earlier target versions.
:::tip
There are dozens of ready-made UWP projects, which can be extracted from [Demo](/docs/getting%20started/RunningDemo.md) as standalone examples/projects.
:::
### Creating a UWP application
Follow these steps to create a UWP application utilizing LightningChart:
1. Create a new project with Visual Studio. Select Blank App (Universal Windows).
2. Give the project a name and file location.
3. Set Target and Minimum versions for the project. Available versions depend on what SDKs have been installed on the machine. For further information see [Microsoft’s documentation](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/). Version 16299 or above is recommended. Note that these can be changed later via Project -> Properties.

*Selecting Target and Minimum versions for UWP*
4. When using Target version 2004 or newer, TypeInfoReflection setting should be disabled. Open the *.csproj project file for instance in a text editor and add the following line to each PropertyGroup defining a build condition (Debug|x86, Release|x86 etc.):
```xml
false
```
5. Add LightningChart and SharpDX assemblies to references. By default, these can be found in **C:\Program Files\LightningChart\LightningChart .NET SDK v.12\LibUWP**. Note that the same UWP assemblies work for x86, x64, Arm and Arm64 platforms. The target platform can be changed by right-clicking the project and selecting Properties -> Build -> Platform target.

*References of a UWP project. The LightningChart and SharpDX files are added from the LightningChart installation folder.*
6. Install **Microsoft.Toolkit.Uwp** NuGet package to your project. Version 6.0 or newer recommended.
7. UWP requires developer key to be set in the application. Extract the key from LicenseManager via ***“Copy UWP developer key to clipboard”*** button, then set it in **App.Xaml.cs** file by using ***LightningChart.SetUwpDeveloperKey()*** method.

*Using License Manager to copy UWP developer key to clipboard.*

*Setting the UWP developer key in App.Xaml.cs file.*
8. It is now possible to create LightningChart components in code or in xaml editor. For example, creating a UWP chart in code:
```csharp
using LightningChartLib.UWP.ChartingMVVM;
namespace ExampleProject
{
public sealed partial class MainPage : Page
{
private LightningChart _chart = null;
public MainPage()
{
InitializeComponent();
CreateChart();
}
private void CreateChart()
{
_chart = new LightningChart();
// Chart control into the parent container.
(Content as Grid).Children.Add(_chart);
// Disable rendering until the whole chart is set up correctly.
_chart.BeginUpdate();
// Configure chart here.
// Allow rendering the chart.
_chart.EndUpdate();
}
}
}
```
9. Build, deploy and run the application. In case of app not running (for instance due to “Activation of the Windows Store app…” error), often changing Target and Minimum versions helps.
10. When deploying a UWP application to other machines, deployment key should be applied (see [Deployment](/docs/beginners%20guide/deploymentV11.md)). Deployment key cannot be used together with development key. Therefore, remove setting the developer key before deploying.
### UWP troubleshooting
UWP projects have some known issues. These are often not related to LightningChart but to UWP in general. Therefore, searching for additional information from web is recommended. In any case, don’t hesitate to contact support (support@lightningchart.com) if you have any questions.
Some known UWP issues:
- Version 1903 not working. Might give error such as Build error MSB4166: Child node "2" exited prematurely.
This is a known issue specific to 1903. The best fix is to simply use different target version. Microsoft recommends targeting version 2004 (build 19041) or above instead.
- Release build not working.
Try disabling Compile with .NET Native tool chain via project’s Properties -> Build
- Debug build not working
In some UWP versions, for instance version 2004, debug build might not run giving error: Run Error: an unhandled win32 exception occurred in [3088] (number is different for different build). In these cases, make sure you have added
```xml
false
```
line to your csproj file. Alternatively, try using release build instead.
- Activation of Windows Store App ’App name’ failed.
Try cleaning the solution. Delete bin and obj folders and rebuild as instructed [here](https://docs.microsoft.com/en-us/previous-versions/hh972445(v=vs.140)?redirectedfrom=MSDN)
---
## CustomMessage
From version 12.4 each View has ***CustomMessage*** property to draw text box in the top-left corner.
User can have custom message written on the chart (as text box in the top-left corner). ***Chart. CustomMessageOptions*** properties allow to change colors, font and offset of the message box. Custom message will be shown until ***View. CustomMessage*** property is set to empty/white-space string.

*CustomMessage in ViewXY.*
In addition, by enabling ***CustomMessageOptions. SetChartMessageAsCustomMessage*** property user can pass all [internal LightningChart messages](/docs/how-to/debug-troubleshoot.md) to this CustomMessage (severity defined by ***CustomMessageOptions. CustomMessageSeverity*** property). This can be handy during application debugging.
:::tip[Note]
Note, that each internal ***ChartMessage*** will be shown in message box for 10 seconds and multiple messages will be displayed in order they have been raised (top line in message box will be telling how many messages are still in the queue).
:::

*Example of Internal ChartMessages as CustomMessage in ViewXY (CustomMessageOptions. SetChartMessageAsCustomMessage is enabled).*
---
## DataBreaking
## DataBreaking by NaN or other value
These series types support data breaking: [PointLineSeries](/docs/inDetail/PointLineSeries.md), [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md), [SampleDataSeries](/docs/inDetail/SampleDataSeries.md), [AreaSeries](/docs/inDetail/AreaSeries.md), [HighLowSeries](/docs/inDetail/HighLowSeries.md), [PointLineSeries3D](/docs/inDetail/PointLineSeries3D.md).

*DataBreaking options in series that support it.*
LightningChart skips rendering of the data points that match with specified breaking Value. All other values it renders normally.

*DataBreaking in use for PointLineSeries, SampleDataSeries, AreaSeries and HighLowSeries.*
:::note
When **DataBreaking.Enabled** = True, it will cause significant extra overhead, and is not recommended for solutions needing a very high real-time data rates. Consider using [ClipAreas](/docs/inDetail/ClipAreas.md) instead.
:::
For example, using NaN to break PointLineSeries data:

*Using NaN to break PointLineSeries*
Code:
```csharp
int pointCount = 101;
double[] xValues = new double[pointCount];
double[] yValues = new double[pointCount];
for (int point = 0; point < pointCount; point++)
{
xValues[point] = (double)point * interval;
yValues[point] = 30.0 + 5.0 * Math.Sin((double)point / 20.0);
}
//Add some NaN values in Y array to mark break points
yValues[40] = double.NaN;
yValues[70] = double.NaN;
yValues[71] = double.NaN;
yValues[72] = double.NaN;
yValues[73] = double.NaN;
yValues[90] = double.NaN;
yValues[91] = double.NaN;
//Add new series with DataBreaking Enabled
PointLineSeries pls = new PointLineSeries(_chart.ViewXY, _chart.ViewXY.XAxes[0], _chart.ViewXY.YAxes[0]);
pls.DataBreaking.Enabled = true;
// set data gap defining value (default = NaN)
pls.DataBreaking.Value = double.NaN;
SeriesPoint[] points = new SeriesPoint[pointCount];
for (int point = 0; point < pointCount; point++)
{
points[point].X = xValues[point];
points[point].Y = yValues[point];
}
```
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures*, *SeriesDataBreaking* and *DataBreakingLineByNaN* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Data clipping in ViewPolar
### ClipInsideGraph
[PointLineSeriesPolar](/docs/inDetail/PointLineSeriesPolar.md), [AreaSeriesPolar](/docs/inDetail/AreaSeriesPolar.md), [Sectors](/docs/inDetail/Sector.md) and [PolarEventMarkers](/docs/inDetail/event-markers-polar.md) have ***ClipInsideGraph*** -property, which hides the data points if they are not within the radius of the graph area. The exact clipping point is the outermost angular axis. By default, ***ClipInsideGraph*** is enabled for all series.
```csharp
// Disabling clipping outside the graph
pointLineSeriesPolar.ClipInsideGraph = false;
```
### CenterClipping
***CenterClipping*** was introduced in LightningChart version 8.5.1. It works similarly to ***ClipInsideGraph*** but controls how data is clipped at the center of the polar chart, when for example amplitude axis is dragged with mouse. ***CenterClipping*** has three options to choose from:
- *None*: The old behavior before version 8.5.1. Series are shifted to the opposite side of the center point, and not clipped in any way (except for sectors).
- *Center*: Data is clipped at the center point of the graph and will never be shifted to the opposite side. This is the default option.
- *InnerCircle*: Data is clipped at the innermost value of the amplitude axis, that is either the minimum or the maximum of the axis, depending on the axis being reversed or not. If the chart has several amplitude axes, series is clipped according to the axis it is assigned to.
```csharp
// Setting PointLineSeriesPolar to be clipped below amplitude axis minimum, as reversed axis is not used.
_chart.ViewPolar.Axes[0].AmplitudeReversed = false;
pointLineSeriesPolar.CenterClipping = CenterClipping.InnerCircle;
```
*Center* and *InnerCircle* -options are not always at the same location, as there is ***AxisPolar. InnerCircleRadiusPercentage*** -property, which can be used to leave empty space near the center of the graph. In other words, it defines where an amplitude axis begins. ***InnerCircleRadiusPercentage*** is specific to the axis it is set to, meaning it does not affect the other amplitude axes.
```csharp
// Setting InnerCircleRadiusPercentage to 10 percent for this axis
chart.ViewPolar.Axes[0].InnerCircleRadiusPercentage = 10;
```

*CenterClipping set to None on the left image, Center in the middle image and InnerCircle on the right image. InnerCircleRadiusPercentage is set to 10 in each one of the images.*
---
## Data cursors
## Data cursors (DataCursor)
Starting from version 10.4, ViewXY has a built-in data cursor, which automatically tracks the closest series value to the mouse cursor and shows it in a result table. The cursor consists of horizontal and vertical hair cross lines, tracking point at the location of the closest data value, axis labels showing the current X- and Y-values, and the result table, which besides the axis values also shows the series name and its color.
:::info
Starting from version 10.5, DataCursor is also property of [3D](/docs/inDetail/DataCursor3D.md), [Polar](/docs/inDetail/DataCursorPolar.md) and Smith view. Therefore, DataCursor can track all XY, 3D, Polar, and Smith series.
:::
### Basic properties
Data cursor can be enabled or disabled via ***Visible*** property. It is also possible to hide some of the cursor components such as the lines or the axis labels individually by setting ***ShowHaircrossLines*** or ***ShowLabels***, or other respective “Show” properties based on what should be hidden, false. The appearance of the cursor can also be modified via component specific properties. ***LabelFont*** modifies the axis label texts, ***LineStyle*** can be used to customize the hair cross lines, and ***TrackingPointStyle*** allows altering the tracking point. ***Results*** property contains all the options to modify the result table.
```csharp
// Enables data cursor but hides its axis labels.
_chart.ViewXY.DataCursor.Visible = true;
_chart.ViewXY.DataCursor.ShowLabels = false;
// Modifying result table.
_chart.ViewXY.DataCursor.Results.Background.Color = Colors.DarkBlue;
```

*Property tree of the data cursor.*
:::warning
In version 12.0.1 some of DataCursor properties at ViewPolar & ViewSmith has been renamed, while other replaced with more specific properties. More about those API changes can be found
[here](/docs/migration%20guides/to-version-12.0.1.md#DataCursor-properties-reorganized)
:::
From version 12.0.1 ***DataCursor*** for all views (XY, 3D, Polar or Smith) has ***Configuration*** property tree. There user can find properties to control color, style and visibility of label for each axis independently. The default text color is *Series.Title.Color*, default label's fill color is tracked pixel color and default label's border color is white.

*Data cursor has been enabled. No individual components have been hidden.*

*Data cursor tracking an Intenstiy Grid. Besides X- and Y-values the cursor shows the grid’s Value and Color fields.*
Data cursor changes its behavior depending on whether the tracked series has a visible line or just visible data points (scatter plot). If the line is visible, the cursor finds the nearest series and its value vertically in the cursor’s current X-position. If there are no lines visible, the cursor tracks the nearest data point in any direction. Enabling ***SnapToNearestDataPoint*** overrides this making the cursor always finding the nearest actual data point value in any direction.
### DataCursor in real-time/streaming applications
It should be noted that using data cursor in demanding real-time applications can decrease the performance significantly since the cursor is constantly calculating the nearest data value. To counter this, the cursor has ***RealTimeTracking*** property, which when enabled increases the overall performance. The drawback is that the cursor is updated less frequently and may seem laggy especially when the mouse is moved around scrolling or sweeping chart.
### Cursor tracking per Series
Series has ***CursorTrackEnabled*** property, which controls whatever it is being tracked by [DataCursor](/docs/inDetail/data-cursors.md) or [LineSeriesCursor](/docs/inDetail/LineSeriesCursor.md). User can disable this property if particular series tracking is not needed.
### Customizable content of ResultTable
From version 12.4 onwards, ***DataCursor*** can have customizable content of ***ResultTable***. In particular, after subscribing to ***DataCursor. ChangeResultContent*** event, user can use event handler to create [a composite format string](https://learn.microsoft.com/en-us/dotnet/standard/base-types/composite-formatting), which will be used instead of the default table. As much as composite format string allows, user can define which values to show in the ***ResultTable***, with what precision and how to arrange items (e.g. padding, alignment, multi-lines).
***ChangeResultContent*** event is available for XY, 3D, Polar and Smith views, although event-argument-class is slightly different for each. The event-argument gives user access to tracked series, axis values of tacking point and few other parameters.
When creating customized table, ***ResultContent*** should be set like in following example:
```csharp
// subscribing to event
_chart.ViewPolar.DataCursor.ChangeResultContent += DataCursor_ChangeResultContent;
// DataCursor event handler
private void DataCursor_ChangeResultContent(object sender, ViewPolarDataCursorResultTableFormatEventArgs e)
{
// ...
// For multi-line string it is better to use monospaced fonts for nice alignments.
// Following composite format string titles to the left and values to the right,
// Each with preferred formatted field width.
string formatString =
"{0}\n" +
" {1,-12}{2,8:0.00} {3}\n" +
" {4,-12}{5,8:0.00} {6}";
// ...
e.ResultContent = string.Format(formatString,
strSeriesTitle,
strAngleTitle, angle, strAngleUnits,
strAmplitudeTitle, amplitude, strAmplitudeUnits);
}
```

*Examples of customized ResultTable.*
:::tip[note]
More examples how customizable content of ResultTable can be created is found in [How-to guides](/docs/how-to/customize_DataCursor_ResultTable.md).
:::
### Titles with multiple lines
From version 12.6 onwards, DataCursor's ***ResultTable*** supports titles with multiple lines.
---
## DataCursor 3D
Starting from version 10.5, View3D has a built-in data cursor (similar to [DataCursor in ViewXY](/docs/inDetail/data-cursors.md)), which automatically tracks the closest series value to the mouse cursor and shows it in a result table. The ***DataCursor*** consists of hair cross lines for all three axes, a tracking point at the location of the closest data value, indicators showing the current values on axis scales, and the result table, which besides the axis values also shows the series name and its color.

*Data cursor with PointLineSeries3D and SurfaceMesh3D series.*
Data cursor can be enabled or disabled via ***Visible*** property. It is also possible to hide some of the cursor components such as the lines or the indicators labels for the axes individually by setting ***ShowHaircrossLines*** or ***ShowLabels***, or other respective “Show” properties based on what should be hidden, false. ***IndicatorLength*** and ***IndicatorWidth*** modify the axis indicators, ***TrackingPointStyle*** allows altering the tracking point while ***LineStyle*** changes the hair cross lines. ***Results*** property contains all the options to modify the result table. The appearance of the axis labels can be modified under ***Configuration*** category.

*The property tree of the data cursor.*
```csharp
// Enables data cursor but hides its axis indicator labels.
_chart.View3D.DataCursor.Visible = true;
_chart.View3D.DataCursor.ShowLabels = false;
// Modifying the result table.
_chart.View3D.DataCursor.ShowResultTable = true;
_chart.View3D.DataCursor.Results.Background.Color = Colors.DarkBlue;
```
Data cursor changes its behaviour depending on whether the tracked series has a visible line or just visible data points (scatter plot). If the line is visible, the cursor finds the nearest series and its value to the cursor’s current position. If there are no lines visible, the cursor tracks the nearest data point in any direction. Enabling ***SnapToNearestDataPoint*** overrides this making the cursor always finding the nearest actual data point value in any direction.
Data cursor works with every View3D series and object except for ***Rectangle3D*** and ***VolumeModels***.
---
## DataCursor Polar
Starting from version 10.5, ViewPolar has a built-in data cursor (similar to [DataCursor in ViewXY](/docs/inDetail/data-cursors.md)), which automatically tracks the closest series value to the mouse cursor and shows it in a result table. The ***DataCursor*** consists of hair cross lines for amplitude and angular axes, tracking point at the location of the closest data value, axis labels showing the current amplitude and angle values, and the result table, which besides the axis values also shows the series name and its color.

*Data cursor in polar view. Result table has been set visible by enabling ShowResultTable.*
Data cursor can be enabled or disabled via ***Visible*** property. It is also possible to hide some of the cursor components such as the lines or the axis labels individually by setting ***ShowHaircrossLines*** or ***ShowLabels***, or other respective *“Show”* properties based on what should be hidden, false. The appearance of the cursor can also be modified via component specific properties. ***LabelFont*** modifies the axis label texts, and ***TrackingPointStyle*** allows altering the tracking point. ***Results*** property contains all the options to modify the result table. To modify the individual components such as one of the labels or lines, use options under ***Configuration*** property.
```csharp
// Enables data cursor but hides its axis labels.
_chart.ViewPolar.DataCursor.Visible = true;
_chart.ViewPolar.DataCursor.ShowLabels = false;
// Enabling and modifying the result table.
_chart.ViewPolar.DataCursor.ShowResultTable = true;
_chart.ViewPolar.DataCursor.Results.Background.Color = Colors.DarkBlue;
```

*The property tree of the data cursor.*
Data cursor changes its behavior depending on whether the tracked series has a visible line or just visible data points (scatter plot). If the line is visible, the cursor finds the nearest series and its value based on the cursor’s current polar-coordinates. If there are no lines visible, the cursor tracks the nearest data point in any direction and shows it if it is near the cursor’s position. Enabling ***SnapToNearestDataPoint*** overrides this making the cursor always finding the nearest actual data point value in any direction.
Data cursor works with [PointLineSeriesPolar](/docs/inDetail/PointLineSeriesPolar.md) and [AreaSeriesPolar](/docs/inDetail/AreaSeriesPolar.md).
[Sectors](/docs/inDetail/Sector.md) and [Markers](/docs/inDetail/event-markers-polar.md) cannot be tracked.
---
## DataCursor Smith
Starting from version 10.5, ***ViewSmith*** has a built-in data cursor, which automatically tracks the closest series value to the mouse cursor and allows showing it in a result table. The cursor works identically to the cursor in [ViewPolar](/docs/inDetail/DataCursorPolar.md) except for showing real and imaginary values instead of amplitude and angle. Refer to chapter 10.9 to see how to configure the data cursor settings.
Data cursor tracks ***PointLineSeries*** but not ***Markers***.

*Data cursor in ViewSmith.*
---
## DigitalLineSeries
***DigitalLineSeries*** is a specific type of line series, which displays a line alternating between two Y-values, for example 0 and 1. Use ***DigitalHigh*** and ***DigitalLow*** to set the Y-values the line is alternating between. Series is fully optimized for performance and uses the least amount of memory of all series types. ***DigitalLineSeries*** has fewer configuration options compared to many other series, as it draws only the line between the data points but not the points themselves. Furthermore, it has only ***Color*** and ***Width*** properties to adjust the series appearance. See more [Line-series comparison](/docs/inDetail/comparing-line-series.md).
### Adding points
***DigitalLineSeries*** data points are always in progressive order with fixed intervals. ***FirstSampleTimeStamp*** property sets the X-value of the first data point, while ***SamplingFrequency*** control the interval between the points. The data points are added via ***AddBits()*** method as arrays of type *uint[]*. Each value in the array is converted to respective binary values, thus representing 32 data points. ***BitCount*** property can be used to check the total number of added points.
Following is an example code and resulting chart image
```csharp
// Adding a DigitalLineSeries.
DigitalLineSeries dls = new DigitalLineSeries(_chart.ViewXY, _chart.ViewXY.XAxes[0], _chart.ViewXY.YAxes[0]);
dls.Color = Colors.Yellow;
dls.Width = 2;
dls.FirstSampleTimeStamp = 0;
dls.DigitalLow = 0;
dls.DigitalHigh = 1;
dls.SamplingFrequency = 32;
uint[] data = new uint[] { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0xa54df810, 0x00000000, 0xFFFFFFFF };
dls.AddBits(data, false);
_chart.ViewXY.DigitalLineSeries.Add(dls);
```

*DigitalLineSeries based on the code above.*
### ClipAreas
Series support [ClipAreas](/docs/inDetail/ClipAreas.md).
### LineSeriesCursors
Series can be tracked with [LineSeriesCursors](/docs/inDetail/LineSeriesCursor.md).
### DataCursor
Series can be tracked with [DataCursor](/docs/inDetail/data-cursors.md).
### LimitYToStackSegment
Series support [LimitYToStackSegment](/docs/inDetail/limit-y-value.md).
### Examples
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures* and *TrillionDigital* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Dispose pattern
When a chart has been created in code, and is no longer needed, **chart.Dispose()** should be called (first remove chart from collection it was added). It frees the chart and all its objects, such as series, markers and palette steps from the memory.
### Extra care / ideal dispose pattern
While calling **chart.Dispose()** maybe sufficient for the most cases, user can improve GC (Garbage Collector - automated .NET memory handler) speed and avoid any uncertainties by applying The ideal dispose pattern as recommended by [.NET/Microsoft](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/events/how-to-subscribe-to-and-unsubscribe-from-events).
Here is the complete list of steps user should take:
- stop (or wait to finish) any background thread, which maybe streaming or pushing new data to the chart, before chart disposal.
- Before chart is disposed unsubscribe from Events. Note this not only for Chart event like MouseClick, but also for any other events (e.g. axisX.RangeChanged, annotation.DraggedByUser, legend.MouseUp, series.MouseDown etc.)
- Check that any class member, which references to chart (or it object) is properly updated or dispose. The example of such member is
*_pls = _chart.View3D.PointLineSeries[0]* and it would be error dispose *_pls*, before removing it from chart/collection.
- dispose and null chart.
Here is the example of dispose method of complex application (like *ExampleEEGDataVisualizationShowcase* from LightingChart Demo)
```csharp
///
/// Dispose charts.
///
public void Dispose()
{
if (_backGroundWorker != null)
{
_running = false;
_backGroundWorker.Dispose();
_backGroundWorker = null;
}
if (_ChartList == null)
return;
// Remove first from UI.
ChartPlace3D.Children.Clear();
ChartPlaceEEG.Children.Clear();
ChartPlacePowerSpectrum.Children.Clear();
ChartHead2D0.Children.Clear();
ChartHead2D1.Children.Clear();
ChartHead2D2.Children.Clear();
ChartHead2D3.Children.Clear();
ChartHead2D4.Children.Clear();
// And dispose after removed from UI.
_ChartList[2].View3D.SurfaceMeshSeries3D[0].ContourPalette.Dispose();
for (int i = 0; i < _ChartList.Count; i++)
{
_ChartList[i].MouseClick -= Chart_MouseClick;
_ChartList[i].Dispose();
}
_ChartList = null;
_reader = null;
_spectrumCalculator.Dispose();
_spectrumCalculator = null;
_gads2D = null;
_sensorLocations = null;
_modelGeometryAdditionalData = null;
_dataPointSeries.Dispose();
_dataPointSeries = null;
_points = null;
_paletteStepColors = null;
_ThemeStepColors = null;
GC.Collect();
}
```
### Disposing objects
If objects are created on the fly, and then the memory used by them needs to be freed before exiting the application or disposing the whole chart with **chart.Dispose()**, remove the object from the collection it has been added to, and then call **Dispose()** for the object.
For example, disposing a series from chart.ViewXY.PointLineSeries collection:
```csharp
//Do cleanup... Remove and dispose 3 series
_chart.BeginUpdate();
List listSeriesToBeRemoved = new List();
listSeriesToBeRemoved.Add(_chart.ViewXY.PointLineSeries[1]);
listSeriesToBeRemoved.Add(_chart.ViewXY.PointLineSeries[3]);
listSeriesToBeRemoved.Add(_chart.ViewXY.PointLineSeries[4]);
foreach (PointLineSeries pls in listSeriesToBeRemoved)
{
_chart.ViewXY.PointLineSeries.Remove(pls);
pls.Dispose();
}
_chart.EndUpdate();
```
When LightingChart's objects are no longer needed, it is a good practice to dispose them to prevent memory leaking.
LightningChart’s collections also have specific methods for correctly disposing unused objects. Instead of calling generic list.Clear() method (e.g. *ViewXY.SampleDataSeries.Clear()*), RemoveAndDispose or DisposeAllAndClear can be used. For example, to remove all **SampleDataSeries**:
```csharp
chart.ViewXY.SampleDataSeries.DisposeAllAndClear();
```
### When binding properties
- Unlike standard .NET objects that implement *IDisposable*, a *DependencyProperty* is a static metadata registration, not an instance-bound resource. It lives for the entire duration of the application lifecycle. [the creator/owner of an object manages its lifecycle]
- User cannot unregister or dispose of the *public static readonly DependencyProperty* field itself, as it is a permanent part of the application's runtime metadata. However, clearing the instance value ensures that Object can be successfully reclaimed by the Garbage Collector.
- User should break or clear the binding (and prevent memory leak), especially if the data object bound to that property or the host control itself needs to be collected by the Garbage Collector.
- When dealing with heavy rendering resources, the order of cleanup is vital to avoid referencing disposed instances during property change cycles.
Combining Microsoft's guidance for a thorough cleanup routine looks like this (e.g. **Axisx3d** dependency property):
```csharp
public void CloseAndUnbind()
{
// 1. Fetch the object to prepare it for native resource disposal
// GetValue reads the current resolved item before we sever connections
var heavyObject = this.GetValue(ViewModel.Axisx3dProperty) as IDisposable;
// 2. Clear the binding per Microsoft's data binding architecture
// This stops UI threads from evaluating changes or pushing updates
System.Windows.Data.BindingOperations.ClearBinding(this, ViewModel.Axisx3dProperty);
// 3. Wipes out local property cache references completely
this.ClearValue(ViewModel.Axisx3dProperty);
// 4. Safely call standard .NET IDisposable routine on your 3D asset
heavyObject?.Dispose();
}
```
---
## DPI handling
DPI (Dots Per Inch) is related to monitor resolution and size. High DPI value means smaller pixels and crisper image.
Support for DPI scaling varies between .NET Framework, .NET ‘core’ (.NET 5..9) and Windows versions. Consult Microsoft guidelines for specific details (e.g. https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#dpiAwareness).
UWP supports monitors with different DPI generally well and scales app content quite nicely.
[Axes have methods](/docs/inDetail/axis-class-properties.md) to convert axis values (data point values) to screen coordinates and screen coordinates to axis values. Use ***ValueToCoord*** method to convert an axis value to a screen coordinate, and ***CoordToValue*** to convert a screen coordinate to an axis value. Set **UseDIP = False**, if pixels are preferred, not Device independent pixels (DIPs).
### General
By default, .NET Framework WPF applications are DPI aware, whereas WinForms apps only DPI aware in newer versions ([starting with the .NET Framework 4.7 and with the Windows 10 Creators Update](https://learn.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms)). Also, DIPs (Device Independent Pixel) are used instead of pixels to measure sizes with WPF.
.NET 'core' support for DPI is quite similar to both WPF and WinForms.
### .NET Framework
Application may or may not automatically resize when moved to another screen with different DPI settings. To enable application resizing, ***AllowDPIChangeInduceWindowsResize*** property under ***ChartOptions*** needs to be set true. Alternatively, user can register to ***OnDPIChanged*** event and change its ***allowWindowResize*** attribute. These have no effect in WinForms.
```csharp
// Enabling automatic resizing
chart.Options.AllowDPIChangeInduceWindowResize = true;
// Via OnDPIChanged -event
chart.OnDPIChanged += chart_OnDPIChanged;
private void chart_OnDPIChanged(LightningChart chart, float dpix, float dpiy, ref bool allowWindowResize)
{
allowWindowResize = true;
}
```
#### WinForms
WinForms DPI support is most limited, but still can adapt to various DPI settings. Application can receive DPI change events (from Form), but controls not.
Application support for DPI can be configured at **app.config** file (recommended) or at **app.manifest** file.
Windows Forms introduces a new [System.Windows.Forms.ApplicationConfigurationSection](https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/winforms/index) element to support new features and customizations added starting with the .NET Framework 4.7. To take advantage of the new features that support high DPI, add the following to your application configuration file.
```csharp
```
#### WPF
WPF has broader DPI support. Controls can also receive DPI change events.
Application support for DPI can be configured at **app.config** file (recommended) or at **app.manifest** file.
### NET 6+
Generally NET 6+ supports DPI quite well. Default DPI Awareness for NET application is System aware and it can be changed from application project file by ApplicationHighDpiMode property like so:
```csharp
WinExe
net6.0-windows
true
PerMonitorV2
```
### DpiHelper class
LightningChart has ***DpiHelper*** class, which contains helpers on DPI related issues.
***DpiAware*** states if the system process is DPI aware or not. However, it is currently not possible to distinguish between system aware and per-monitor aware.
```csharp
bool isDPIAware = DpiHelper.DpiAware;
```
***DpiXFactor***/ ***DpiYFactor*** is an effective Zoom factor of the system DPI of the screen width/height. Factor that describes how many real pixels there are per one DPI in X/Y direction.
```csharp
float dpiXFactor = DpiHelper.DpiXFactor;
```
***DipToPx*** and ***PxToDip*** methods convert DIPs to pixels and vice versa using system DPI settings. They can convert single points or pixels, or alternatively the size and the position values of a rectangle.
```csharp
double pixelValue = DpiHelper.DipToPx(dipValue);
```
---
## Markers ViewPolar
## EventMarkers in ViewPolar
***ViewPolar. Markers*** are similar to ViewXY’s **EventMarkers** (see [EventMarkers XY](/docs/inDetail/event-markers-XY.md)). Markers can be used to mark a specific data value at certain position. Assign the marker with a preferred axis by setting its ***AssignPolarAxisIndex***. Define ***Amplitude*** and ***AngleValue*** properties to put it into place. Edit ***Symbol*** to have the preferred appearance and define the marker text with ***Label*** property.
Markers can be moved by dragging them with mouse. Set ***SnapToClosestPoint*** to *Selected* or *All* to enable nearest data point snapping when dragging it. Selected tracks only the series this marker is set to snap to with SetSnapSeries() method. All tracks all series.
There is also ***ClipInsideGraph*** property, which determines if a chart marker can be drawn outside the graph area.

*Various size and color Marker in a polar chart.*
:::info
To see EventMarkers used in example, check *ScatterPolarMouseSelecting*, *CombinedPolar*, *Sonar fish indicator*, *Scanning radar* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Markers ViewSmith
## EventMarkers in ViewSmith
***ViewSmith. Markers*** are similar to ViewXY’s **EventMarkers** (see [EventMarkers XY](/docs/inDetail/event-markers-XY.md)). Markers can be used to mark a specific data value at a certain position. Same as in ViewPolar (see [Polar Markers](/docs/inDetail/event-markers-polar.md)) Markers can be moved by dragging them with mouse. Set ***SnapToClosestPoint*** to *Selected* or *All* to enable nearest data point snapping when dragging it. Selected tracks only the series this marker is set to snap to with SetSnapSeries() method. All tracks all series.
Define ***ImgValue*** and ***RealValue*** properties to position it. Edit ***Symbol*** to have the preferred appearance and define text with ***Label*** property.

*A marker tracking a series in Smith view.*
:::info
To see EventMarkers used in example, check *ExampleSmithLine* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## EventMarkers ViewXY
## EventMarkers in ViewXY
**EventMarkers** allow marking a point of interest, where something special occurred during real-time monitoring, or if user just wants to mark a piece of data with a special annotation. Define the marker symbol with ***Symbol*** property and a text label with ***Label*** property.
Like [Annotations](/docs/inDetail/annotation-XY.md), **EventMarkers** can be dragged with mouse-cursor (when ***AllowDragging*** is enabled). It is also possible to create various event handlers for interactions (when ***AllowUserInteraction*** is enabled). For example, custom handler for ***MouseClick*** event.
### Adjusting appearance
To select the shape of the marker, set ***Symbol. Shape***. Shapes available for all type of **EventMarkers** are *Rectangle*, *Circle*, *Triangle*, *Hexagon*, *Flag*, *FlagLightning*, *Cross*, *CrossAim*, *Bitmap*, *HollowBasic*, *HollowBasicActive*, *HollowHarmonic*, *HollowActiveSideband*, *HollowSideband*, *HollowTailedActive* and *HollowTailed*. ***Symbol*** properties ***Angle***, ***Height***, ***Width***, ***Color1-2-3***, ***GradientFill*** can further be used to modify appearance of Marker.
***Label*** property has many sub-properties to modify visibility, text, font, fill, angle and alignment relative to symbol (***Visible***, ***Text***, ***Font***, ***Fill***, ***Angle***, ***HorizontalAlign***, ***VerticalAlign***, ***Distance*** respectively).

*Various styles of EventMarker for Symbol and Label.*
One of the shape styles is *Bitmap*, which allows drawing any bitmap image in the point location. Define the bitmap image with ***BitmapImage*** property. ***BitmapAlphaLevel*** property can be used to alter the transparency of the bitmap. Adjust the bitmap color tone by changing ***BitmapImageTintColor*** to some other color than white. If ***UseImageSize*** property is enabled, then image original size is used instead of ***PointStyle*** properties ***Height*** and ***Width***.
:::tip[Note]
EventMarker's ***Symbol*** properties and shapes are very similar to [PointStyle of line-series ](/docs/inDetail/points-style.md).
:::
While ***ChartEventMarker*** and ***SeriesEventMarker*** similar in many respects, the main difference comes how those two objects positioned in the chart (how *vertical* and *horizontal* position are defined).
### Chart event markers
***ViewXY. ChartEventMarkers*** collection allows adding chart markers. A chart marker can be used to indicate a point of interest, like “Test person stood up”, “Capacitor bypassed”. Unlike series event markers, chart event markers are not attached to a specific series. The markers can be dragged with mouse into another location.
The position of a chart marker can be set via ***VerticalPosition***, ***XValue***, ***BindToXAxis*** and ***Offset*** properties.
The vertical position of ***ChartEventMarker*** is controlled by ***VerticalPosition*** property, which has *Top*, *GraphTop*, *GraphCenter*, *GraphBottom* and *Bottom* options. Furthermore, ***Offset.Y*** property can further fine adjust vertical location (***Offset*** is in screen-coordinates, px).
For setting horizontal position of ***ChartEventMarker*** users can use either screen-coordinates or XAxis value. If ***BindToXAxis*** property set *true*, then marker binds to a specific X-axis, and to specific ***XValue***. In practice, this makes the marker stay at its current X-value and move when, for example, the X-axis is panned. When ***BindToXAxis*** is disabled, the marker is kept in the same chart position no matter how the axes are moved (position is defined by ***Offset.X*** property, which offset in screen-coordinates from the left edge). If there are several X axes, ***AssignXAxisIndex*** can be used to set which axis the marker is bound to.
***ClipInsideXRange*** can be used with or without ***BindToXAxis*** enabled. It makes a marker to clip when a specific X-axis value (it is bound to) is not within the visible X-axis range. There is also ***ClipInsideGraph*** property, which determines if a chart marker can be drawn outside the graph area (on the margins).
### Line series event markers
Line-series have ***SeriesEventMarkers*** collection property. It can be used to assign series specific event markers. The series event markers can be dragged with mouse to another location, while keeping the event marker attached to the series values. To enable this, marker’s ***VerticalPosition*** must be set to *TrackSeries* (see *ExampleMarkersTracking* for demonstration). This is available for series implementing **ITrackable** interface.
Other ***SeriesEventMarker. VerticalPosition*** options are *AtYValue*, *ZeroLevel*, *YAxisTop*, *YAxisCenter* and *YAxisBottom*.
By setting ***HorizontalPosition*** to *SnapToPoints*, the marker aligns itself horizontally to position of nearest data point. ***HorizontalPosition*** = *AtXValue* allows placing the marker at any x value. Respectively, ***VerticalPosition*** = *AtYValue* allows setting the marker vertically to any Y level.
No line-series data point is required, if user wants just to set Marker at specific axes-coordinates, one should set ***XValue*** and ***YValue*** properties (together with ***HorizontalPosition*** = *AtXValue* and ***VerticalPosition*** = *AtYValue*).
In addition to normal set of shapes, ***SeriesEventMarker*** supports two special ***Symbol. Shape*** settings, HollowYAxis and HollowYAxisActive, which allow vertical line with Y axis ticks projection. They have a pixel wide vertical line which picks positions of ***MajorTicks*** and ***MinorTicks*** from the Y axis the series is attached to. To adjust the tick lengths, edit ***YAxis. MajorDivTickStyle. LineLength*** and ***YAxis. MinorDivTickStyle. LineLength*** properties.

*Two special SeriesEventMarkers shapes: HollowYAxis and HollowYAxisActive. Very handy when making per-series data cursors.*
:::info
To see EventMarkers used in example, check *ExampleTradingMultiSegment*, *ExampleMarkersTracking*, *ExampleMapRoute*, *ExampleHeatmapColorSpreading2D*, *Bubble chart*, *Campbell diagram*, *Curve node editing* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Export and printing
There are many ways to export and print chart.
### Bitmap image export (raster format)
The chart can be exported as .PNG, .BMP and .JPG file with ***SaveToFile()*** method. ***SaveToFile(…)*** method allows exporting image files with resolution decrement and smoothing/anti-alias options. To export to a stream, use ***SaveToStream()*** method.
### Vector image export
ViewXY, ViewPolar and ViewSmith can be also exported as .EMF and .SVG formats. View3D and ViewPie3D don't currently support it. Use ***SaveToFile*** or ***SaveToStream*** method with selected vector file format.
:::caution[Note!]
The vector output is simplified and all details, such as complex point styles, may be presented as a plain color and simple shape. The vector output may also contain some bitmap elements.
:::
:::tip
If user needs a lot of scaling of image, then vector-format is better option. For example, fonts in chart is scaled better in vector format. However, if user needs smooth color gradients (e.g. heatmap), then raster image format will save those details better.
:::
### Copy to clipboard
The chart can be copied to clipboard by calling ***CopyToClipboard(…)***. ViewXY, ViewPolar and ViewSmith can copied with ***CopyToClipboardAsEmf()*** method in vector format.
### Capturing to byte array
The chart has ***CaptureToByteArray*** method, to get as a fast raw image data copy to external components or further processing of data.
*Usage*
```csharp
int width;
int height;
PixelFormat format;
byte[] aData = _chart.CaptureToByteArray(out width, out height, out format);
Bitmap bitmap = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
System.Drawing.Imaging.Bitmapdata bitmapData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, width, height), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
IntPtr ipDst = bitmapData.Scan0;
int iRowByteCount = width * 4;
int iSrcIndex = 0;
for (int iY = 0; iY < height; iY++)
{
Marshal.Copy(aData, iSrcIndex, ipDst, iRowByteCount);
ipDst = new IntPtr(ipDst.ToInt64() + bitmapData.Stride);
iSrcIndex += iRowByteCount;
}
bitmap.UnlockBits(bitmapData);
```
### Get chart as bitmap
The chart has ***CaptureToBitmap*** method, which returns platform specific (WinForms, WPF or UWP) image. *BitmapAntialiasOptions* can be set as input argument.
### Setting output stream for continuous frame writing
Use ***chart.OutputStream*** property to set a stream into which the chart will write it’s rendered frames.
This property is intended as the fastest way to capture continuous frames from the chart, especially on [Headless mode](/docs/inDetail/headless-mode.md).
The stream is a raw byte stream, with each pixel described with 4 bytes, one byte per channel. The order of the channels depends on the renderer and its settings.
Use ***GetLastOutputStreamFormat*** and ***GetLastOutputStreamSize*** methods to find out the format and output size of the last written image.
Produced image size should be the size of the chart in pixels.
:::info[Note!]
On the contrary to the other properties of the LightningChart, set stream is NOT disposed on chart's dispose.
:::
:::info[Note!]
On the contrary to the other properties, setting this property will not cause new frame to be rendered.
:::
### Printing and PrintPreview
Call ***PrintPreview()*** method to open a print preview dialog or ***Print()*** to directly print with default settings. Call ***Print(…)*** to print with manual settings. Printing ViewXY, ViewPolar and ViewSmith supports vector printing as well. Supply **Raster** or **Vector** format to parameter to ***Print(…)*** method.
In version 12.5 PrintPreview dialog was revised. Now in WinForms dialog is available in several languages: EN, DE and FI (more language support can be added upon request). Note, that WPF does not have multilingual support.
Required language is set with following line at the start of application's constructor:
```csharp
CultureInfo.CurrentUICulture = new CultureInfo("de-DE", true);
```

*Print preview dialog in EN, DE and FI*
In addition,
- 'Setup' button displays printing-preferences (Windows OS dialog).
- For smoother handling experience, preview image is not redrawn after each property change, but only after 'Refresh' button click.
- PrintPreview dialog setting are saved and loaded next time from user's app folder (file *"LightningChartPrintPreviewSettings.json"*).
- User now can control visibility and settings of PrintPreview by calling method with ***VisibilityState*** and ***EnableState*** parameters.
- There is also new event ***PrintPreviewF1Pressed*** which is raised when F1 key is pressed on PrintPreview dialog.
#### PrintPreview parameters, VisibilityState and EnableState
***PrintPreview()*** method has several overloads. Of particular interest is one with ***VisibilityState*** and ***EnableState*** parameters. This allows to manage which dialog's control to be shown and how they are set.
***VisibilityState*** has *Orientation* (Portrait & Landscape), *Format* (Bitmap & Vector), *Margins*, *Options* (checkboxes KeepAspectRatio, GraphFill, BackgroundFill and DoubleResolution) flags. There is also *All* and *None* flags.
***EnableState*** has *Bitmap* (Bitmap vs Vector setting), *Portrait* (Portrait vs Landscape), *BackgroundFill* (checkbox checked), *GraphFill* (checkbox checked), *KeepAspectRatio* (checkbox checked), *DoubleResolution* (checkbox checked) flags. There is also *All* and *None* flags.
For example, following code excerpt with modify dialog to show only groups of Orientation and Margins controls, and enable/use specified flags (Bitmap, Landscape, BackgroundFill, GraphFill and KeepAspectRatio).
```csharp
private void buttonPrint_Click(object sender, EventArgs e)
{
foreach (LightningChart lc in _chartsSelected)
{
// show only groups of Orientation and Margins controls
VisibilityState showState = VisibilityState.Orientation | VisibilityState.Margins;
// enable/use Bitmap, Landscape, BackgroundFill, GraphFill and KeepAspectRatio
EnableState enableState = EnableState.Bitmap | EnableState.BackgroundFill | EnableState.GraphFill | EnableState.KeepAspectRatio;
lc.PrintPreviewF1Pressed += Lc_PrintPreviewF1Pressed;
string strPrinterName = string.Empty;
string strFooter = null;
Padding margin = new Padding(15);
lc.PrintPreview("Header", ref strPrinterName, ref strFooter, ref margin, showState, ref enableState);
lc.PrintPreviewF1Pressed -= Lc_PrintPreviewF1Pressed;
}
}
```

*Print preview dialog configured to only groups of Orientation and Margins controls.*
### XAML serialization
LightningChart .NET supports [XAML serialization](/docs/inDetail/xaml-serializer.md) from version 12.0.1. This means that .NET class ***XamlWriter*** can be used to serialize LightningChart object into XAML markup, while .NET class ***XamlReader*** can be used to read XAML input and create a LightningChart object. By using XamlWriter.Save() and XamlReader.Load() methods user can save the state of the Chart (save value for the most of its properties) and import that state next time user opens the application.
---
## FreeformPointLineSeries
***FreeformPointLineSeries*** for arbitrary data (X values can be in any order).
A ***FreeformPointLineSeries*** can present a simple line, points (scatter) or both as a point line. ***FreeformPointLineSeries*** allows drawing line point to any direction from previous point. All line and point
formatting options from [PointLineSeries](/docs/inDetail/PointLineSeries.md) apply.
The tradeoff for arbitrary data is the lower real-time performance as compare to other lines series. See more [Line-series comparison](/docs/inDetail/comparing-line-series.md).
Add the series to chart by adding ***FreeformPointLineSeries*** objects to ***FreeformPointLineSeries*** list.
```csharp
// Add a FreeformPointLineSeries to the chart
chart.ViewXY.FreeformPointLineSeries.Add(freeformPointLineSeries);
```

*A freeform point line series*
### Adding points
The series points must be added in code. Use ***AddPoints(SeriesPoint[], bool invalidate)*** method to add points to the end of existing points.
```csharp
//Add points to the end
chart.ViewXY.FreeformPointLineSeries[0].AddPoints(pointsArray);
```
To set whole series data at once, and overwrite old points, assign the new point array directly:
```csharp
//Assign the points array
chart.ViewXY.FreeformPointLineSeries[0].Points = pointsArray;
```
Points can also be added in X and Y values arrays, which turns to be more convenient way in many applications.
```csharp
chart.ViewXY.FreeformPointLineSeries[0].AddPoints(xValuesArray,yValuesArray,false);
```
### PointCountLimit
Freeform point line series line points are not automatically destroyed even if ***ViewXY. DropOldSeriesData*** is
enabled, and the points are scrolled out of current view. To automatically destroy old series points in
real-time monitoring solution, use point count limiter. Set ***PointCountLimitEnabled*** *= true* and set the
limit to ***PointCountLimit*** property. If limiter is enabled, the Points array behaves as a ring buffer after
the point count limit has been reached. The oldest point from Points array can always be found by
retrieving value from ***OldestPointIndex***. If needing to read the existing data out of point count limited
buffer, use the following method:
- If OldestPointIndex is 0, read from Points[0] till ***Points***[PointCount-1].
- If OldestPointIndex > 0, first read from ***Points***[OldestPointIndex] till Points[PointCountLimit-1].
Then, read from ***Points***[0] till ***Points***[OldestPointIndex-1].
To directly retrieve the last series point, call ***GetLastPoint()*** method.
### Line style
Series support [LineStyle](/docs/inDetail/line-style.md).
### Points style
Series support [PointStyle](/docs/inDetail/points-style.md).
### SeriesEventMarker
Series support [SeriesEventMarker](/docs/inDetail/event-markers-XY.md).
### Y-value based coloring
Series support ***UsePalette*** and [Y-value based coloring](/docs/inDetail/advanced-line-coloring.md)
### Custom shaping and coloring
Series support [CustomLinePointColoringAndShaping event](/docs/inDetail/advanced-line-coloring.md).
### DataBreaking
Series support [DataBreaking by NaN or other value](/docs/inDetail/data-breaking.md).
### ClipAreas
Series support [ClipAreas](/docs/inDetail/ClipAreas.md).
### DataCursor
Series can be tracked with [DataCursor](/docs/inDetail/data-cursors.md).
### LimitYToStackSegment
Series support [LimitYToStackSegment](/docs/inDetail/limit-y-value.md).
### Rendering data into the Persistent-Rendering-Layer
Series data can be added to either [PersistentSeriesRenderingLayer](/docs/inDetail/persistent-layer.md) or [PersistentSeriesRenderingIntensityLayer](/docs/inDetail/persistent-intensity-layer.md).
### Examples
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures*, *ScatterPoints*, *CurveNodeEdit* and *MapRoute* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Geographic maps
## Geographic maps (in ViewXY)
Use ***Maps*** property and its sub-properties to show geographic maps. LightningChart maps come in two different categories: [vector maps](#Vector-maps) and [tile maps](#Tile-maps). The maps are shown in so called equirectangular projection.
This projection allows using LightningChart’s [ViewXY](/docs/beginners%20guide/ViewXY-series/xy_chart.md) series types and other objects that are practically all bound to X and Y axes, same time as the maps.

*Equirectangular projection of the world. X range is from -180 to 180 degrees (180W to 180E), Y range from -90 to 90 degrees (90S to 90N). Polar areas get greatly stretched in this projection.*
### Vector maps
The geographic vector data is stored in LightningChart map files, with ***.md*** extension. LightningChart is delivered with set of map files.
The X-axis is used for Longitude, and the Y-axis for latitude. See subchapter [Value type](axis-class-properties.md) for showing map coordinate axes. The map coordinates are decimal degrees, with latitude origin at equator and longitude origin at Greenwich, U.K.

*Maps’ properties and sub-properties. The whole tree is for vector maps, except TileLayers collection and TileCacheFolder, which is for tile maps.*
#### Selecting active map
Set the directory name to the ***Path*** property, where the map files exist (if not set, LightningChart will be looking for default folder *C:\ProgramData\LightningChart\Maps*). The active map can be selected with ***Type*** property, for maps delivered with LightningChart. To use an own map file, set the ***FileName*** property.
If no maps are wanted, set ***Type*** to *Off*.

*Map Type options. The maps delivered with LightningChart are shown. The type name postfix tells a rough detail level of the map.*
In general, the maps of LightningChart are made in very high detail level. For real-time monitoring solutions it is important to select a map giving proper detail and performance level.
#### Aspect ratio
***ViewXY.ZoomPanOptions.AspectRatioOptions.AspectRatio*** controls the X/Y (or longitude / latitude) ratio.
Set it to *Off* to enable X and Y axis range setting individually allowing stretching the map. *AutoLatitude* changes the aspect ratio dynamically when viewing the map in different locations. The aspect ratio is determined by the center point of the view. By setting the aspect ratio to *Manual*, use the ***ManualAspectRatioWH*** property to set the preferred ratio. See subchapter [Aspect ratio](zooming_panning_InDetail.md) for detailed explanation of how aspect ratio is calculated.
#### Layers and their appearance settings
Each map file can contain several layers. For example, layers for land regions, lakes, rivers, roads and cities. The layers and their data are accessible from ***Layers*** array property.

*Map layer details opened in Properties editor*
Each layer has a specific type. The layer appearance options can be changed with corresponding 'options' property. Use (***ViewXY. Maps.***) ***LandOptions*** for modifying the appearance of land regions, ***LakeOptions*** for lakes, ***RiverOptions*** for rivers, ***RoadOptions*** for roads, ***CityOptions*** for cities, and ***OtherOptions*** for unspecified layer types.

*Default LandOptions, and corresponding view from Europe*

*Modified LandOptions*
#### Setting individual fill and border style for each layer item
Each map element fill or border appearance can be set individually. [for example, for Maps.Layers[i].Type == 'Land', but not type 'City']. For that, change ***Maps.Layers[i]*** properties ***BorderDrawStyle*** and ***RegionDrawStyle*** to *Individual* (instead of *Options*). Then, access the ***Items*** collection, and navigate to preferred item and edit the ***BorderLineStyle*** and ***Fill*** properties. The ***Items*** collection can be navigated programmatically by ***Name*** property (in below image it is *“Germany”*).

*Setting layer border line and region fill styles to Individual and editing region in Items collection.*

*Germany region drawn with individual fill and border*
#### Mouse interactivity
Enable ***Maps. AllowUserInteraction*** for all kinds of interoperation with map regions and objects. Regions (land, lakes) and vector layers (rivers, roads) can be pointed with mouse cursor. Once the mouse is over an object, it gets highlighted with ***SimpleHighlightColor***, if ***Highlight*** is set to *Simple*. When ***Highlight*** is set to *Blink*, the object will blink in light and dark colors. By setting ***Highlight*** to *None*, the object is not highlighted, but it still can be clicked and for example used to invoke ***Maps. ButtonDownOnMapItem*** event.
Map objects may have associated data included, like population or other statistical data. Use ***OverOnMapItem***/ ***OverOffMapItem*** /***ButtonDownOnMapItem*** event handler to access the data. The data for a map item can be retrieved with ***GetInfo*** method, giving a dictionary of keys and values.
Here’s an example of how to show all data in a list box. The item name is displayed in a different text box.
```csharp
private void ButtonDownOnMap(ButtonDownOnMapItemEventArgs args)
{
MapItem mapItem = args.MapItem;
textBoxCountryName.Text = m_chart.ViewXY.Maps.Layers[args.Layer].Name + ": " + mapItem.Name;
listBoxItemValues.Items.Clear();
if (mapItem.GetInfo() != null)
{
Dictionary dict = mapItem.GetInfo();
Dictionary.KeyCollection keys = dict.Keys;
foreach (String key in keys)
{
String strValue;
if (dict.TryGetValue(key, out strValue))
{
listBoxItemValues.Items.Add(key + ": " + strValue);
}
}
}
}
```
#### Background photos
Adding a ***MapBackground*** object in ***Maps. Backgrounds*** property allows displaying bitmap images as the backgrounds of the maps. Satellite images or other raster images are available from several GIS data providers. The image can be set to ***Image*** property, and its latitude and longitude range can be set with ***LatitudeMin***, ***LatitudeMax***, ***LongitudeMin*** and ***LongitudeMax*** properties. The image is not displayed outside the set ranges.
To show the background through the map layers, it may be necessary to adjust the fill settings for each layer. Use transparent colors or colors with low alpha level.

*Map of the world. LandOptions.FillVisible is set to false, and one background image is set to latitude range of -90…90 and longitude range of -180…180. The map region borders and cities are shown.*
#### Combining other series with maps
Geographical maps can be combined with any ViewXY series type. The maps are drawn in the background and the series over them.

*Map of Europe, with a couple of FreeformPointLine series as routes. Flag markers are added to them as mouse-interactive waypoints.*

*Map of the world, with IntensityGrid series presenting the elevation.*

*Weather radar data visualization with IntensityGrid series over the map of Europe*
#### Examples
:::info
To see feature demonstration as example, check *ExampleMaps*, *ExampleMapRoute*, *Map with environmental data*, *Wind data* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
#### Importing maps from ESRI shape file data
Import feature makes a LightningChart map file (.md) from .shp files. ESRI shapefile (*.shp) is a widely used map file format supporting vector and polygon data.
Map wizard can be used to convert shapefile data to LightningChart (LC) map data format. LC format supports layering, so multiple shapefiles can be merged into a single file. Map file structures and objects are pre-processed for maximum run-time performance.
:::tip[Tip]
LightningChart® .NET’s [demo application](/docs/beginners%20guide/demo.md) has an example of map importing (*ExampleMaps*). Run import wizard from there to make custom LC map files through import.
:::
Conversion is done in minimum of three steps:
1. Selecting files and setting up layers based on the files in the Shapefile Selection Dialog.
2. Determining file text encoding.
3. Selecting items included in the resulting map file.
Note that steps 2 and 3 are repeated for each source shp file. Shapefile does not tell which encoding it uses, so it must be selected by the user.
After the steps, the conversion begins. If the maps are imported from a custom application, the developer is encouraged to setup an event handler, because conversion might take a very long time, so that user can be informed about the conversion progress.
Also, if user selects base layer, there might be a considerable delay between the steps, which is due to prefiltering data based on the layer.
##### Programming interface for importing shp data
Conversion is run on a thread that is initialized from ***Maps. MapConverter*** class using following method:
```csharp
public bool SelectFilesAndConvert()
```
For monitoring conversion progress there is an event handler delegate:
```csharp
public delegate void ConversionStateChangedEventHandler(Object sender, ConversionStateChangedEventArgs e);
```
Initializing it:
```csharp
MapConverter mapConverter = new MapConverter(false);
mapConverter.ConversionStateChanged += mapConverter_ConversionStateChanged;
```
##### Dialogs
There are usually three dialogs involved in the conversion process. To select a filter, there is a distinct dialog.
###### Shapefile Selection Dialog
After ***SelectFilesAndConvert()*** function is called, file selection dialog opens. In this dialog
user selects the source files and sets up the layering. User can also save the map configuration
by selecting proper file at the dialog.

*Source shape file selection dialog.*
**File list**
Contains list of files in the order in which they are drawn. File data at bottom is drawn last. Order of files can be chaged from the up/down buttons on the left of list. Select file and click up/down to move file.
**Layer name**
Name of the layer. E.g. ”Countries”.
**Layer type**
Type of layer (specifies which options are used to render layer)
- City: layer items are of shapefile type POINT
- Lake: layer items are of shapefile type POLYGON
- Land: layer items are of shapefile type POLYGON
- River: layer items are of shapefile type POLYLINE
**Base layer**
Used to filter upper layer item selection, when user wants a map which contains only single/some countries and there is only global map available. E.g. if layer contains countries, only items over the selected countries/country will be included in the resulting map. There is a small offset applied to POINT type, so that if point is near enough of border it’s included even if it doesn’t overlap with base layer. If all data from the selected shapefiles are included in the resulting map, don’t select base layer as it slows down item selection considerably, because all items are checked if they overlap base layer, which is a very time consuming process.
**Description**
Free text which is shown in the map properties.
**Configuration file name**
XML configuration file name. Used for importing/replacing a layer. Note! Use single file when creating map configuration as import. Replace methods can take only one shp input file.
**Save config**
Check this if wanting to save map configuration as xml file for later use. Selecting configuration file automatically sets this checked.
**Add button**
Click to select shapefile to be added to list.
**Remove button**
Removes selected file from list.
**Edit name button**
Click to open ”Layer name editor”. Set layer name.
**OK button**
Click to advance to next stage (item selection).
###### Select Record Encoding and Invalid Name Fields
This dialog is used to select file text encoding and fields which have invalid or general name. Shape file encoding may vary and there is no information about the encoding in the file, so user must select valid encoding. The item name may be like ”UNK” for multiple items. In this dialog the user can select which item name is emptied. Note that the items are still included in the resulting file, if they are selected in the next phase.

*‘Record encoding’ and ‘Invalid name’ fields selection dialog*
**File name**
Shape file name for which the encoding applies.
**Layer**
Layer name.
**Name field**
Item name field in the shape file. After selecting a different field, the list is updated accordingly.
**Name encoding**
Item name encoding (try different values if the name does not seem to be right). After selecting different encoding, the list is updated accordingly.
**Record name list / select records with invalid name**
List of items for the field selected in the ”Name” field.
**OK**
Confirm encoding selection (and possible invalid name).
###### Layer data selection dialog
This dialog is used to select items included in the resulting map file from the shape file. The layer name is concatenated in the title. The dialog is adaptive, so that for certain layers there are some fields which could be selected. E.g. for *River/Road* type layer there will be a Line width selection, which could be set to line width field (if applicable). Note that the data may not contain all the fields asked in the dialog. The ***Name*** field is mandatory for all items.

*Layer data selection dialog.*
The user interface items available in the dialog:
**File name**
Name of the file.
**Layer name**
Name of the layer.
**Name field**
Field used for item name. Set automatically from encoding selection dialog but can be adjusted here also.
**Population field**
Field used for population data.
**Country field**
Country name field.
**Line stroke width field**
Line width. Guides rendering of lines.
**Select stored items**
Select items individually, select them all, or use ***Filter*** dialog to select subset of items
**Toggle all**
Select all fields from file.
**Filter/Select...**
Select fields which has a field with selected values. In the image above, only items with SOVEREIGNT field set to ”Canada” or ”United States” are selected in the map.
**Inverted**
Invert filter selection (fields selected with filter are not included in resulting map file).
**Select stored fields per item**
Click on fields which should be included for each item. The fields are key values for Dictionary class, which contains the fields per item.
###### Item filter
This dialog is opened from Layer data selection dialog and is used to filter items for resulting
map.

*Item filter dialog.*
**Field**
Select the field on which the filtering is based.
**Values**
Select values which are included in the resulting items.
The above selection means that items, whose field name SOVEREIGNT contains value ”Canada”, are included in the resulting map.
#### Importing and replacing map layers
User can import new layers to the map and replace existing layers. There are four methods for importing and replacing a layer in the map from Maps interface. This is very useful when retrieving frequently updated shp data while the software application is running.
***ImportNewLayer*** methods inserts a new map layer to given layer index and ***ImportReplaceLayer*** methods replaces the map layer at the given layer index.
```csharp
public MapConverter.ConversionResult ImportNewLayer(String shpFilename, int targetLayerIndex)
```
where *shpFilename* is the name of the source shp file name and *targetLayerIndex* is the index of the new layer. This method uses dialogs presented above for setting up map configuration.
```csharp
public MapConverter.ConversionResult ImportNewLayer(String shpFilename, int targetLayerIndex, String configFile)
```
where *shpFilename* is the name of the source shp file name, *targetLayerIndex* is the index of the new layer and *configFile* is map configuration file name. This method uses configuration file created with dialogs presented above.
```csharp
public MapConverter.ConversionResult ImportReplaceLayer(String shpFilename, int targetLayerIndex)
```
where *shpFilename* is the name of the source shp file name and *targetLayerIndex* is the index of the new layer. This method uses dialogs presented above for setting up map configuration.
```csharp
public MapConverter.ConversionResult ImportReplaceLayer(String shpFilename, int targetLayerIndex, String configFile)
```
where *shpFilename* is the name of the source shp file name, *targetLayerIndex* is the index of the new layer and *configFile* is map configuration file name. This method uses configuration file created with dialogs presented above.
Configuration file is a plain xml file, which can be edited with a text editor, though editing is not recommended.
### Tile maps
LightningChart has support for the following on-line tile data services:
- HERE: Street maps, Satellite imagery, Street night, Terrain Day and Terrain night. (Note, that night and terrain maps supported from v12.2 onwards)
#### LayerType
LightningChart supports tile data service by HERE.
:::tip[NOTE !]
Developer or end user must make an own contract with HERE to be able to use the HERE servers (free plan is also available). User needs to make own **HERE API-Key** in order for LightningChart tile-map feature will work. User can get one by following [Readme document on HERE website](https://www.here.com/docs/bundle/identity-and-access-management-developer-guide/page/topics/plat-using-apikeys.html).
:::
By setting ***TileLayer. Type*** property user can chose between Street, Satellite or Terrain (topographic) type of imagery/maps. Street and Terrain map can be in day or night mode.

*TileLayers[i].Type = TileLayer.LayerType.Satellite*

*TileLayers[i].Type = TileLayer.LayerType.Street*

*TileLayers[i].Type = TileLayer.LayerType.StreetNight*

*TileLayers[i].Type = TileLayer.LayerType.TerrainDay*

*TileLayers[i].Type = TileLayer.LayerType.TerrainNight*
Presenting series and other chart elements, like annotations, is possible.

*Street maps with IntensityGridSeries presenting weather data*
#### TileLayer properties

*Properties of a TileLayer*
Add ***TileLayer*** object(s) in ***ViewXY. Maps. TileLayers*** collection. Several layers can be inserted and made semi-transparent with ***AlphaLevel*** property. The ***TileLayer*** objects are rendered in the order of appearance in the ***TileLayers*** collection, the first layer being in the background. By setting ***AboveVectorMap*** = *False*, the layer renders before the vector map, if such are defined (see [Vector maps](#Vector-maps)). By default, the ***TileLayer*** renders after the vector maps.
***TileLayer*** gets information as small images (i.e. tiles) from on-line service provider through http protocol and shows them in the chart area. The images are refreshed when zooming or panning the map view.
Loading a new set of tiles will take some time, up to several seconds.
#### Size and PPI
In LightningChart version 12.3.1 HERE map rendering services upgraded to use higher quality tile-images as default. In that library version also ***Size*** nad ***PPI*** properties are added to ***TileLayer***. ***Size*** allows to select image size to be 256 or 512 (default). ***PPI*** property controls tile's PPI parameter to render labels and icons in different sizes. Available options are 100, 200 (default) or 400.
#### Tile cache
The chart stores the tiles into a cache folder, which greatly reduces the loading time when panning or zooming frequently in the same region. When the chart needs to show a tile, it first checks if it can be found in the cache folder, and if not, retrieves it from the web service. In a team use, where many workstations need to access the tile maps, it is wise to select a shared local network server folder. By default, the cache folder is **c:\Users\[Current user]\AppData\Local\Temp**.
Set the cache folder in ***ViewXY.Maps.TileCacheFolder*** property.
Clear the cache folder by calling ***ViewXY.Maps.ClearTileCacheFolder()*** method.
:::info
To see feature demonstration as example, check *HERE Maps streets*, *HERE Maps satellite* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Custom controls – Half Donut
***HalfDonut***, also known as half pie or semi circle, is a custom polar chart, which has been pre-configured to a half donut shape. Although a regular polar chart could be used to create similar half donut charts, using this custom control significantly reduces the steps user needs to do when implementing these charts.

*Half donut example.*
### Construction and adding
***HalfDonut*** can be added to an application the same way as ***LightningChart*** objects. First create a new ***HalfDonut*** object, then add it to a container element, *Grid* for instance. Configure the chart within ***BeginUpdate()*** and ***EndUpdate()*** calls to reduce the number of frames needed to be rendered.
```csharp
HalfDonut donut = new HalfDonut();
(Content as Grid).Children.Add(donut);
donut.BeginUpdate();
// Configure half donut chart here
donut.EndUpdate();
```
### Adding/removing data
Data can be added to a ***HalfDonut*** by calling ***AddSlice()*** -method.
```csharp
// Adding a slice to a donut.
donut.AddSlice(100, "Electricity", Colors.Yellow);
```
Individual slices can be removed via ***RemoveSlice()*** -method.
```csharp
// Removing a slice at index 1.
donut.RemoveSlice(1);
```
Alternatively, use ***HideSlice()*** to hide and show the slices.
```csharp
// Hiding the first slice.
donut.HideSlice(0, false);
// Showing the first slice.
donut.HideSlice(0, true);
```
### Configuring Half Donut charts
***HalfDonut*** charts have several configure options. Texts, start and end angles, as well as colorings can be fully modified. The needle and the marker line can also be adjusted or hidden.
```csharp
// Modifying texts
donut.Title = "Chart title";
// Using custom texts
donut.EndAndStartPointText = HalfDonut.EndAndStartPointTexts.Custom;
donut.CustomLeftSideText = "New text string";
donut.CustomNeedleText = "Needle text";
// Disable needle
donut.ShowNeedle = true;
```
Color palette is controlled by ***SelectedColorPalette*** property. There are three coloring scales available for donuts: *HSV*, *HSVA* and *Slice*. When using *HSV* or *HSVA* colorings, adjust the individual channels, then use ***ColorStep*** to modify the color differences between the slices.
```csharp
// Setting colors.
donut.SelectedColorPalette = HalfDonut.ColorScale.HSVA;
donut.ColorStep = 5;
donut.Saturation = 0.9;
donut.StartingColorValue = 30;
donut.Value = 0.6;
donut.Alpha = 0.4;
```
When ***SelectedColorPalette*** is set to *Slice*, colors are assigned when the slices are added via **AddSlice()**, apply.
***GetInternalChart()*** method can be used to access the internal LightningChart component. This is useful when the donut chart’s own properties are not comprehensive enough.
```csharp
// Modifying the legend box.
donut.GetInternalChart().ViewPolar.LegendBox.Fill.Color = Colors.SkyBlue;
```
Alternatively, use various Get -methods, which allow accessing and modifying the internal ***LightningChart*** components, such as [Annotations](/docs/inDetail/annotation-polar.md), directly.
```csharp
// Changing the internal annotation object.
donut.GetLeftSideText().TextStyle.Color = Colors.LimeGreen;
```
### HalfDonutControlPanel
***HalfDonutControlPanel*** is a UI-element designed to modify ***HalfDonut*** properties while application is running. Adding the control panel to an application works similarly to adding a ***HalfDonut*** chart. Create a new ***HalfDonutControlPanel*** object and add it to a UI-container. After that, it is possible to add one or more ***HalfDonut*** objects to the control panel. The panel can then be used to modify the added donut charts.
```csharp
// Creating a HalfDonutControlPanel
HalfDonutControlPanel cp = new HalfDonutControlPanel();
// Adding to a grid element
_controlGrid.Children.Add(cp);
// Add an existing half donut object.
cp.HalfDonuts.Add(donut);
```

*HalfDonutControlPanel, dark theme has been selected.*
### Examples
:::info
To see feature demonstration as example, check *HalfDonut* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Headless mode
Headless mode is a software capability of working on a device without access to Graphical User Interface (GUI). The term "headless" is also used when software does not require the presence of peripheral devices (like display, keyboard, mouse) or access to them. The absence of peripherals does not cause the failure of initialization or execution processes. However, in this case the software may receive inputs and provide output via other communication interfaces, for example via network or a serial port.
### Headless Rendering
Headless configuration allows running LightningChart in a headless/server environment. Expected scenarios include background rendering in software applications without User Interface (UI) and generation of a bitmap image from the chart content. The image then can be passed to the headful system for further rendering.
Basic usage:
```csharp
var chart = new LightningChart(new RenderingSettings()
{
HeadlessMode = true
});
```
Headless mode can be activated by setting ***HeadlessMode*** flag to *true*. The property can be accessed via [render-options](/docs/beginners%20guide/chart-render-options.md): ***chart. ChartRenderOptions*** (for WPF) or ***chart. RenderOptions*** (for WinForms). LightningChart automatically detects its usage in the Windows Service type application, thus there is no need to specify the mode.
#### Additional initialization options
The initialized instance of LightningChart with a missing UI and visual parent will not receive any rendering requests, like sizing the layout or when to render a frame. Furthermore, WPF chart uses these signals to initialize a rendering engine when WinForms does engine initialization during the creation time. Thus, the following operations and configurations must be applied to the chart by the user:
- Define size using ***chart.Width*** and ***chart.Height*** properties.
- Request rendering engine initialization by calling ***chart.InitializeRenderingDevice(true)*** (only for WPF).
- Subscribe to ***chart.AfterRendering*** event for implementing the logic of exporting the images.
The chart still reacts to property changes. The rendering of a new frame can be queried by consecutive ***BeginUpdate()*** and ***EndUpdate()*** call, if it is needed.
Below is the example of code excerpt for headless mode:
```csharp
private LightningChart _chart = null;
private void CreateChart()
{
_chart = new LightningChart(new RenderingSettings() { HeadlessMode = true });
_chart.BeginUpdate();
_chart.InitializeRenderingDevice();
_chart.Width = 600;
_chart.Height = 500;
_chart.ViewXY.XAxes[0].ValueType = AxisValueType.Number;
_chart.ViewXY.XAxes[0].SetRange(0, 10);
PointLineSeries lineSeries = new PointLineSeries(_chart.ViewXY, _chart.ViewXY.XAxes[0], _chart.ViewXY.YAxes[0]);
_chart.ViewXY.PointLineSeries.Add(lineSeries);
_chart.AfterRendering += _chart_AfterRendering;
_chart.EndUpdate();
}
int count = 0;
private void _chart_AfterRendering(object sender, AfterRenderingEventArgs e)
{
_chart.CopyToClipboard();
// OR
bool bSaved = _chart.SaveToFile(Directory.GetCurrentDirectory() + "\\" + (count++).ToString() +".png");
}
```
#### Capturing images
The rendered frame can be exported (see [Export and printing](/docs/inDetail/export-printing.md)) in various ways:
- ***OutputStream*** property
- ***SaveToStream*** method
- ***CopyToClipboard*** method
- ***CaptureToByArray*** method
- ***SaveToFile*** method
In general, bitmap stream is preferred. Also, ViewXY chart supports EMF, SVG in headless mode in ***SaveToStream*** and ***SaveToFile*** methods.

*Diagram of example usages.*
### Limitations and Requirements
#### Threads
Headless configuration allows using LightningChart for a background work without placing it inside a visual parent and without access to the chart from the foreground thread (GUI thread). During the creation of the LightningChart instance, the properties of a chart must be updated within the same thread that has created the chart.
- The COM threading model, called **“apartment”**, must be STA (Single Thread Apartment), not MTA (Multi Thread Apartment). For an ordinary UI application, STA is the default model, whereas MTA state is default for Windows Services.
- All access, i.e. update, creation and disposing, must be made via chart's thread. UI must be touched only from GUI thread. Thus, if there are interaction operations required, they should be moved from chart’s thread to GUI thread. **Note!** LightningChart can be run on GUI thread.
- The thread must have a valid and active message queue pump. For example, run ***Application.Run*** on the thread.
#### Chart Update
LightningChart uses a single buffer on rendering, thus exporting of a new image will be handled after the exporting of the previous image is finished. The synchronous configuration (***ChartUpdateType.Sync***) provides a rendering of an image straight after receiving a request to update the properties of a chart. Sync mode should be enabled for the headless mode to enable faster and uninterrupted performance.
#### Engine support
Both DirectX 9 & 11 engines work in headless mode. However, only DirectX 11 can be used in Windows Services type applications due to the limitations of MS DirectX.
#### Licensing
By default, Windows Service executes in the security context of a system user account. **Installation of a trial and development license is impossible**. For this reason, the service application must contain a valid Deployment Key or be running with credentials of a normal user with an active license (trial / development).
### Example solution
LightningChart SDK comes with an example Visual Studio solution (DemoService.sln) containing:
- Service
- Console application
- Client application for WPF
DemoService.sln can be found in **C:\ProgramData\LightningChart\LightningChart .NET SDK v.12\DemoService** folder.
When starting up the WPF client, it shows a frame container in the middle of the window.

*WPF client app. After Start, Connect and Generate Data, it shows continuously updating image stream.*

*Headless demo service – client internal operation of messages with named pipes and background thread illustrated.*
---
## HighLowSeries
High-low series presents data as filled area between high and low values. This belong to the group of line-series. See more [Line-series comparison](/docs/inDetail/comparing-line-series.md).
Add the series to chart by adding ***HighLowSeries*** objects into ***HighLowSeries*** list.
```csharp
//Add high-low series to the chart
chart.ViewXY.HighLowSeries.Add(highlowSeries);
```

*A high-low series with a marker over it.*
### Line style
Series support [LineStyle](/docs/inDetail/line-style.md). However, with small difference because ***HighLowSeries*** has two lines. Therefore, define the line style with ***LineStyleHigh*** and ***LineStyleLow*** properties. If the lines should not be visible, set ***LineVisibleHigh*** = false, and ***LineVisibleLow*** = false, respectively.
### Points style
Series support [PointStyle](/docs/inDetail/points-style.md), but same extension. Define the point style with ***PointStyleHigh*** and ***PointStyleLow*** properties. If the points should not be shown, set ***PointsVisibleHigh*** = false, ***PointsVisibleLow*** = false.
### Fill style
The fill can be set with ***Fill*** property and its sub-properties. When the high value of the data is less than its Low value, reverse fill is applied in that part. Edit the reversed fill with ***ReverseFill*** property.

*Fourth data item is given reversed: high value is < low value.*
### Limits
By enabling ***UseLimits***, series shows different solid coloring above the exceed limit and below deceed limit. Values and colors are controlled by ***ExceedLimit***, ***DeceedLimit***, ***ExceedColor***, ***DeceedColor*** respectively. The regular ***Fill*** and ***ReverseFill*** apply then only for the range between the limits.

*UseLimits = true, ExceedLimit = 48000 and DeceedLimit = 28000.*
### Y-value based Fill coloring by value-range palette
By enabling ***UsePalette***, the fill uses ***ValueRangePalette*** steps. *Uniform* and *Gradient* coloring are both supported. In many aspects it is similar to [Y-value based Line coloring](/docs/inDetail/advanced-line-coloring.md).

*UsePalette = True, several steps defined in ValueRangePalette. Uniform coloring.*
### Adding data
The data values must be added in code. The data must be given in ascending order by X values, i.e.
**Points[i+1].X ≥ Points[i].X**.
Use ***AddValues***(*HighLowSeriesPoint[], bool invalidate*) method to add data values to the end of existing values array.
```csharp
HighLowSeriesPoint[]dataArray = new HighLowSeriesPoint[6];
dataArray [0] = new HighLowSeriesPoint(2004, 37000, 22000);
dataArray [1] = new HighLowSeriesPoint(2005, 35000, 27000);
dataArray [2] = new HighLowSeriesPoint(2006, 47000, 25000);
dataArray [3] = new HighLowSeriesPoint(2007, 37000, 49000);
dataArray [4] = new HighLowSeriesPoint(2008, 40000, 50000);
dataArray [5] = new HighLowSeriesPoint(2009, 56000, 56000);
//Add data to the end
chart.ViewXY.HighLowSeries[0].AddValues(dataArray, true);
```
To set whole series data at once while overwriting old data, assign the new data array directly:
```csharp
//Assign the data into points array
chart.ViewXY.HighLowSeries[0].Points = dataArray;
```
### SeriesEventMarker
Series support [SeriesEventMarker](/docs/inDetail/event-markers-XY.md).
### DataBreaking
Series support [DataBreaking by NaN or other value](/docs/inDetail/data-breaking.md).
### ClipAreas
Series support [ClipAreas](/docs/inDetail/ClipAreas.md).
### LineSeriesCursors
Series can be tracked with [LineSeriesCursors](/docs/inDetail/LineSeriesCursor.md).
### DataCursor
Series can be tracked with [DataCursor](/docs/inDetail/data-cursors.md).
### LimitYToStackSegment
Series support [LimitYToStackSegment](/docs/inDetail/limit-y-value.md).
### Rendering data into the Persistent-Rendering-Layer
Series data can be added to either [PersistentSeriesRenderingLayer](/docs/inDetail/persistent-layer.md) or [PersistentSeriesRenderingIntensityLayer](/docs/inDetail/persistent-intensity-layer.md).
### Examples
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures*, *StackedArea*, *TradingMultiSegment* and *PersistentRenderingHighLow* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## ImageLayer
***ImageLayer*** is a very large image layer, which can be gradually filled with smaller images. The accumulation of smaller images is done in the background thread, thus keeping Chart UI thread responsive and fast (for example zooming could be done while images are loaded). While compounding ***ImageLayer*** from many smaller bitmaps requires a lot of memory, the chart itself remains very interactive & fast (during and after layer is loaded). On top of ***ImageLayer*** all ViewXY series can be rendered. It is possible to create multiple ***ImageLayers*** and each layer's visibility can be switched on/off independently. On top of main layers, several sublayers of images could be created, each of them reduces pixel count approximately by factor 4. This allows fast interaction in application with all zoom levels (works similarly as tiles of geographical maps).
For the best performance and the least memory usage it is recommended to supply images to ***ImageLayer*** in Indexed8 color space format. Otherwise internally images will be converted to 32bit RGBA format (which requires ~3 time as much memory).

*Example of 2 ImageLayers, where first one is compound from 1024 smaller images*
Note, before version 12.4 ***ImageLayer*** did not support reversed Axes.
### Sublayers
Once all source images are added to the layer (indicated by ***layer.EndAddingImages()*** method call), the sublayers could be created. Each sublayer represents zoom-level, with constant reduction of pixel count in layer (approximate reduction factor is 4). Method’s ***EndAddingImages()*** input arguments defines how many sublayers/zoom-levels should be created. When complete layers is visible, the sublayer with lowest amount of details is shown. This allows fast interaction with Chart (e.g. panning) while giving a good overview of ***ImageLayer***. When the user zooms in, more detailed sublayers are shown until main (0 level) is reached.
:::tip[NOTE]
Sublayers are created by merging sets of original images into new image. Sublayer is created, if there are at least 7 images in single row (therefore it maybe less sublayers than user requested). First sublayer merges 2x2 set of original images, second sublayer merges 4x4 original images and so forth.
In case images are sparsely distributes (i.e. not covering whole area) 'new' pixel rendered with base color (as set by method ***EndAddingImages***(int *subLayerCount*, int *baseColorIndex* = 0)) for Indexed8 color space format or as transparent color for full color image.
:::
### Applicability
This feature will be handy in Semiconductor industry, where optical measuring systems are used for surface analysis. The surface in question could be silicon wafers, micro-electromechanical systems (MEMS) or similar.
However, the use of LightningChart’ s ***ImageLayer*** feature is not limited to Semiconductor industry. Any application which requires a display of a very large image and needs fast zooming, could use this feature. If there is information about each sub-image position and size (in XY axes units), users can create a collage of any size.
:::info
To see feature demonstration as example, check *ExampleImageLayer* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Heatmap/ IntensityGrid Polar
***IntensityGridSeriesPolar*** is like intensity grid series in XY chart. IntensityGrid allows visualizing M x N array of nodes, colored by assigned value-range palette. The colors between the nodes are interpolated. ***IntensityGridSeriesPolar*** is evenly spaced in Polar space. The data is stored in ***Data*** property as two-dimensional array of doubles [*Angle, Amplitud*e]. ***MinimumAmplitude*** and ***MaximumAmplitude*** properties define the amplitude range where the grid should be fitted, while ***BeginAngle*** and ***EndAngle*** properties set range for the angles. For streaming/real-time application users should use ***Series.UpdateData()*** method.

*Example IntensityGridSeriesPolar/ ExampleHeatMapPolar*
:::info
To see feature demonstration as example, check *ExampleHeatMapPolar* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## IntensityGridSeries
## IntensityGridSeries (heatmap)
***IntensityGridSeries*** allows visualizing M x N array of nodes, colored by assigned value-range palette. The colors between nodes are interpolated. ***IntensityGridSeries*** is an evenly spaced, rectangular series in X and Y dimension. This series allows rendering contour lines, contour line labels, and wireframe as well.
:::info
To see feature demonstration as example, check *Heat map*, *Spectrogram*, *Intensity grid mouse control* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::

*IntensityGridSeries properties.*
The data is stored in ***Data*** property as two-dimensional array. Each array item is of type *IntensityPoint*. Store the data value of each node in ***Value*** field of *IntensityPoint* structure, which tells what color should be used from the ***ValueRangePalette***.

*IntensityGrid series showing a heat map presentation. Legend box shows the value-range color palette.*
### Setting intensity grid data

*IntensityGridSeries nodes. SizeX = 5, SizeY = 7.*
Node distances are automatically calculated as

- Set X range by using ***RangeMinX*** and ***RangeMaxX*** properties, to order the minimum and maximum value of assigned X axis.
- Set Y range by using ***RangeMinY*** and ***RangeMaxY*** properties, to order the minimum and maximum value of assigned Y axis.
- Set ***SizeX*** and ***SizeY*** properties to give the grid a size as columns and rows.
- Set ***Value*** for each node:
```csharp
// Method, with Data array index
for (int nodeIndexX = 0; nodeIndexX < columnCount; nodeIndexX ++)
{
for (int nodeIndexY = 0; nodeIndexY < rowCount; nodeIndexY ++)
{
intensityValue =//some height value.
gridSeries.Data[iNodeX, iNodeY].Value = intensityValue;
}
}
gridSeries.InvalidateData(); //Notify new values are ready and to refresh
```
```csharp
// Alternative method, usage of SetDataValue
for (int nodeIndexX = 0; nodeIndexX < columnCount; nodeIndexX ++)
{
for (int nodeIndexY = 0; nodeIndexY < rowCount; nodeIndexY ++)
{
intensityValue =//some height value
gridSeries.SetDataValue(nodeIndexX, nodeIndexY,
0, //X value ís irrelevant in grid
0, //Y value is irrelevant in grid
intensityValue,
Color.Green); //Source point colors are not used in this example, so use any color here
}
}
gridSeries.InvalidateData(); //Notify new values are ready and to refresh
```
#### Setting Values only to existing grid
When the geometry of IntensityMesh, or ***SizeX*** or ***SizeY*** for IntensityGrid series doesn’t change while data is changing rapidly, it is most advantageous to use ***SetValuesData*** method. Since it accepts Double[][] format data array, scrolling or re-ordering rows or columns is quick. Especially when combined with ***PixelRendering*** property (see [here](#Rendering-as-pixel-map)), it is a very effective approach for high-resolution scrolling spectrogram visualization. Note that when ***PixelRendering*** is disabled with external data array set by ***SetValuesData***, ***Data*** property can’t be null.
#### Setting Colors only to existing grid
When the geometry of IntensityMesh, or SizeX or SizeY for IntensityGrid series doesn’t change while data is changing rapidly, it is most advantageous to use ***SetColorsData*** method. It accepts int[][] format values, i.e. ARGB values that GPU accepts directly. With this kind of data array, scrolling or re-ordering rows or columns is quick. Especially when combined with ***PixelRendering*** property (see [here](#Rendering-as-pixel-map)), it is a very effective approach for high-resolution scrolling spectrogram visualization. Note that when ***PixelRendering*** is disabled with external data array set by ***SetColorsData***, ***Data*** property can’t be null.
### Creating intensity grid data from bitmap file
Create a surface from a bitmap image. Use ***SetHeightDataFromBitmap*** method to achieve this. The series ***Data*** array property gets the size of the bitmap size (if no anti-aliasing or resampling is used). For each bitmap image pixel, Red, Green and Blue values are summed. The greater the sum, the greater will be the data value for that node. Black and dark colors get lower values and bright and white colors get higher values.

*Source bitmap and calculated intensity values data. Dark values stay low and bright values get higher values.*
:::info
To see feature demonstration as example, check *Heat map*, *Spectrogram*, *Intensity grid mouse control* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### Fill styles
Use ***Fill*** property to select the filling style. The following options are available:
None
By using this, no filling is applied. This is the selection to use with wireframe mesh or plain contour lines.
FromSurfacePoints
The colors (*Color* field) of the ***Data*** property nodes are used.
Toned
***ToneColor*** property is applied
Paletted
See [ValueRangePalette](#ValueRangePalette).
Enable ***FullInterpolation*** property to use enhanced interpolation method in the fill. Note that it will cause more CPU and GPU usage. By using full interpolation, the fill quality is better, but can be seen only when the data array size is quite small.
### Rendering as pixel map
By enabling ***PixelRendering*** property, the nodes are rendered as pixels, or rectangles. This is a very high-performance rendering style e.g. for real-time high-resolution thermal imaging applications. Note that when this rendering mode is selected, many other options are disabled, such as contour lines, wireframe and interpolation. If logarithmic axes are used, the logarithmic transformation is only applied to corners of the series, the pixels in the bitmap remain evenly spaced and no logarithmic transformation is applied to them.

*PixelRendering = true.*
:::tip
***PixelRendering*** relies on DirectX texture. In DirextX11 maximum size of X or Y is [16384](https://learn.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-resources-limits#resource-limits-for-feature-level-11-hardware). In DirectX 9 dimensions is twice smaller.
If grid is bigger than DirectX texture, then user needs splitting into smaller grids instead (each occupying particular xy-range). However, it maybe just easier to go for [ImageLayer](image-layer.md) approach.
:::
### ValueRangePalette
With ***ValueRangePalette*** property, define color steps for value coloring. ***ValueRangePalette*** can be used for:
- ***Fill*** (see [Fill styles](#Fill-styles))
- ***Wireframe*** (see [Wireframe](#Wireframe))
- Contour lines (see [Contour lines](#Contour-lines))
:::tip
**Define several steps for contour palette.** Each step has a height value and the corresponding color.
From v12.1.1 user can have hundreds of steps in palette without performance penalty.
However, note that to create smooth palette (color-bar) user don't need to use hundreds of steps. Instead, user can use PaletteType.Gradient with only few colors, which will do color interpolation in between (see image on the left).
:::

*On the left, IntensityGridSeries Fill is set to Paletted and Palette Type is set to Gradient. On the right, Palette Type is set to Uniform.*
The palette is defined with ***MinValue***, ***Type*** and ***Steps*** properties. For ***Type***, there are two choices: *Uniform* and *Gradient*. The contour palettes (check the legend boxes) of the previous figures show:
- ***MinValue***: -50
- ***Type***: Uniform
- ***Steps***:
- Steps[0]: MaxValue: -10, Color: Blue
- Steps[1]: MaxValue: 10, Color: Teal
- Steps[2]: MaxValue: 25, Color: Green
- Steps[3]: MaxValue: 35, Color: Yellow
- Steps[4]: MaxValue: 60, Color: Red
- Steps[5]: MaxValue: 100, Color: White
#### MinValue
***MinValue*** is always lowest palette value. If any of Step ***MaxValue*** is below it, step will be skipped. The values below the first step value (i.e. towards ***MinValue***) are colored with the first step’s color. While ColorBar always includes min-value, the label for it can be disabled with ***ValueRangePalette. ShowMinValueLegendLabel*** property.
#### Customization of labels for PaletteStep
On default, MaxValue of each step is converted to string according to format set by ***intensitySeries. LegendBoxValuesFormat*** property (default "0.0"). Labels are shown in LegendBox, if there is enough space to show them without overlap (overwise some labels are skipped).
However, it is possible to replace / customize the palette-step label completely. To do that user needs to subscribe to ***palette. FormatStepValueText*** event. In the event handler user just replaces step's value with any string. For example,
```csharp
palette.FormatStepValueText += Palette_FormatStepValueText;
private string Palette_FormatStepValueText(object sender, double step)
{
if (step >= 100.0)
{
return "\u221E"; // 'INFINITY'
}
else
{
return string.Format("t={0:0.00}", step);
}
}
```

*ValueRangePalette is customized with FormatStepValueText event handler.*
In version 12.4, a new property is added for PaletteStep. ***CustomLegendLabelText*** defines Custom Label-text for palette step label. If it is not Null (default), then it will be used next to LegendBox color-bar (instead of *Step.MaxValue*). If user don't want to show particular value, then empty-string can be used for ***CustomLegendLabelText*** or ***ShowLegendLabel*** property can be disabled. For example,
```csharp
// create Custom Labeltext for palette step labels
PaletteStepList steps = _intensityGrid.ValueRangePalette.Steps;
for (int i=0; i < steps.Count; i++)
{
steps[i].CustomLegendLabelText = "Custom " + i.ToString();
}
```

*ValueRangePalette is customized with CustomLegendLabelText property.*
#### Modifying distance between palette labels
In version 12.4, a new property is added for ***ValueRangePalette***, ***LabelShowModeInLegend***.
***LabelShowModeInLegend*** controls how labels are spaced next to the color-bar in the LegendBox (as well as extend of step's color). There are 3 options:
- *ValueDepended*, previously (and the current default behavior) palette-step labels were positioned in a linear manner (based on value's relative distance between palette's maximum and minimum).
- *ValueDependedLogarithmical*, allows to position labels on logarithmic scale (for example, labels for palette steps 1, 10 and 100 will be equidistantly positioned).
- *EquidistantAllocation*, which draws palette-steps' labels at equal distance from each other regardless of actual value.

*From left to right ***ValueRangePalette. LabelShowModeInLegend*** options: ValueDepended, ValueDependedLogarithmical and EquidistantAllocation.*
:::tip[Note]
***palette. MinValue*** will also be used as label in LegendBox, if ***palette. ShowMinValueLegendLabel*** property is enabled.
:::
***ValueRangePalette*** is used by [ViewXY 'intensity' series](/docs/inDetail/IntensityGridSeries.md), by [View3D 'surface' series](/docs/tutorials/surface-grid.md) and by [ViewPolar 'heatmap'](/docs/inDetail/intensity-grid-polar.md).
### Wireframe
Use ***WireframeType*** to select the wireframe style. The options are:
None
no wireframe
Wireframe
a solid color wireframe. Use ***WireframeLineStyle.Color*** to set the color
WireframePaletted
the wireframe coloring follows ***ValueRangePalette*** (see [ValueRangePalette](#ValueRangePalette))
WireframeSourcePointColored
the wireframe coloring follows the color of grid nodes (*Color* field)
Dots
solid color dots are drawn in the grid node positions
DotsPaletted
dots are drawn in the grid node positions and colored by ***ValueRangePalette***
DotsSourcePointColored
dots are drawn in the grid node positions, coloring follows the color of grid nodes (*Color* field)
The wireframe line style (color, width, pattern) can be edited by using ***WireframeLineStyle***.
:::tip
Note! Palette colored wireframe lines and dots are available only when ***WireframeLineStyle.Width*** = 1 and ***WireframeLineStyle.Pattern*** = Solid.
:::
### Contour lines
:::info
To see feature demonstration as example, check *Heatmap color spread*, *Contours with labels* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
Contour lines can be used with fill and wireframe properties. By setting ***ContourLineType*** property, contour lines can be drawn with different styles:
None
no contour lines are shown
FastColorZones
The lines are drawn as thin zones on palette step end. Allows very powerful rendering, which suits very well for continuously updated or animated surface. Steep value changes are shown as thin line, while gently sloping height differences are shown with thick zone. Each line uses the same color defined with ***ContourLineStyle.Color*** property. The zone width can be set by ***FastContourZoneRange*** property. The value is in Y axis range.
FastPalettedZones
Like *FastColorZones*, but line coloring follows ***ValueRangePalette*** options (see [ValueRangePalette](#ValueRangePalette)).
ColorLine
Like *FastColorZones*, but the contour lines are actual lines. Rendering takes longer and is not recommended for continuously updated or animated surface. The line width can be adjusted with ***ContourLineStyle.Width*** property.
PalettedLine
Like ColorLine, but line coloring follows ValueRangePalette options.

*On the top-left, ContourLineType = FastColorZones. On the top-right, ContourLineType = FastPalettedZones. On the bottom -left, ContourLineType = ColorLine. On the bottom-right, ContourLineType = PalettedLine.*
### Contour line labels
When contour lines are visible, numeric values can be shown within the line paths (***ContourLineLabels*** properties).
Use ***LabelsNumberFormat*** for custom string formatting, for example setting the number of decimals.

*The properties of ContourLineLabels and the result.*
### StencilAreas
[***StencilArea***](/docs/inDetail/stencil-area.md) feature allows masking in or out areas of drawn data. ***StencilArea*** can be applied by creating a new ***StencilArea*** object, then defining its size as PointDouble2D -array via ***AddPolygon()*** and finally adding them to the series that should be masked.
There are two types of StencilAreas:
- ***AdditiveAreas*** creates a positive stencil mask - only data inside the area is drawn, while the outside is clipped.
- ***SubtractiveAreas*** creates a negative stencil mask - data inside the area is clipped, while the outside is drawn.

*An IntensityGrid without any stencils on the top. On the bottom, the same grid with an AdditiveArea.*
### ClipAreas
Series support [ClipAreas](/docs/inDetail/ClipAreas.md).
### DataCursor
Series can be tracked with [DataCursor](/docs/inDetail/data-cursors.md).
### LimitYToStackSegment
Series support [LimitYToStackSegment](/docs/inDetail/limit-y-value.md).
---
## IntensityMeshSeries
## IntensityMeshSeries (heatmap)
***IntensityMeshSeries*** is almost similar to [IntensityGridSeries](/docs/inDetail/IntensityGridSeries.md). The biggest difference is that series nodes can be positioned arbitrarily in X-Y space. In other words, the series does not have to be rectangular. Wireframe lines can be set visible with ***WireframeType*** property, and nodes can be shown by setting ***ShowNodes*** true.

*IntensityMeshSeries with freely positioned X and Y values for each node. WireframeType = Wireframe and ShowNodes = true.*

*Intensity mesh nodes. SizeX = 4, SizeY =4.*
### Setting intensity mesh data when geometry changes
Follow these instructions, when the X, Y and Value fields are updated the same time.
- Set SizeX and SizeY properties to give the mesh a size as columns and rows.
- Set X, Y and Value for all nodes:
Method, with Data array index
```csharp
for (int nodeIndexX = 0; nodeIndexX < columnCount; nodeIndexX ++)
{
for (int nodeIndexY = 0; nodeIndexY < rowCount; nodeIndexY ++)
{
meshSeries.Data[nodeIndexX, nodeIndexY].X = xValue;
meshSeries.Data[nodeIndexX, nodeIndexY].Y = yValue;
meshSeries.Data[nodeIndexX, nodeIndexY].Value = value;
}
}
meshSeries.InvalidateData(); //Notify new values are ready to refresh
```
Alternative method, usage of SetDataValue
```csharp
for (int nodeIndexX = 0; nodeIndexX < columnCount; nodeIndexX ++)
{
for (int nodeIndexY = 0; nodeIndexY < rowCount; nodeIndexY ++)
{
meshSeries.SetDataValue(nodeIndexX, nodeIndexY,
xValue, yValue, value,
Color.Green); //Source point colors are not used in this example, so use any color here
}
}
meshSeries.InvalidateData(); //Notify new values are ready to refresh
```
### Setting intensity mesh data when geometry does not change
Follow these instructions, when only the ***Value*** fields of ***IntensityPoint*** structures in ***Data*** array are updated. This is the performance optimized way for updating data, for example in thermal imaging or environmental data monitoring solutions, where X and Y values of each node stay at the same location.
#### Creating the series and its geometry
- Set ***Optimization*** to *DynamicValuesData*
- Set ***SizeX*** and ***SizeY*** properties to give the mesh a size as columns and rows.
- Set *X*, *Y* and *Value* for all nodes:
```csharp
for (int nodeIndexX = 0; nodeIndexX < columnCount; nodeIndexX ++)
{
for (int nodeIndexY = 0; nodeIndexY < rowCount; nodeIndexY ++)
{
meshSeries.Data[nodeIndexX, nodeIndexY].X = xValue;
meshSeries.Data[nodeIndexX, nodeIndexY].Y = yValue;
meshSeries.Data[nodeIndexX, nodeIndexY].Value = value;
}
}
meshSeries.InvalidateData(); //Rebuild geometry from nodes and repaint
```
#### Updating the values periodically
- Set only values for all nodes:
```csharp
for (int nodeIndexX = 0; nodeIndexX < columnCount; nodeIndexX ++)
{
for (int nodeIndexY = 0; nodeIndexY < rowCount; nodeIndexY ++)
{
meshSeries.Data[nodeIndexX, nodeIndexY].Value = value;
}
}
meshSeries.InvalidateValuesDataOnly(); //Only data values are updated
```
### Examples
:::info
To see feature demonstration as example, check *IntensityMeshXY*, *IntensityMeshStaticPositions*, *IntensityMeshCircle* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## LegendBoxXY properties
Starting from v.8, ViewXY supports multiple legend boxes in the same graph. Insert these legend boxes in ***ViewXY.LegendBoxes*** collection.

*Extensive LegendBoxXY property tree.*
### Hiding / showing a series from legend box
Legend box shows series titles and icons. Hide a series by deselecting the series checkbox.

### Showing series in the legend box
By default, all series are shown in the legend box. If a specific series should not be listed, set ***series. ShowInLegendBox*** = False, for that series.
If multiple legend boxes are used, use ***series. LegendBoxIndex*** to select the preferred legend box. Series can appear only in one legend box. Default index is 0 for all series, meaning they will all appear in the same legend box unless stated otherwise.
In addition, version 12.4 adds ***LegendBoxOrderIndex*** property to various chart series to control their order in LegendBox. ***LegendBoxOrderIndex*** property was added to all XY series, 3D series, Polar series, Polar Sector, and Smith LineSeries. Titles in LegendBox are sorted based on ***LegendBoxOrderIndex***. Therefore, legend order can be different from rendering order of series themselves. The default Value is -1, which keeps the title order in LegendBox same as series order in corresponding collection.
### Selecting in which graph segment to show a legend box
Use ***SegmentIndex*** to control in which segment to show the legend box. It applies only to *segment*-based ***Position*** options (for example *SegmentBottomRight*).
:::tip
Examples of usage (for multiple legend boxes) could be found in our Demo application (see [Learning from Demo](/docs/getting%20started/RunningDemo.md)): *Multiple legends; Heatmap with legends*.
:::
### Modifying check boxes
To show or hide the check boxes in the legend box, use ***ShowCheckBoxes*** property. ***CheckBoxColor*** and ***CheckMarkColor*** can be used to change the appearance of the check box while ***CheckBoxSize*** controls the size of the box in screen pixels.
```csharp
_chart.ViewXY.LegendBoxes[0].ShowCheckboxes = true;
_chart.ViewXY.LegendBoxes[0].CheckBoxColor = Colors.Green;
_chart.ViewXY.LegendBoxes[0].CheckMarkColor = Colors.Blue;
_chart.ViewXY.LegendBoxes[0].CheckBoxSize = 15;
```
In version 12.4 two new properties are added to control the styling of LegendBox checkboxes, in particular, ***CheckBoxBorderWidth*** and ***CheckMarkStyle***. ***CheckBoxBorderWidth*** allow changing checkbox border width to other than default 3 px. ***CheckMarkStyle*** has 3 options: *Normal* (old style), *Thin* (thinner check mark) and *XMark* ('X' mark).

*LegendBox's Checkboxes with different check-mark style and border.*
### LegendBox icons
Icon is drawn between checkbox and series title. It shows rudimentary representation of series drawing style. For example, for line-series a line and point-shape is shown, where line's color and width, and point's geometry and colors are displayed. Another example is ***PolygonSeries***, which icon displays ***Fill*** and ***Border*** colors.
From version 12.5, if [scale](#Modifying-intensity-series-palette-scales) is not shown for series (like XY *Intensity-Series* or 3D *Surface-Series*), then icon is shown instead (simple rectangle with color of middle step).
To hide the icons, set ***ShowIcons*** = False.
### Titles
If ***series. ShowInLegendBox*** property is enabled, then its title is shown in LegendBox. The color of title is set by ***legend. SeriesTitleColor*** (one for all titles).
Each title in LegendBox can have own color, when ***UseSeriesTitlesColors*** property is enabled. In that case ***series.Title.Color*** will be used to color legend's title.

*LegendBox. UseSeriesTitlesColors=True, Categorization='YAxes', Layout='HorizontalRowSpan'*
### Modifying intensity series palette scales
To hide the palette scale of an ***IntensityGrid*** or ***-Mesh***, set ***IntensityScales.Visible*** = False. To resize it, set ***ScaleSizeDim1*** and ***ScaleSizeDim2*** properties. The border of the scale as well as the position of the title can also be modified.


*LegendBox.IntensityScales.Visible = false in the bottom picture.*
The precision of Legendbox IntensityScale labels format is controlled by ***Series.LegendBoxValuesFormat*** property. Standard or custom .NET numeric format strings should be used.
```csharp
intensitySeries.LegendBoxValuesFormat = "0.00";
```
### Controlling positions
Legend boxes can be placed automatically or manually. Automatic placement allows them to be aligned to the left/top/right/bottom side of the graph segments, or on margins. Control the position with ***Position*** property. Position options are: *TopCenter*, *TopLeft*, *TopRight*, *LeftCenter*, *RightCenter*, *BottomLeft*, *BottomCenter*, *BottomRight*, *Manual*.
If the view is divided to several segments, legend boxes can be aligned based to the segment it belongs to (use [SegmentIndex](#Selecting-in-which-graph-segment-to-show-a-legend-box) to control this). For segment-based controlling there are the following options: *SegmentTopLeft*, *SegmentTopCenter*, *SegmentTopRight*, *SegmentBottomLeft*, *SegmentBottomCenter*, *SegmentBottomRight*, *SegmentLeftMarginCenter*, *SegmentRightMarginCenter*.
***Offset*** property shifts the position by given amount from the position determined by Position property.
```csharp
// Setting legend box position, offset shifts from RightCenter position
chart.ViewXY.LegendBoxes[0].Position = LegendBoxPositionXY.RightCenter;
chart.ViewXY.LegendBoxes[0].Offset = new PointIntXY(-15, -70);
```
*Manual* positioning calculates the offset from the top-left corner of the legend box to the view’s top-left corner. Note that this differs from *TopLeft* option, which is calculated from the top of the graph area.
:::info[Note]
When moving or resizing legend box, its ***Position*** is set to *Manual*, and ***Offset*** property is updated to reflect the new position.
Automatic legend box alignment is disabled until setting ***Position*** back to an option other than *‘Manual’*. Since Offset is not updated when switching between Position options, legend box may seem to disappear sometimes (it is located outside the view). Fix this by setting ***Offset*** back to 0, 0.
:::
### Controlling layout
Series titles' in Legend boxes can be arrange in several different way. It is controlled with ***Layout*** property. ***Layout*** options are: *Horizontal* (default), *HorizontalRowSpan*, *Vertical*, *VerticalColumnSpan*.
Then there are many items in LegendBox, its row or column can become to long not fit in the chart. In those cases with options *HorizontalRowSpan* and *VerticalColumnSpan* automatic wrapping of titles will be done. That is, titles will be written in new row or column respectively.
### Allocating space for legend boxes
***ViewXY.AutoSpaceLegendBoxes*** determines, if graph margins or space between Segments is automatically calculated due to LegendBoxes. If this property is enabled [GraphArea](/docs/beginners%20guide/definitions.md) will be reduce or Margins increase to accommodate LegendBox. Which margins is increased defined by [Position property](#Controlling-positions).

*Position = RightCenter. AutoSpaceLegendBoxes = True.*
When setting ***ViewXY.AutoSpaceLegendBoxes*** = True, additional space between segments will be allocated to fit the legend boxes in them.
:::info[Note]
Note that also ***ViewXY.AxisLayout. SegmentsGap*** is allocated between segments.
:::

*Position = SegmentBottomRight. AutoSpaceLegendBoxes = False.*

*Position = SegmentBottomRight. AutoSpaceLegendBoxes = True.*
To align legend box vertically near the specified segment, set ***AlignmentInSegmentGap*** = *Near*. To align
it vertically to center of the gap between segments, set ***AlignmentInSegmentGap*** = *Center*.
***AlignmentInVerticalMargin*** property has *Left/Center/Right* options. The property controls horizontal
positioning of legend boxes set to the same vertical margin.

*Position = SegmentRightMarginCenter. AutoSpaceLegendBoxes = True. AlignmentInVerticalMargin = Left set for both Legend boxes.*
### Resizing and moving legend boxes
The legend boxes support resizing and scroll bars. Grab from the edge to resize it (***Width*** and ***Height*** properties will be updated automatically). When LegendBox is resized ***AutoSize*** property is disabled and scroll-bars are shown by default. ***ScrollBarVisibility*** property can modify that, as it has options *None/Horizontal/Vertical/Both*.
Legend box size could be set programmatically: by disabling ***AutoSize*** property and setting ***Width*** and ***Height*** properties (in screen pixels). Reset size (to be calculated automatically), just enable ***AutoSize*** property.

*Scrollbars in a legend box*
:::info[Note]
When moving or resizing legend box, its ***Position*** is set to *Manual*, and ***Offset*** property is updated to reflect the new [position](#Controlling-positions).
:::
### Legend box events
Aside from typical Mouse click events, Legend boxes have a couple of specific events.
- ***CheckBoxStateChanged*** triggers when the state of a series checkbox has changed from checked to unchecked or vice versa. The event (argument class) has ***IsChecked*** property to get the current state of the checkbox, and ***Series*** property to identify which series was affected.
- ***SeriesTitleMouseClick***, ***SeriesTitleMouseDown*** etc. are special events which trigger only when a series title in the legend box is interacted with. If similar event, for instance *MouseClick*, is used for both the legend box and the series titles, the series title event will take priority. ***MouseOverOn*** and ***MouseOverOff*** also have ***Series*** property to check which series was affected.
:::caution[Note]
***SeriesTitleMouseClick***, ***SeriesTitleMouseDown*** etc. events only work when ***MoveFromSeriesTitle*** property has been disabled.
```csharp
// Using Legend box events.
_chart.ViewXY.LegendBoxes[0].MoveFromSeriesTitle = false;
_chart.ViewXY.LegendBoxes[0].CheckBoxStateChanged += Legend_CheckBoxStateChanged;
private void LegendBox_CheckBoxStateChanged(object sender, CheckBoxStateChangedEventArgs e)
{
if (e.Series is PointLineSeries series) // Get the affected series.
{
series.LineStyle.Color = Colors.Yellow;
}
}
```
:::
In version 12.5 public method ***GetLegendBoxInteractionDataAtMouseEvent()*** was added to LegendBox on all views (XY, 3D etc.). Data contains information about type of object under the mouse cursor (*Title*, *Icon*, *CheckBox*, *Background*), and reference to charting object itself (usually Series). When mouse event raised outside LegendBox, the Type is *LegendBoxInteractionItem.None*.
***GetLegendBoxInteractionDataAtMouseEvent()*** method typically used in handlers of events like LegendBox.MouseDown / MouseClick / MouseUp or Chart.MouseDown / MouseClick / MouseDoubleClick / MouseUp. For example,
```csharp
_chart.ViewXY.LegendBoxes[0].MouseUp += LegendBox_MouseUp;
private void LegendBox_MouseUp(object? sender, MouseEventArgs e)
{
CreateEventString("LegendBox_MouseUp", e as Object);
}
private void CreateEventString(string strEvent, object arg)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine($"{DateTime.Now.ToLongTimeString()}; {strEvent}");
if (arg is MouseEventArgs)
{
MouseEventArgs e = (MouseEventArgs)arg;
sb.AppendLine($"Button: {e.Button}, ClickCount: {e.Clicks}; Position: {e.X},{e.Y};");
}
if (arg is SeriesTitleUserActionEventArgs)
{
SeriesTitleUserActionEventArgs e = (SeriesTitleUserActionEventArgs)arg;
sb.AppendLine($"Series: {e.Series}, ButtonsState: {e.UserEventArguments.ButtonsState}; " +
$"Position: {e.UserEventArguments.Position.X},{e.UserEventArguments.Position.Y}; " +
$"EventType: {e.UserEventArguments.EventType}, Handled: {e.UserEventArguments.Handled}");
}
if (arg is CheckBoxStateChangedEventArgs)
{
CheckBoxStateChangedEventArgs e = (CheckBoxStateChangedEventArgs)arg;
sb.AppendLine($"Series: {e.Series}; IsChecked: {e.IsChecked};");
}
LegendBoxInteractionData data = _chart.ViewXY.LegendBoxes[0].GetLegendBoxInteractionDataAtMouseEvent();
sb.AppendLine($"{strEvent}: {data.Type} | {GetSeriesTitle(data)}");
PrintString(sb);
}
```
### Gap between LegendBox's titles
In version 12.5 new property, ***VerticalTitlesGap***, was added. It controls minimum gap between LegendBox's titles (when layout is vertical). Units are DPI (not PX). Default value 0 DPI, and it should look as before. Value can be set negative (as low as -8 px). Note, that even negative gap values the titles are not overlap and it maybe even be substantial distance, if text does not have ascender or descender parts. Larger checkbox or icon may also increase distance between titles.

*Normal versus reduced vertical gap.*
### Multi-line Series' title
From version 12.5 LegendBox supports titles with multiple lines. Series' title can have text in multiple lines. Legendbox will allocated space for such text and prevent overlap of adjacent titles. Note that LegendBox's row size is fixed, and its height and width are set based on largest values from all legend titles.

*Series' title can have text in multiple lines, and it will be fit automatically in LegendBox.*
---
## LegendBox 3D
Legend boxes in View3D are largely similar to [ViewXY’s legend boxes](/docs/inDetail/legend-box-properties.md). However, only one legend box is allowed per graph. Also, segment-based properties do not exist since axes in View3D cannot be divided into segments. Modify the legend box properties via ***View3D.LegendBox***.

*Legend box properties in View3D.*
### Hiding surface series palette scales
View3D has ***SurfaceScales*** property instead of ViewXY’s ***IntensityScales***. To hide the palette scale in a legend box, set ***SurfaceScales.Visible*** = *False*. To resize it, set ***ScaleSizeDim1*** and ***ScaleSizeDim2*** properties.
### Positioning legend boxes in View3D
As in ViewXY, View3D’s legend boxes can be placed automatically or manually. Automatic placement allows them to be aligned to the left/top/right/bottom side of the view, or the graph area. Control the position with ***Position*** property. Some positioning options take margins into account while some do not.
Options ignoring margins (placing the legend box in the margin area):
*TopCenter*, *TopLeft*, *TopRight*, *LeftCenter*, *RightCenter*, *BottomLeft*, *BottomCenter*, *BottomRight*, *Manual*.
Options placing the legend box inside the margin area:
*GraphTopCenter*, *GraphTopLeft*, *GraphTopRight*, *GraphLeftCenter*, *GraphRightCenter*, *GraphBottomLeft*, *GraphBottomCenter*, *GraphBottomRight*.
***Offset*** property shifts the position by given amount from the position determined by ***Position*** property.
```csharp
// Setting legend box position, offset shifts from RightCenter position
chart.View3D.LegendBox.Position = LegendBoxPosition.RightCenter;
chart.View3D.LegendBox.Offset = new PointIntXY(-15, -70);
```
*Manual* positioning calculates the offset from the top-left corner of the legend box to the view’s top-left corner. Note that this differs from *TopLeft* option, which is calculated from the top of the graph area.

*Positioning options for legend box. Graph.. options place the legend box inside the margins.*
---
## LegendBox Polar
Modify the legend box properties via ***ViewPolar. LegendBox***. Unlike [ViewXY](/docs/inDetail/legend-box-properties.md), ViewPolar can have only one legend box.

*Legend box properties in ViewPolar.*
### Hiding palette scales
To hide the palette scale in a legend box, set ***PaletteScales.Visible*** = *False*. To resize it, set ***ScaleSizeDim1*** and ***ScaleSizeDim2*** properties.
### Legend box positioning in ViewPolar
ViewPolar’s legend boxes can be placed automatically or manually. Automatic placement allows them to be aligned to the left/top/right/bottom side of the view, or the graph area. Control the position with ***Position*** property. Some positioning options take margin area into account while some do not.
Options ignoring margins (placing the legend box in the margin area):
*TopCenter*, *TopLeft*, *TopRight*, *LeftCenter*, *RightCenter*, *BottomLeft*, *BottomCenter*, *BottomRight*, *Manual*
Options placing the legend box inside the margin area:
*GraphTopCenter*, *GraphTopLeft*, *GraphTopRight*, *GraphLeftCenter*, *GraphRightCenter*, *GraphBottomLeft*, *GraphBottomCenter*, *GraphBottomRight*
***Offset*** property shifts the position by given amount from the position determined by ***Position*** property.
```csharp
// Setting legend box position, offset shifts from RightCenter position
chart.ViewPolar.LegendBox.Position = LegendBoxPosition.RightCenter;
chart.ViewPolar.LegendBox.Offset = new PointIntXY(-15, -70);
```
*Manual* positioning calculates the offset from the top-left corner of the legend box to the view’s top-left corner. Note that this differs from *TopLeft* option, which is calculated from the top of the graph area.
---
## LegendBox Smith
Legend box in ViewSmith work exactly like in [ViewPolar](/docs/inDetail/LegendBoxPolar.md). Modify the legend box properties via ***ViewSmith.LegendBox***.
---
## Limit Y-value to stack segment
Every XY series has ***LimitYToStackSegment*** property. When enabled, the series will be clipped outside the segment and the Y-axis area it belongs to. In most cases the property is a boolean to control whether the data should be clipped or not. However, some newer series (***SampleDataBlockSeries***, ***LiteLineSeries*** and ***LiteFreeformLineSeries***) have additional options. There ***LimitYToStackSegment*** is of enumerated type with option: *None* (no clipping), *Clip* (line will be clipped as for old series) and *ClampToSegment* (if line exceeds segment’s edge, it will be rendered horizontally on the edge). Note that for ***LiteFreeformLineSeries***, a line with *ClampToSegment* enabled will be rendered along the edge as far as the real point X-value would be. Therefore, it may be longer than other series clamping line.

*LimitYToStackSegment was set for SampleDataBlockSeries. ClampToSegment option is used for top series, while Clip for bottom.*
---
## Line style
***LineStyle*** is property of many line-series (see [Line-series comparison](/docs/inDetail/comparing-line-series.md)).
If the line should not be visible, disable ***LineVisible*** property, or ***series. Visible*** (in case series does NOT support [PointStyle](/docs/inDetail/points-style.md)), or ***LineVisibleHigh & LineVisibleLow*** properties (in case [HighLowSeries](/docs/inDetail/HighLowSeries.md)).
Alter the point style by setting ***PointStyle*** properties.
### LineStyle

*LineStyle and LineVisible properties*
The series have properties controlling color and width of the line under ***LineStyle*** class.
As [HighLowSeries](/docs/inDetail/HighLowSeries.md) has two lines, their styling is controlled by ***LineStyleHigh*** and ***LineStyleLow*** properties respectively.
Accordingly, ***Color*** is for setting line's color and Width is for setting line's width in PXs. In addition to those properties, line pattern (***Pattern***) also can be modified. Available options include *Solid*, *Dot*, *Dash*, *DashDot* and *SmallDot*. Pattern line could be drawn for [SampleDataSeries](/docs/inDetail/SampleDataSeries.md), [PointLineSeries](/docs/inDetail/PointLineSeries.md), [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md), [AreaSeries](/docs/inDetail/AreaSeries.md), [HighLowSeries](/docs/inDetail/HighLowSeries.md) and [LineCollection](/docs/inDetail/LineCollection.md). For these series ***PatternScale*** property can be used to modify the length of each dash or dot.

*LineStyle.Pattern from top to bottom: Solid, Dash, DashDot, SmallDot, Dot and Dot. Two bottom ones are 'Dot' pattern but for one PatternScale=1 (default), while another PatternScale=3.*
***PolygonSeries. Border*** is also ***LineStyle*** type. So is ***ZoomOutRectLine*** & ***ZoomRectLine*** and several other properties.
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## LineCollection
A ***LineCollection*** is a collection of line segments. Each line segment is a line going from point A to B. One ***LineCollection*** can contain thousands of line segments. ***LineCollection*** is extremely efficient in rendering of thousands of distinct line segments, in contrast to [SampleDataSeries](/docs/inDetail/SampleDataSeries.md), [PointLineSeries](/docs/inDetail/PointLineSeries.md) or [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md). ***PointLineSeries***, ***FreeformPointLineSeries*** or ***SampleDataSeries*** are more efficient in rendering continuous polylines of millions of points.
This belong to the group of line-series. See more [Line-series comparison](/docs/inDetail/comparing-line-series.md).
Add the ***LineCollection*** object in ***ViewXY. LineCollections*** list property.

*Three LineCollections in use. Green acts as very rapidly rendering bars, yellow as a polyline, and red as an arbitrary triangle wireframe mesh.*
### Line style
Series support [LineStyle](/docs/inDetail/line-style.md).
### Setting data to a LineCollection
Set the line segments in ***Lines*** property. ***SegmentLine*** structure consists of four fields:
**AX** Start point, X
**AY** Start point, Y
**BX** End point, X
**BY** End point, Y
Add the ***SegmentLines*** array to ***Lines*** property as follows:
```csharp
lineCollection.Lines = new SegmentLine[] {
new SegmentLine(6,25,8,30),
new SegmentLine(8,30,7,40),
new SegmentLine(7,40,10,40),
new SegmentLine(10,40,12,28) };
```
### Solving individual segments
***GetSegmentsAtPoint()*** method allows checking which individual segment line is at given position, for example under mouse coordinates. It returns a list of integers (segment line indexes).
```csharp
List list = _chart.ViewXY.LineCollections[0].GetSegmentsAtPoint(xCoordinate, yCoordinate);
```
### ClipAreas
Series support [ClipAreas](/docs/inDetail/ClipAreas.md).
### DataCursor
Series can be tracked with [DataCursor](/docs/inDetail/data-cursors.md).
### LimitYToStackSegment
Series support [LimitYToStackSegment](/docs/inDetail/limit-y-value.md).
### Examples
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures*, *LineCollections*, *StemPlot* and *BoxWhiskerPlot* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## LineSeriesCursor
### Basic features
Line series cursors allow visual analysis of line series data by tracking the values by X coordinate. Series values are can only be resolved with series implementing ***ITrackable*** interface (***SampleDataSeries***, ***SampleDataBlockSeries***, ***PointLineSeries***, ***LiteLineSeries***, ***DigitalLineSeries***, ***AreaSeries***, ***HighLowSeries***). For other series types, Y coordinate is not automatically tracked by cursors.
Add ***LineSeriesCursor*** object into ***LineSeriesCursors*** collection. Set the cursor tracking style with ***Style*** property. When ***Style*** is set to *PointTracking*, any tracking point style can be used, even a bitmap image. When using *HairCrossTracking* style, a horizontal line is drawn at line series point Y value. If multiple points of same series hit in cursor location, line is drawn in the middle of minimum and maximum points.

*Cursor on the left (cyan line and crosses), ***Style*** PointTracking, vertical point tracking cursor. Cursor in the center (red lines), ***Style*** HairCrossTracking, hair-cross tracking cursor (horizontal lines are same color as LineSeriesCursor itself). Cursor on the right (yellow line), ***Style*** VerticalNoTracking, vertical full-length cursor without tracking.*
Enable ***SnapToPoints*** to jump the cursor from point to point. **Note!** When ***cursor.SnapToPoints*** is disabled, the ***SolveYValueAtXValue*** returns interpolated value between the points adjacent to it (the intersection of cursor line and the series line).

*SolveYValueAtXValue interpolates the value between adjacent data points when SnapToPoints is disabled.*
By enabling ***IndicateTrackingYRange*** a horizontal bar is drawn ranging from minimum to maximum of the points hitting in the middle of the cursor.

*Hair-cross cursor with Y range indicator (IndicateTrackingYRange = true).*
When ***Style*** = *CursorStyle.HairCrossTracking* and ***HairCrossColorMixing*** property is enabled, the horizontal (tracking) line color will be interpolated color between line-series color and cursor color. Note, color mixing is not applied for tracking points, those always remain same style.

*Hair-cross cursor with color mixing (HairCrossColorMixing = true, also IndicateTrackingYRange = true).*
:::info
To see feature demonstration as example, check *ExampleTradingMultiSegment*, *ExamplePointLineSeriesXY*, *ExampleCursorTrackingXY*, *ExampleLogAxesXY* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### Cursor tracking per Series
Series has ***CursorTrackEnabled*** property, which controls whatever it is being tracked by [DataCursor](/docs/inDetail/data-cursors.md) or [LineSeriesCursor](/docs/inDetail/LineSeriesCursor.md). User can disable this property if particular series tracking is not needed.
### Advanced features
***LineSeriesCursor*** has two advanced features, which allow more control over which series are tracked and how the tracking is done.
***TrackLineSeries*** can be used to determine if the cursor should resolve and draw a track point for a series implementing ***ITrackable*** interface. ***TrackLineSeries*** is defined as a predicate. For example, the following tracks only series that are assigned to the first Y-axis.
```csharp
cursor.TrackLineSeries = new Predicate(TrackableSeriesSelection);
private bool TrackableSeriesSelection(ITrackable obj)
{
return (obj as SeriesBaseXY).AssignYAxisIndex == 0 || (bool)!checkBoxTrackLineSeries.IsChecked;
}
```
***SolveYValue*** is a Func delegate type which can be used to override the cursor’s original Y-value solving and tracking method. Input parameter is a series implementing ***ITrackable*** interface, while the output is a ***LineSeriesCoordinateSolveResult*** struct. For instance, the following changes the cursor to track the maximum Y-value between two cursor lines.
```csharp
cursor.SolveYValue = CustomYValueSolver;
private LineSeriesCoordinateSolveResult? CustomYValueSolver(ITrackable series)
{
PointLineSeries plSeries = series as PointLineSeries;
AxisX xAxis = _chart.ViewXY.XAxes[0];
int iYAxisIndex = plSeries.AssignYAxisIndex;
int iMinIndex = 0;
double dMaxY = double.MinValue;
// check (Max value) only in range between 2 cursors
double dMinX = _chart.ViewXY.LineSeriesCursors[0].ValueAtXAxis;
double dMaxX = _chart.ViewXY.LineSeriesCursors[1].ValueAtXAxis;
for (int i = 0; i < plSeries.PointCount; i++)
{
if (dMinX <= plSeries.Points[i].X && plSeries.Points[i].X <= dMaxX && plSeries.Points[i].Y > dMaxY)
{
iMinIndex = i;
dMaxY = plSeries.Points[i].Y;
}
}
float fNearestX = xAxis.ValueToCoord(plSeries.Points[iMinIndex].X, false);
float fCoordY = _chart.ViewXY.YAxes[iYAxisIndex].ValueToCoord(dMaxY, false);
return new LineSeriesCoordinateSolveResult()
{
NearestX = fNearestX,
CoordBottom = fCoordY,
CoordTop = fCoordY,
MinIndex = iMinIndex,
PointCount = 1,
SolveStatus = LineSeriesSolveStatus.OK
};
}
```
:::info
To see advance features demonstration as example, check *ExampleCursorAdvancedFeatures* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## LiteFreeformLineSeries
***LiteFreeformLineSeries*** is a lighter version of [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md), that is optimized for much faster performance. However, compared to the regular series, it has less configuration options. See more [Line-series comparison](/docs/inDetail/comparing-line-series.md).

*Two LiteFreeformLineSeries with SeriesEventMarker.*
***LiteFreeformLineSeries*** draws only the line between the data points but not the points themselves and
therefore is not suitable for scatter plots. Furthermore, it has only ***Color*** and ***Width*** properties to adjust
the series appearance. ***LiteFreeformLineSeries*** allows data points to be placed freely. In other words, the
points don’t have to be in progressive order.
### Adding points
Use ***AddPoints()*** method to add data point arrays to the series. These arrays should be of type *double[,]*
where the first value is the data point index while the second value has both X (index 0) and Y (index 1) values.
***ActualPointCount()*** can be called to find out the total number of points.
```csharp
// Adding a LiteFreeformLineSeries with random data points.
LiteFreeformLineSeries flls = new LiteFreeformLineSeries(_chart.ViewXY,
_chart.ViewXY.XAxes[0], _chart.ViewXY.YAxes[0]);
flls.Color = Colors.Red;
flls.Width = 3;
double[,] values = new double[21, 2];
for (int i = 0; i < 21; i++)
{
values[i, 0] = rand.NextDouble() * 20; // x-value
values[i, 1] = rand.NextDouble() * 100; // y-value
}
flls.AddPoints(values, false);
_chart.ViewXY.LiteFreeformLineSeries.Add(flls);
```
### SeriesEventMarker
Series support [SeriesEventMarker](/docs/inDetail/event-markers-XY.md).
### ClipAreas
Series support [ClipAreas](/docs/inDetail/ClipAreas.md).
### DataCursor
Series can be tracked with [DataCursor](/docs/inDetail/data-cursors.md).
### LimitYToStackSegment
Series support [LimitYToStackSegment](/docs/inDetail/limit-y-value.md).
### Examples
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures* and *FreeformArt* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## LiteLineSeries
***LiteLineSeries*** is a version of [PointLineSeries](/docs/inDetail/PointLineSeries.md), that is optimized for much faster performance. It works similarly to ***PointLineSeries*** but has less configuration options. ***LiteLineSeries*** draws only the line between the data points but not the points themselves. Furthermore, it has only ***Color*** and ***Width*** properties to adjust the series appearance. See more [Line-series comparison](/docs/inDetail/comparing-line-series.md).
***LiteLineSeries*** expects data points to be in progressive order (**values[i+1, 0] ≥ values[i, 0]**).

*Example of LiteLineSeries.*
### Adding points
Use ***AddPoints()*** method to add data point arrays to the series. These arrays should be of type *double[,]*
where the first value is the data point index while the second value has both X (index 0) and Y (index 1) values.
***ActualPointCount()*** can be called to find out the total number of points.
```csharp
// Adding a LiteLineSeries with some random data points.
LiteLineSeries lls = new LiteLineSeries(_chart.ViewXY,
_chart.ViewXY.XAxes[0], _chart.ViewXY.YAxes[0]);
lls.Width = 2;
lls.Color = Colors.Lime;
double[,] values = new double[21, 2];
for (int i = 0; i < 21; i++)
{
values[i, 0] = i; // x-value
values[i, 1] = rand.NextDouble() * 100; // y-value
}
lls.AddPoints(values, false);
_chart.ViewXY.LiteLineSeries.Add(lls);
```
### SeriesEventMarker
Series support [SeriesEventMarker](/docs/inDetail/event-markers-XY.md).
### ClipAreas
Series support [ClipAreas](/docs/inDetail/ClipAreas.md).
### LineSeriesCursors
Series can be tracked with [LineSeriesCursors](/docs/inDetail/LineSeriesCursor.md).
### DataCursor
Series can be tracked with [DataCursor](/docs/inDetail/data-cursors.md).
### LimitYToStackSegment
Series support [LimitYToStackSegment](/docs/inDetail/limit-y-value.md).
### Examples
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures*, *TemperatureGraph* and *RaceCarTelemetry2* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## MeshModel
## 3D model (MeshModel)
***MeshModels*** list property allows inserting 3D models from external 3D model editors into LightningChart View3D. The models can be imported in OBJ format ([Wavefront .obj file](https://en.wikipedia.org/wiki/Wavefront_.obj_file)), which is a generic format in 3D modeling applications and game engines.
:::info
To see feature demonstration as example, check *ExampleSeaMeshModels*, *ExampleMeshModelAsteroid*, *Airplane colored in real-time*, *Mesh models by code*, *EEG Visualization showcase*, *ExampleTranslucentChart3D* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::

*Battleship and submarine models loaded in View3D, over SurfaceGridSeries3D visualizing seabed depth data.*
### Loading a model
- To load a model from file, set the path and file name into ***ModelFileName*** property, or use ***LoadFromFile*** method. When loading the model from file, texture fills are loaded as well, if they exist in the same path, and MTL file and image files are accessible.
- Starting from LightningChart version 8.5, ***MeshModel*** creation supports colors for vertices in .obj -file. Vertex positions support Red, Green, Blue and Alpha values after x, y and z (XYZRGBA).
- To load model from stream, use ***LoadFromStream*** method. The stream reading method only reads geometry and materials, but not textures.
- To load model from a resource, use ***LoadFromResource*** method.
### Constructing MeshModel programmatically from vertices
Starting from v.8.2, ***MeshModel*** supports constructing the **3D Model** geometry programmatically. It allows visualizing objects and shapes that have been produced via computation (or parsed from other than OBJ files).
The following Create methods are available:
- *Create(positions, colors, indices)*
- *Create(positions, colors, normals, indices)*
- *Create(positions, textureCoordinates, bitmap, textureWrapMode, indices)*
- *Create(positions, normals, textureCoordinates, bitmap, textureWrapMode, indices)*
Index array (***indices***) parameters are optional. If provided, they will define which vertices, colors, light normals and texture coordinates to use from the arrays given. Using indices saves resources when same vertices are shared between multiple triangles.

*MeshModels constructed by code*
The rotation, scaling and positioning properties etc., as well as events, apply also to a ***MeshModel*** created programmatically from vertices, in a similar way than they work for loaded objects.
An alternative way to create ***MeshModels*** is to use ***CreateFromTriangles()*** method. It creates the model based on the given arrays of vertices (*PointFloat3D[]*) and colors (*Color[] or int[]*), and an optional array of normal (*PointFloat3D[]*).
### Positioning, scaling and rotating the model
A ***MeshModel*** object ***Position*** follows the X, Y and Z axes it has been assigned to. The model can be rotated by editing ***Rotation*** property. Size can be defined with ***Size*** property, which is a collection of factors for original model size and does not follow axis ranges or 3D world dimensions.
:::tip
Only central point of mesh model is position at [x,y,z] axes values. The size of ***MeshModel*** is not fixed to Axes or Dimensions or 3D world. Therefore, one would need to scale model for the first time it is put on the chart. If user will change Axes range or 3D world dimensions, it will distort relative size of ***MeshModel***.
NOTE! Zooming could be done with mouse wheel scrolling or changing ***Chart.View3D.Camera.ViewDistance*** property directly.
If user wants to change Axes range or dimensions after ***MeshModel*** is loaded, it is possible, but a bit more complicated (see [How to resize MeshModel](/docs/how-to/resize-mesh-model.md)).
:::
### Enabling fill and wireframe
- To show fill, set property ***Fill*** = True
- To show wireframe, set property ***WireFrame*** = True, and set preferred line color in ***WireFrameLineColor***.

*Airplane shown as wireframe (WireFrameLineColor = Red) and with default gray fill.*
### Custom-coloring fill
By default, the model renders with the colors of the OBJ model. To apply custom coloring for model’s vertices, use ***UpdateFillColors(int[] colors)*** method. This method can also be called periodically, to apply real-time color updates. ***UpdateFillColors*** requires an ARGB colors array that is equal length of vertex positions (*X.Length*). One color for each vertex.
***GeometryConstructed*** event reports position of vertices in axis values space, as X, Y and Z arrays. They are especially needed when applying coloring e.g. by spatial distance to other chart objects, such as data points. Subscribe to ***GeometryConstructed*** event handler in the initialization phase, and then unsubscribe when not needed anymore.

*MeshModel colored by spatial distance utilizing UpdateFillColors method*
:::tip[Tip]
***ChartTools.ConvertDataToColorsByFixedIntervalPalette*** method can be utilized to convert data values into colors (ARGB int) by given palette steps.
:::
### Custom-coloring wireframe
Wireframe can also be colored with custom colors. Use ***GeometryConstructed*** event handler to get the required colors array length and ***UpdateWireframeColors*** method to apply the new colors.

*MeshModel wireframe colored by spatial distance utilizing UpdateWireframeColors method*
### Updating the bitmap fill efficiently
When a ***MeshModel*** has been created by using [***Create***](#Constructing-MeshModel-programmatically-from-vertices) method, supplying bitmap and texture coordinates as arguments, it is possible to update the bitmap very efficiently without reconstructing the geometry. Call ***UpdateFillBitmap*** method to update.

*MeshModel with bitmap fill*
:::note
**UpdateFillBitmap method is not applicable for models loaded from OBJ files.**
:::
### Reverse vertices winding order
Some models are made with reverse winding order and therefore culling makes them invisible. If the model does not show up correctly, change ***Cull*** setting to *Clockwise*, *CounterClockwise* or *None*.
```csharp
meshModel.Cull = Cull.CounterClockwise;
```
### Shade mode
It is possible to control whether lights affect ***MeshModel*** colors or not. By setting **ShadeMode** property to *Flat*, lighting has no effect on the model. By default, ***ShadeMode*** is set to *Gouraud* (lighting affects the model).
```csharp
model.ShadeMode = ShadeMode.Flat;
```
:::note
By disabling lighting effects causes the model to lose some of its depth perception.
:::
### MeshModel rendering order
***RenderingOrder*** -property was introduced in LightningChart version 8.5. It controls whether a ***MeshModel*** is rendered before (*BeforeSeries* options) other series, such as ***PointLineSeries3D*** and ***SurfaceGridSeries3D***, or after them (*AfterSeries* options). ***MeshModels*** with similar ***RenderingOrder*** -settings are drawn in the order they are added to the chart.
```csharp
meshModel.RenderingOrder = MeshModelRenderingOrder.BeforeSeries;
```
Above all ***RenderingOrder*** affects semi-transparent ***MeshModels***. Its use is to determine if other series can be seen through the model. If a ***MeshModel*** uses no transparent colors, it blocks everything behind it from being seen regardless of ***RenderingOrder*** -settings.

*RenderingOrder of a semi-tranparent MeshModel is set as BeforeSeries on the left and as AfterSeries on the right. With BeforeSeries -option, other series such as PointLineSeries3D cannot be seen through the model even if the model colors are transparent.*
:::note
Note that currently ***Rectangles3D*** and ***Polygons3D*** are not affected by ***RenderingOrder*** as they are not considered series.
:::
### Tracing the model with mouse
***MeshModel*** has triangle-based tracing for mouse position. Use ***TriangleTraced*** event, which indicates the nearest triangle to the camera and the mouse location.
The event arguments have the following info:
- IntersectionPointAxisValues: intersection point of triangle face in axes values;
- ModelSpaceTriangleCoordinates: array of 3 triangle corners (vertices) the mouse is hitting in 3D model space coordinates;
- WorldSpaceTriangleCoordinates: array of 3 triangle corners (vertices) the mouse is hitting in 3D world space coordinates;
- NearestCoordinateIndex: Index of nearest coordinate index of traced triangle, value of 0…2. Use the index to extract the coordinate from ModelSpaceTriangleCoordinates or WorldSpaceTriangleCoordinates array.

*Tracing MeshModels with mouse. Traced result is shown in an Annotation.*
### Examples
:::info
To see feature demonstration as example, check *SeaMeshModels*, *MeshModelAsteroid*, *MeshModelRealtimeColoring*, *MeshModelByCode* and *EEGDataVisualization* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## PersistentSeriesRenderingIntensityLayer
***PersistentSeriesRenderingIntensityLayer*** allows collecting traces into a layer and coloring it by the hit count per pixel. The coloring is made by using a value-range palette. The traces can be used with the same series types as in [PersistentSeriesRenderingLayer](/docs/inDetail/persistent-layer.md) (that is, all belong to ***PointLineSeriesBase*** class) They are very much similar to it, main difference being the coloring. When rendering a trace in a location of a pixel again with second rendering call, the intensity of it grows, increasing its value in the value-range palette.

*Persistent intensity layer highlights areas of concentrated activity, in this case in yellow and red.*

*Repetitive signal trace is rendered in the same region. On the left, only a couple of traces have been rendered on the layer, showing all colors in blue. On the middle, a lot of traces have been rendered, but mostly on different coordinates. In the intersections of the traces, the hit count exceeds the trace count of 10 defined in the palette for yellow color threshold. In the rightmost image, hundreds of traces have been rendered in total, and intersections start to exceed threshold defined for red color.*
### Creating the layer
The ***PersistentSeriesRenderingIntensityLayer*** is not a sub-property of ViewXY and can’t be added with Visual Studio’s property grid. ***PersistentSeriesRenderingIntensityLayer*** objects must be created in code.
Create it as follows:
```csharp
using LightningChartLib.[edition].Charting.Views.ViewXY;
PersistentSeriesRenderingIntensityLayer layer = new PersistentSeriesRenderingIntensityLayerngLayer(m_chart.ViewXY, m_chart.ViewXY.XAxes[0]);
```
### Clearing the layer
***layer.Clear()*** clears the layer and resets the counters.
### Changing palette colors
Define the palette type and steps in ***ValueRangePalette*** property of the layer. ***ValueRangePalette.Type*** = *Gradient* makes a gradient coloring, ***ValueRangePalette.Type*** = *Uniform* makes the layer render with discrete color steps.
### Adjusting the intensity effect of new trace and decay of old traces
Use ***NewTraceIntensity*** property to control how great intensity effect the new trace rendered with ***RenderSeries*** call gets. Typical value is 1…100, depending on how fast the color range is set to fill up with the traces.
Use ***HistoryIntensityFactor*** to adjust the decay speed of the old traces. Typical value is in range of 0.5 – 0.99.
Note that setting ***HistoryIntensityFactor*** itself doesn’t update the layer until the next call of ***RenderSeries***.
### Rendering data into the layer
Render a [PointLineSeries](/docs/inDetail/PointLineSeries.md), [SampleDataSeries](/docs/inDetail/SampleDataSeries.md), [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md), [HighLowSeries](/docs/inDetail/HighLowSeries.md) or [AreaSeries](/docs/inDetail/AreaSeries.md) to the layer by RenderSeries method. (all belong to ***PointLineSeriesBase*** class).
Render one series on the layer call:
```csharp
layer.RenderSeries(PointLineSeriesBase series)
```
```csharp
layer.RenderSeries(List seriesList)
```
Render all given series on the layer. No performance gain over ***layer.RenderSeries(PointLineSeriesBase series)*** though.
### Disposing the layer
To dispose the layer and prevent it from rendering with the chart, call
```csharp
layer.Dispose();
```
### Anti-aliasing data in the layer
To anti-alias the data in the chart rendering stage, set ***layer.AntiAliasing*** to *True*. This enables anti-aliasing also if the hardware doesn’t support it.
### Getting list of layers
***ViewXY.GetPersistentSeriesRenderingLayers()*** returns list of all created layers, including [PersistentSeriesRenderingLayers](/docs/inDetail/persistent-layer.md).
### Examples
:::info
To see feature demonstration as example, check *PersistentIntensitySignal* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## PersistentSeriesRenderingLayer
***PersistentSeriesRenderingLayer*** can be used for extremely fast rendering of repetitive line/points data, or line/points/high-low/area fill data that is plotted in same X and Y range over and over again.
For example, consider a case of FFT monitoring: Every second 20 new data strips are received. The newest data should be visible as well as all the historic traces. But the monitoring lasts for hours. By rendering this kind of data with regular rendering, 20 * 60 * 60 = 72000 new line series are needed every hour. The PC will run out of memory probably before 1 hour is monitored. It is certain that rendering will slow down so badly that it’s not usable anymore.
***PersistentSeriesRenderingLayer*** is kind of a bitmap, that allows adding rendering data incrementally in it. It keeps the graphics until cleared by command. This way, each update round, only one series needs to be rendered on the layer, followed by the layer rendering on the screen. CPU load or memory footprint doesn’t rise. If existing data should be faded away gradually, it can be done by multiplying the alpha of the bitmap pixels.
It is possible to create as many ***PersistentSeriesRenderingLayer*** objects as needed, and any count of series can be rendered on each of them, any update round.

*Persistent layer shows historical traces, in green color (no fading away). A regular PointLineSeries is shown over it, in red color.*

*Persistent layer shows historical traces, in green color. MultiplyAlpha method is called before updating new data in the rendering layer making the oldest traces fade away.*
### Creating the layer
***PersistentSeriesRenderingLayer*** is not a sub-property of ViewXY and can’t be added with Visual Studio’s property grid. ***PersistentSeriesRenderingLayer*** objects must be created in code. Create it as follows:
```csharp
using LightningChartLib.[edition].Charting.Views.ViewXY;
PersistentSeriesRenderingLayer layer = new PersistentSeriesRenderingLayer
(m_chart.ViewXY, m_chart.ViewXY.XAxes[0]);
```
By supplying ViewXY object as parameter, it binds the layer in ViewXY. Supply the same XAxis object that is used with the series rendered on it.
Multiple layers will render in the order of creation with the chart.
### Clearing the layer
***layer.Clear()*** clears the layer and initializes the color with ARGB=(0,255,255,255).
***layer.Clear(Color color)*** clears the layer with given color. In most cases, it’s most useful to set the same color used in the background, but set its A = 0. With black background, use *layer.Clear(Color.FromArgb(0,0,0,0));*
### Adjusting layer alpha
***MultiplyAlpha(value)*** allows making the layer more transparent or opaquer. Multiplying effects every pixel in the layer separately.
By supplying value < 1, transparency will be increased (decays the layer).
By supplying value > 1, opacity will be increased (brings the layer more visible).
Takes no effect with value of 1.
For example, ***MultiplyAlpha(0.8)*** sets the alpha to 80% of existing alpha. ***MultiplyAlpha(2)*** adjust it to 200%.
### Rendering data into the layer
Render the data into the layer by using any of [PointLineSeries](/docs/inDetail/PointLineSeries.md), [SampleDataSeries](/docs/inDetail/SampleDataSeries.md), [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md), [HighLowSeries](/docs/inDetail/HighLowSeries.md) or [AreaSeries](/docs/inDetail/AreaSeries.md) objects (all belong to ***PointLineSeriesBase*** class). They can be series that have been added into ***ViewXY.PointLineSeries***, ***ViewXY.SampleDataSeries***, ***ViewXY.FreeformPointLineSeries***, ***ViewXY.HighLowSeries*** or ***ViewXY.AreaSeries collection***. A temporary series that have not been added into these collections can also be used. Fill the data in the series as usual (see series description).
Render one series on the layer call:
```csharp
layer.RenderSeries(PointLineSeriesBase series)
```
Render all given series on the layer is more efficient than calling ***layer.RenderSeries(PointLineSeriesBase series)*** for each series separately.
```csharp
layer.RenderSeries(List seriesList)
```
:::note
All the given series will be rendered on the layer, even if their Visible is set to False.
:::
:::note
The X axis that used with the series must be the same as the one supplied for ***PersistentSeriesRenderingLayer*** constructor. Otherwise, the series object will be skipped.
:::
:::note
***RenderSeries*** is for rendering INTO the layer. The layer itself will be rendered just before regular series (***PointLineSeries***, ***SampleDataSeries***, ***FreeformPointLineSeries***, ***HighLowSeries***, ***AreaSeries***).
:::
### Disposing the layer
To dispose the layer and prevent it from rendering with the chart, call
```csharp
layer.Dispose();
```
### Anti-aliasing data in the layer
To anti-alias the data in the chart rendering stage, set ***layer.AntiAliasing*** to *True*. This enables anti-aliasing also if the hardware doesn’t support it.
### Getting list of layers
***ViewXY.GetPersistentSeriesRenderingLayers()*** returns list of all created layers, including [PersistentSeriesRenderingIntensityLayers](/docs/inDetail/persistent-intensity-layer.md).
### Some layer limitations to be aware of
Due to its special rendering technique, please keep these limitations in mind:
- X axis ScrollMode must be set to None. Real-time scrolling of X axis is not possible in this approach.
- Zooming, panning, axis adjustment and chart resize will cause the image to be in un-sync with axis ranges. These features should be disabled when using persistent plotting, or the application logic made so that it clears the layer and recreates temporarily the older line series for new layer rendering (there are event handlers for axis range change and resize).
- Chart resizing will clear the layer, as well as resuming from Windows desktop lock state.
- Mouse interactivity is not supported on the series rendered only on the layer
- EMF/SVG export, copy to clipboard in vector format, and print in vector format don’t support the layer. Only raster formats are supported.
### Examples
:::info
To see feature demonstration as example, check *PersistentRenderingLayer*, *PersistentRenderingHighLowAreas*, *PersistentFFT* and *NBodySimulation* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## PointLineSeries
A ***PointLineSeries*** can present a simple line, points(scatter) or both as a point line. ***PointLineSeries*** is good for variable interval progressing data. That is, X values must be in progressive order:
**Points[i+1].X ≥ Points[i].X**.
:::tip
Note, ***PointLineSeries*** is not the fastest line-series (for real-time streaming application). Series which requires fixed interval progressive data (like ***SampleDataBlockSeries*** or ***SampleDataSeries***) is faster than ***PointLineSeries***. Also ***LiteLineSeries*** is faster than ***PointLineSeries***, but don't have point-shapes and some other features. See more [Line-series comparison](/docs/inDetail/comparing-line-series.md).
:::

*Overview of PointLineSeries.*
Add the series to chart by adding ***PointLineSeries*** objects to ***PointLineSeries*** list.
```csharp
chart.ViewXY.PointLineSeries.Add(series); // Add series to the chart
```

*Three different PointLineSeries (only LineVisible, only PointsVisible and both)*
### Line style
Series support [LineStyle](/docs/inDetail/line-style.md).
All line series can render a line (between 2 or more points). The series have properties controlling color and width of the line under ***LineStyle*** class. If the line should not be visible, set ***LineVisible*** = false. In addition to those properties, line pattern also can be modified. Available options include *Solid*, *Dot*, *Dash*, *DashDot* and *SmallDot*. ***PatternScale*** property can be used to modify the length of each dash or dot.
### Points style
Series support [PointStyle](/docs/inDetail/points-style.md).
To show the points, set ***PointsVisible*** = true. Alter the point style by setting ***PointStyle*** properties. Select the shape from many pre-defined styles from ***PointStyle.Shape***. When using pre-defined point styles, like *Circle*, *Triangle*, *Cross* etc. the drawing colors and filling styles can be defined. Note that all colors or fills are not applicable for all shape styles. Point width and height can be set and the points can be rotated as well.
One of the shape styles is *Bitmap*, which allows drawing any bitmap image in the point location. Define the bitmap image with ***BitmapImage*** property. ***BitmapAlphaLevel*** property can be used to alter the transparency of the bitmap. Adjust the bitmap color tone by changing ***BitmapImageTintColor*** to some other color than white.
### Adding points
The series points must be added in code. Use ***AddPoints(SeriesPoint[], bool invalidate)*** method to add points to the end of existing points.
```csharp
//Add points to the end
chart.ViewXY.PointLineSeries[0].AddPoints(pointsArray);
```
To set whole series data at once, and overwrite old points, assign the new point array directly:
```csharp
//Assign the points array
chart.ViewXY.PointLineSeries[0].Points = pointsArray;
```
:::warning[Note]
The ***PointLineSeries*** points X values must be in **ascending** order. If they have to be otherwise ordered, use ***FreeformPointLineSeries*** instead.
For example, definition Points[0].X = 0, Points[1].X = 5, Points[2].X = 5, Points[3].X = 6 is valid.
But Points[0].X = 2, Points[1].X =1, Points[2].X = 6, Points[3].X =7 is not a valid value array for PointLineSeries.
:::
### Adding points, alternative way
Points can also be added in X and Y values arrays, which turns to be more convenient way in many applications.
```csharp
chart.ViewXY.PointLineSeries[0].AddPoints(xValuesArray,yValuesArray,false);
```
To set whole series data at once, and overwrite old points, assign the X and Y values arrays directly (applicable in WinForms and WPF Non-bindable APIs).
```csharp
chart.ViewXY.PointLineSeries[0].SetValues(xValuesArray, yValuesArray);
```
### SeriesEventMarker
Series support [SeriesEventMarker](/docs/inDetail/event-markers-XY.md).
### Coloring points individually
Series support [IndividualPointColoring](/docs/inDetail/points-style.md).
### Y-value based coloring
Series support ***UsePalette*** and [Y-value based coloring](/docs/inDetail/advanced-line-coloring.md)
### Custom shaping and coloring
Series support [CustomLinePointColoringAndShaping event](/docs/inDetail/advanced-line-coloring.md).
### Polynomial regression
Series support [regression fitting](/docs/inDetail/polynomial-regression.md) for data points.
### DataBreaking
Series support [DataBreaking by NaN or other value](/docs/inDetail/data-breaking.md).
### ClipAreas
Series support [ClipAreas](/docs/inDetail/ClipAreas.md).
### LineSeriesCursors
Series can be tracked with [LineSeriesCursors](/docs/inDetail/LineSeriesCursor.md).
### DataCursor
Series can be tracked with [DataCursor](/docs/inDetail/data-cursors.md).
### LimitYToStackSegment
Series support [LimitYToStackSegment](/docs/inDetail/limit-y-value.md).
### Rendering data into the Persistent-Rendering-Layer
Series data can be added to either [PersistentSeriesRenderingLayer](/docs/inDetail/persistent-layer.md) or [PersistentSeriesRenderingIntensityLayer](/docs/inDetail/persistent-intensity-layer.md).
### Examples
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures*, *MultiColorLineEvent*, *MarkersTracking* and *Regression fit* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## PointLineSeries3D
***PointLineSeries3D*** allows presenting points and line in 3D space. For points, there are many basic 3D shapes available. Points are connected together with a line, if ***LineVisible*** property is set *True*.

*A PointLineSeries3D example. PointStyle’s Shape is set to Sphere.*
### Point styles
Points can be shown as real 3D points, or as 2D shapes (which is better as far as performance). It is controlled by ***PointStyle. ShapeType*** property. *Shape2D* will have faster performance, while *Shape3D* is more stylish and represent 'true 3D object' (with depth perception and interaction with [Lights](/docs/inDetail/3D-overview.md)).

*PointStyle property tree. ShapeType can be used to switch between 2D and 3D shapes.*
If ***ShapeType*** is set as *Shape2D*, then ***PointStyle. Shape2D*** property tree controls point's style. Essentially it is all the same properties as [XY PointStyle](/docs/inDetail/points-style.md). 2D shape is alway flat and faces viewer.
If ***ShapeType*** is set as *Shape3D*, then properties ***PointStyle. Shape3D*** (with options *Box*, *Sphere*, *Cylinder*, *Cone*, *Torus*, *Ellipsoid*), ***PointStyle. Size3D*** (with ***Width***, ***Height*** and ***Depth*** properties in units of [World coordinates](/docs/inDetail/3D-overview.md)), ***PointStyle. DetailLevel*** and ***series. Material*** control point's style.

*Red crosses have ShapeType = Shape2D. Teal and Green objects have ShapeType = Shape3D.*
:::warning[Note]
2D shapes are rendered on top of all 3D objects and they don't have any support for hiding them based on other objects visibility.
:::
### Line styles

*LineStyle properties*
The lines can be rendered as shaded 3D lines or as a one pixel wide hair line.
When having a lot of data in the series, setting ***LineOptimization*** = *Hairline* is recommended to avoid performance issues. When ***LineOptimization*** is set for *Normal* or *NormalWithShading* options, ***LineStyle. Width*** property control line thickness in units of [World coordinates](/docs/inDetail/3D-overview.md).

*Yellow line: LineStyle.LineOptimization = Hairline. Red Line: LineStyle.LineOptimization =
NormalWithShading.*
In addition to ***LineStyle*** settings, ***PointLineSeries3D*** has ***ClosedLine*** property, which when enabled, automatically connects the first and the last data points of the series. This property is available from LightningChart version 9.0 onwards.
```csharp
// Connecting the first and the last points
pointLineSeries3D.ClosedLine = true;
```
For optimizing semi-transparent lines, see [TransparencyRenderMode](/docs/inDetail/transparency-render-mode.md).
### Adding points
***PointLineSeries3D*** supports three different point formats:
- ***Points*** property (*SeriesPoint3D* array)
- ***PointsCompact*** property (*SeriesPointCompact3D* array)
- ***PointsCompactColored*** property (*SeriesPointCompactColored3D* array)
***PointsCompact*** and ***PointsCompactColored*** structures are very memory efficient, allowing up to 100 million data points visualization with simple point styles. Set the point format via ***PointsType*** property.
#### Points
By using ***Points*** property, all the advanced coloring options of points are supported. *SeriesPoint3D* structure consists of the following fields:
- *double* **X**: X axis value
- *double* **Y**: Y axis value
- *double* **Z**: Z axis value
- *Color* **Color**: individual data point color, only applies when ***IndividualPointColors*** is enabled, or ***MultiColorLine*** is enabled.
- *float* **SizeFactor**: size factor multiplies the size defined by ***PointStyle. Size***. Only applies when using ***IndividualPointSizes*** is enabled.
- *object* **Tag**: freely assignable auxiliary object, for example to attach some details.
Series points must be added in code. Use ***AddPoints(…)*** method to add points to the end of existing points.
```csharp
SeriesPoint3D[] pointsArray = new SeriesPoint3D [3];
pointsArray [0] = new SeriesPoint3D (50, 50, 50);
pointsArray [1] = new SeriesPoint3D (30, 50, 20);
pointsArray [2] = new SeriesPoint3D (80, 50, 80);
//Add points to the end
chart.View3D.PointLineSeries3D[0].AddPoints(pointsArray);
```
To set whole series data at once while overwriting old points, assign the new point array directly:
```csharp
chart.View3D.PointLineSeries[0].Points = pointsArray; //Assign the points array
```
#### PointsCompact
***PointsCompact*** property enables low memory consumption, which is important when having a lot of data points. *SeriesPointCompact3D* structure consists of the following fields:
- *double* **X**: X axis value
- *double* **Y**: Y axis value
- *double* **Z**: Z axis value
Series points must be added in code. Use ***AddPoints(…)*** method to add points to the end of existing points.
```csharp
SeriesPointCompact3D[] pointsArray = new SeriesPointCompact3D[3];
pointsArray [0] = new SeriesPointCompact3D(50, 50, 50);
pointsArray [1] = new SeriesPointCompact3D(30, 50, 20);
pointsArray [2] = new SeriesPointCompact3D(80, 50, 80);
//Add points to the end
chart.View3D.PointLineSeries3D[0].AddPoints(pointsArray);
```
To set whole series data at once while overwriting old points, assign the new point array directly:
```csharp
//Assign the points array
chart.View3D.PointLineSeries[0].PointsCompact = pointsArray;
```
#### PointsCompactColored
***PointsCompactColored*** property enables low memory consumption, important when having a lot of data points, but still allows coloring the points with individual colors.
*SeriesPointCompactColoured3D* structure consists of the following fields:
- *float* **X**: X axis value
- *float* **Y**: Y axis value
- *float* **Z**: Z axis value
- *int* **Color**: Color of the point
```csharp
SeriesPointCompactColored3D[] pointsArray = new SeriesPointCompactColored3D[3];
pointsArray [0] = new SeriesPointCompactColored3D(50, 50, 50, Color.Blue.ToArgb());
pointsArray [1] = new SeriesPointCompactColored3D(30, 50, 20, Color.Red.ToArgb());
pointsArray [2] = new SeriesPointCompactColored3D(80, 50, 80, Color.Green.ToArgb());
//Add points to the end
chart.View3D.PointLineSeries3D[0].AddPoints(pointsArray);
```
To set whole series data at once while overwriting old points, assign the new point array directly:
```csharp
//Assign the points array
chart.View3D.PointLineSeries[0].PointsCompactColored = pointsArray;
```
### Coloring points individually
By setting ***IndividualPointColors*** = *True*, the ***Color*** fields of points apply instead of ***Material. DiffuseColor***.

*IndividualPointColors in use.*
:::note
Individual point coloring is not supported when having ***PointsType*** = *PointsCompact*.
:::
### Setting points sizes individually
By setting ***IndividualPointSizes*** = *True*, ***SizeFactor*** fields from the points take effect. The factor multiplies the size defined in ***PointStyle.Size***.

*IndividualPointSizes in use.*
:::note
Individual point sizes are not supported when having ***PointsType*** = *PointsCompact*, or *PointsCompactColored*.
:::
### Multi-coloring line
To color the line with given data point colors, set ***MultiColorLine*** = *True*. The chart interpolates the color gradients between adjacent points.

*MultiColorLine enabled*
:::note
***MultiColorLine*** is not supported when having ***PointsType*** = *PointsCompact*.
:::
### Displaying millions of scatter points
To be able to show a very high count of scatter points, set ***PointsOptimization*** = *Pixels*. Then each series point will be rendered as a single pixel. When having to show 10 million or 100 million data points, use the [PointsCompact](#PointsCompact) or [PointsCompactColored](#PointsCompactColored) approach to keep memory requirements functional.

*Millions of scatter points. LineVisible = False, PointsVisible = True, PointsOptimization = Pixels.*

*IndividualPointsColoring = True, using PointsCompactColored, LineVisible = False, PointsVisible = True. 120 million of scatter points.*
Millions of data points can be most efficiently visualized with rectangles. When using ***PointsCompactColored*** or ***PointsCompact***, the point size can be controlled with ***PointStyle.Shape2D.Width*** and ***PointStyle.Shape2D.Height***.

*PointStyle.Shape2D.Width = 20 and PointStyle.Shape2D.Height = 10.*
### Examples
:::info
To see feature demonstration as example, check *Points3D*, *PointLines3D*, *PointTracking3D*, *PointCloud3D*, *ExampleLidar*, *MultiColoredPoint*, *ParallelCoordinates3D* and *CamerasAndLights* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## PointLineSeriesPolar
ViewPolar’s ***PointLineSeriesPolar*** can be used to draw a line, a group of points or a point-line. Add the series to chart by adding ***PointLineSeriesPolar*** objects to ***ViewPolar. PointLineSeries*** list.
### Style
Lots of line and point styles are available in ***LineStyle*** and ***PointStyle*** properties. Those are identical to ViewXY line-series' [LineStyle](/docs/inDetail/line-style.md) and [PointStyle](/docs/inDetail/points-style.md) properties respectively.

*Some data presented with ViewPolar’s PointLineSeries. Line and points are both visible.*
### Setting data
The code represents the data setting of the previous figure.
```csharp
int iCount = 360;
PolarSeriesPoint[] points = new PolarSeriesPoint[iCount];
Random rnd = new Random();
for (int i = 0; i < iCount; i++)
{
points[i].Amplitude = 10.0 + 3.0 * rnd.NextDouble() + 5.0 *
Math.Cos(AxisPolar.DegreesAsRadians((double)i * 1.0));
points[i].Angle = (double)i;
}
chart.ViewPolar.PointLineSeries[0].Points = points;
```
A close look at the previous image reveals that the first and the last data points are not connected. ***PointLineSeriesPolar*** has ***ClosedLine*** -property which when enabled, automatically draws a line between these points.
```csharp
// Connect the first and the last data point.
pointLineSeriesPolar.ClosedLine = true;
```
### Palette coloring
Line coloring supports palette. ***ColorStyle*** property can be used to select how the palette coloring is applied.
- *LineStyle*: No palette fill. The color set in ***LineStyle.Color*** property applies.
- *PalettedByAngle*: Data point ***Angle*** field determines the color.
- *PalettedByAmplitude*: Data point ***Amplitude*** field determines the color.
- *PalettedByValue*: Data point ***Value*** field determines the color.

*Palette coloring applied.*
Use ***ValueRangePalette*** property to define the colors and value steps, it works similarly to ViewXY's and View3D's series (see [ValueRangePalette](/docs/inDetail/IntensityGridSeries.md)).
### CustomLinePointColoringAndShaping event
Custom coloring and coordinate adjustment can be made with ***CustomLinePointColoringAndShaping*** event, which is called just before entering the rendering stage of the chart. It works in similar way than the [CustomLinePointColoringAndShaping](/docs/inDetail/advanced-line-coloring.md) event in ViewXY’s [SampleDataSeries](/docs/inDetail/SampleDataSeries.md), [PointLineSeries](/docs/inDetail/PointLineSeries.md) or [FreeformPointLineSeries](/docs/inDetail/FreeformPointLineSeries.md).
### Examples
:::info
To see feature demonstration as example, check *ExampleLineSeriesPolar*, *PolarLinePalette*, *ScatterPolarMouseSelecting* and *PolarLineMultiColored* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## PointLineSeriesSmith
ViewSmith’s ***PointLineSeriesSmith*** can be used to draw a line, a group of points or a point-line as in [ViewPolar](/docs/inDetail/PointLineSeriesPolar.md). Lots of line and point styles are available in ***LineStyle*** and ***PointStyle*** properties. Add the series to chart by adding ***PointLineSeriesSmith*** objects to ***ViewSmith. PointLineSeries*** list.

*Smith data series.*
### Setting data
The code below, will add one set of data points to the collection of the Smith chart.
```csharp
SmithSeriesPoint[] m_aPoints;
PointLineSeriesSmith Series = new PointLineSeriesSmith(m_chart.ViewSmith, axis);
//Create data for series
m_iCount = 5000;
m_aPoints = new SmithSeriesPoint[m_iCount];
for (int i = 0; i < m_iCount; i++)
{
// Sine from left to right
m_aPoints[i].RealValue = i * (MaxReal / m_iCount);
m_aPoints[i].ImgValue = Math.Sin(0.01 * i)/Math.PI * MaxReal;
}
Series.Points = m_aPoints;
//Add series to chart
m_chart.ViewSmith.PointLineSeries.Add(Series);
```
### Examples
:::info
To see feature demonstration as example, check *SmithLine* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Points style
PointStyle is property of many line-series (see [Line-series comparison](/docs/inDetail/comparing-line-series.md)).
To show the points, set ***PointsVisible*** = true. Alter the point style by setting ***PointStyle*** properties.
### PointStyle

*PointStyle properties*
Select the shape from many pre-defined styles from ***PointStyle. Shape***. Shapes available for PointStyle are *Rectangle*, *Circle*, *Triangle*, *Hexagon*, *Flag*, *FlagLightning*, *Cross*, *CrossAim*, *Bitmap*, *HollowBasic*, *HollowBasicActive*, *HollowHarmonic*, *HollowActiveSideband*, *HollowSideband*, *HollowTailedActive* and *HollowTailed*. ***PointStyle*** properties ***Angle***, ***Height***, ***Width***, ***Color1-2-3***, ***GradientFill*** can further be used to modify appearance of point. While there are 3 color properties not all applicable for all shape styles. So are fill properties. Shape can be framed by border (***BorderColor*** and ***BorderWidth*** properties).

*Various Shapes of PointStyle (labels are not part of PointStyle, but added for clarity).*
One of the shape styles is *Bitmap*, which allows drawing any bitmap image in the point location. Define the bitmap image with ***BitmapImage*** property. ***BitmapAlphaLevel*** property can be used to alter the transparency of the bitmap. Adjust the bitmap color tone by changing ***BitmapImageTintColor*** to some other color than white. If ***UseImageSize*** property is enabled, then image original size is used instead of ***PointStyle*** properties ***Height*** and ***Width***.
:::tip[Note]
PointStyle properties and shapes are very similar to [EventMarker's Symbol](/docs/inDetail/event-markers-XY.md).
:::
### Coloring points individually
Starting from v.7.2, the ***PointLineSeries***, ***FreeformPointLineSeries***, ***AreaSeries*** and ***HighLowSeries*** have PointColor field in the data point structures.
To enable individual point coloring, set ***IndividualPointColoring*** to *Color1*, *Color2*, *Color3* or *BorderColor* setting. To disable individual point coloring, set ***IndividualPointColoring*** = *Off*. The color settings correspond to that color in ***PointStyle*** property.

*In top, IndividualPointColoring = Color1 (solid colored point). In the middle, IndividualPointColoring = BorderColor. In the bottom, IndividualPointColoring = Color2 (having gradient coloring with Color1 = transparent).*
:::info
To see feature demonstration as example, check *Point line*, *individually colored points*, *Scatter points, individually colored* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## ViewPolar overview
***ViewPolar*** allows data visualization in a polar format. The data point position is determined by angular value and amplitude (compare angle as X and amplitude as Y in ViewXY). Polar view also has zooming and panning features.

*ViewPolar object tree.*
### Axes

*Three axes, the first one (red) in the outer circle, the second (green) in the middle, and the third (blue) closest to center. Axis AngleOrigin can be changed by dragging it over the axis circle. Amplitude range can be changed by dragging from the axis. Minimum or maximum of axis amplitude range can be changed by dragging from the small nib in the end of the amplitude scale.*
Polar axes can be defined via Axes list property. Several axes can be used in same chart. Series can be assigned with any of these axes by setting ***AssignPolarAxisIndex*** property of a series. An axis represents both angular scale and amplitude scale. Otherwise, the polar axes are very similar to [ViewXY axes](/docs/inDetail/axis-class-properties.md).

*AxisPolar property tree.*
#### Reversed axes
The axis can be reversed by amplitude, angle or both. To reverse the angle scale, set ***AngularReversed*** = True. To reverse the amplitude scale, set ***AmplitudeReversed*** = *True*.

*On the left, scales are not reversed. On the right, AngularReversed = True and AmplitudeReversed = True.*
#### Setting rotation angles of the scales
Use ***AngleOrigin*** to set the rotation angle of angle scale.

*AngleOrigin = 30.*
Use ***AmplitudeAxisAngle*** to rotate amplitude axis position. Amplitude scale angle can be set as absolute angle (***AmplitudeAxisAngleType*** = *Absolute*), or relative (***AmplitudeAxisAngleType*** = *Relative*) to angle scale’s angle.

*AngleOrigin = 30. AmplitudeAxisAngle = 90. On the left, AmplitudeAxisAngleType = Absolute. On the right, AmplitudeAxisAngleType = Relative. Overall the amplitude scale rotates 120 degrees in this case.*
#### Setting divisions
Set the amplitude division count with ***MajorDivCount***, and division magnitude with ***MajorDiv*** property. The amplitude scale will adjust accordingly (updating ***MaxAmplitude***). Set amplitude minor division count with ***MinorDivCount***.
By default, the chart tries to include almost as many angular divisions as it can fit. To control the angular divisions, set ***AngularAxisAutoDivSpacing*** to *False*. Then the chart tries ***AngularAxisMajorDivCount*** count of divisions. If chart space is too small to render all the divisions and labels, it will use a lower division count that it can fit.
### Margins
When ***AutoSizeMargins*** is enabled, the graph size is adjusted so that there’s enough space for all the axes and chart title. When it is disabled, ***ViewPolar. Margins*** property applies allowing setting margins manually.
In the run time, the margins rectangle can be retrieved in pixels by calling ***ViewPolar. GetMarginsRect()*** method, which applies to both automatic and manual margins. It is useful when needing to do screen-coordinate based computation or object placement.
***ViewPolar. MarginsChanged*** event can be set to trigger when a margin rectangle has been changed because of for example resizing it.
The contents of the view are automatically clipped outside the margins. All contents are clipped other than the chart title, annotations and legend boxes as their position is defined in screen coordinates, allowing them to be freely positioned on the margins as well. A one or more pixel(s) wide border rectangle, ***Border. Width***, can be drawn to display where the margins are. By default, the border is not visible in ***ViewPolar***. The color of the rectangle can be changed via ***Border.Color*** property.

*Contents of the polar chart are clipped outside the margins. Border is drawn to mark the margin area. Axis labels stay visible inside the borderline.*
---
## Polygon3D
***Polygon3D*** objects allow presenting a 2D polygon stretched to given Y range. They can be added to
***View3D. Polygons*** list.
Define the polygon path in X and Z axis values and store it in ***Points*** array. Set the Y range with ***YMin*** and ***YMax*** values.
***Material. DiffuseColor*** controls the main color of the rectangle. Rotate the polygon to another angle with ***Rotation.X***, ***Rotation.Y*** and ***Rotation.Z*** in degrees.

*Properties of Polygon3D objects.*

*A 6-point polygon ranging from YMin = 0, YMax = 15.*

*World population shown with Polygon3D objects. A Polygon3D object is drawn based on each region of map data. The amount of population of a country is used to color the polygon and to set its YMax. China and India are shown with translucent colors because of their high population.*
### Examples
:::info
To see feature demonstration as example, check *ExamplePolygons3D* and *PopulationPolygons3D* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## PolygonSeries
***PolygonSeries*** renders a fill and a borderline, by given border path.
Set the filling preferences in ***Fill*** property. Use ***Border*** property of ***PolygonSeries*** to set the border line style.

*Several polygons.*
### Setting data to a PolygonSeries
Set the path points in ***Points*** property. ***PolygonSeries*** has an automatic path closing feature. If the last point is not connected to the first point, the chart will do that automatically.
The following shows how to assign the points of the previous picture’s transparent teal polygon’s
path:
```csharp
polygon.Points = new PointDouble2D[] {
new PointDouble2D(7,12),
new PointDouble2D(6,9.5),
new PointDouble2D(7.5,5),
new PointDouble2D(10,6),
new PointDouble2D(9,11)};
```
### Enabling complex / intersecting fills
Set ***IntersectionsAllowed*** = True to enable polygon path to intersect itself. Without this property enabled, when intersecting the path, the fill will appear all garbled up. By default, the property is False for performance reasons, as detecting and rendering intersection cases is heavy.

*Polygon with intersecting path, with IntersectionsAllowed = True*
### Examples
:::info
To see feature demonstration as example, check *ExamplePolygon*, *BoxWhiskerPlot*, *Zoomable2DPie* and *TernaryPlot* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Polynomial regression
Only [PointLineSeries](/docs/inDetail/PointLineSeries.md) has properties/feature to do regression fitting for data points. Regression fitting, utilizing ***RegressionFitting*** and ***RegressionPolyOrder*** properties of ***PointLineSeries***. When ***RegressionFitting*** is set other than *None* option, line replaced with fitted curve (see image below).
For other series it is possible to use ***MathRoutines.PolynomialRegression()*** method and replace data with fitted points.

*An example of 3rd-order (cubic) polynomial regression fit.*
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures*, *ExampleRegression*, *SplineLineMouseEdit* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Rectangle3D
***Rectangle3D*** allows presenting a rectangle, turned to any angle, at any size, at any location. They can be added to ***View3D. Rectangles*** list. Rectangles can also act as planes by defining their size according to ***View3D. Dimensions***.

*Properties of Rectangle3D objects.*
### Position and size
Set ***Size*** in [3D world dimensions](/docs/inDetail/3D-overview.md) (not X, Y or Z axis values) as ***Width*** and ***Height***. Set the center point via ***Center*** property, defined in X, Y and Z axis values. ***Rotation*** property specifies the rotation in degrees.
### Fill style
Fill settings can be modified via ***Fill*** property. Solid color and bitmap fills are available. To use bitmap fill, set the bitmap in ***Image***, and enable ***UseImage***. When setting **Fill. Layout** = *Stretch*, the bitmap stretches to fill the rectangle. By setting ***Fill. Layout*** = *Tile*, the same bitmap is tiled to fill the rectangle. The tile count can be altered via ***Fill. TileCountWidth*** and ***Fill. TileCountHeight*** properties.

*Two Rectangle3D objects in View3D. The bottom blue one shows a bitmap fill with Layout = Tile. The red rotated rectangle on the top is configured with translucent color.*
### Examples
:::info
To see feature demonstration as example, check *ExampleRectangle3D*, *ParallelCoordinates3D* and *SurfaceMouseControl* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## SampleDataBlockSeries
***SampleDataBlockSeries*** is a version of [SampleDataSeries](/docs/inDetail/SampleDataSeries.md), fully optimized for real-time applications. It offers the best possible performance with least CPU and memory consumption, allowing rendering extremely high number of data points simultaneously. As the name of the series suggests, the data is internally managed as blocks, which in turn are individually memory-managed. This removes the need for extremely large continuous linear memory. ***SampleDataBlockSeries*** is the optimal series type for realtime medical monitoring applications, such as ECG/EKG, EEG, industrial monitoring applications, telemetry, and waveform vibration monitoring.
***SampleDataBlockSeries*** works almost similarly to ***SampleDataSeries***. It likewise requires the added data to be in progressive order and to have a fixed data interval. ***SamplingFrequency*** property (1 / sample interval) can be used to set the fixed sample interval. To set the X value (time stamp) where the samples begin, set ***FirstSampleTimeStamp*** property. However, visually ***SampleDataBlockSeries*** has fewer formatting options compared to other line series. ***Color*** and ***Width*** properties are available to change the color and width of the line respectively. Furthermore, ***SampleDataBlockSeries*** shows only the (solid) line, not individual points or line-pattern. See more [Line-series comparison](/docs/inDetail/comparing-line-series.md).

*Several SampleDataBlockSeries in a real-time application.*
### Adding points
New samples can be added in code by using ***AddSamples*** method. Unlike ***SampleDataSeries***, ***SampleDataBlockSeries*** accepts only float values. ***PointCount*** property can be used to get the current number of samples in the series.
Or if ***SampleFormat*** is *DoubleFloat*
```csharp
// Add samples to the end.
sampleDataBlockSeries.AddSamples(samplesArray, false);
// Get the total number of samples.
int samplesCount =_chart.ViewXY.SampleDataBlockSeries[0].PointCount;
```
### SeriesEventMarker
Series support [SeriesEventMarker](/docs/inDetail/event-markers-XY.md).
### ClipAreas
Series support [ClipAreas](/docs/inDetail/ClipAreas.md).
### LineSeriesCursors
Series can be tracked with [LineSeriesCursors](/docs/inDetail/LineSeriesCursor.md).
### DataCursor
Series can be tracked with [DataCursor](/docs/inDetail/data-cursors.md).
### LimitYToStackSegment
Series support [LimitYToStackSegment](/docs/inDetail/limit-y-value.md).
### Examples
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures*, *BillionPoints* and *HiSpeedXY* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## SampleDataSeries
***SampleDataSeries*** - for fixed interval progressing data. ***SampleDataSeries*** is the line series used for presenting sampled signal data (discrete signal data). This is generally used in real-time DSP applications. Visually, it is similar to ***PointLineSeries***, so all line and point formatting options apply. As ***SampleDataSeries*** has a fixed sample interval, there’s no need to reserve memory to store point X values.

*Overview of SampleDataSeries.*
***SampleDataSeries*** does not resample or down-sample the given data. All given data values are retained in the ***SamplesSingle*** or ***SamplesDouble*** arrays. LightningChart does not reduce the quality of the data or lose peaks or accuracy of the data.
:::tip
Although ***SampleDataSeries*** is faster than ***PointLineSeries***, but it is not the fastest line-series (for real-time streaming application). Another series which also requires fixed interval progressive data (***SampleDataBlockSeries***) is faster, but it doesn't have point-shapes and some other features. See more [Line-series comparison](/docs/inDetail/comparing-line-series.md).
:::
Add the series to chart by adding ***SampleDataSeries*** objects to ***SampleDataSeries*** list.

*Four different SampleDataSeries (only LineVisible, only PointsVisible, dash-pattern line and both).*
### Y precision
The ***SampleDataSeries*** supports single and double precision sample Y values. Using single precision values is recommended when keeping the memory reserved as low as possible. Select the sample format with ***SampleFormat*** property.
### X precision
Use the series ***SamplingFrequency*** (1 / sample interval) to set the fixed sample interval. To set the X value (time stamp) where the samples begin, set ***FirstSampleTimeStamp*** property.
### Adding points
The samples must be added in code. Use ***AddSamples*** method to add samples to the end of existing samples.
```csharp
// Add samples to the end
chart.ViewXY.SampleDataSeries[0].AddSamples(samplesArray, false);
```
To set whole series data at once, and overwrite old samples, assign the new samples array directly:
If ***SampleFormat*** is *SingleFloat*
```csharp
chart.ViewXY.SampleDataSeries[0].SamplesSingle = samplesSingleArray;
```
Or if ***SampleFormat*** is *DoubleFloat*
```csharp
chart.ViewXY.SampleDataSeries[0].SamplesDouble = samplesDoubleArray;
```
### Line style
Series support [LineStyle](/docs/inDetail/line-style.md).
### Points style
Series support [PointStyle](/docs/inDetail/points-style.md).
### SeriesEventMarker
Series support [SeriesEventMarker](/docs/inDetail/event-markers-XY.md).
### Y-value based coloring
Series support ***UsePalette*** and [Y-value based coloring](/docs/inDetail/advanced-line-coloring.md)
### Custom shaping and coloring
Series support [CustomLinePointColoringAndShaping event](/docs/inDetail/advanced-line-coloring.md).
### DataBreaking
Series support [DataBreaking by NaN or other value](/docs/inDetail/data-breaking.md).
### ClipAreas
Series support [ClipAreas](/docs/inDetail/ClipAreas.md).
### LineSeriesCursors
Series can be tracked with [LineSeriesCursors](/docs/inDetail/LineSeriesCursor.md).
### DataCursor
Series can be tracked with [DataCursor](/docs/inDetail/data-cursors.md).
### LimitYToStackSegment
Series support [LimitYToStackSegment](/docs/inDetail/limit-y-value.md).
### Rendering data into the Persistent-Rendering-Layer
Series data can be added to either [PersistentSeriesRenderingLayer](/docs/inDetail/persistent-layer.md) or [PersistentSeriesRenderingIntensityLayer](/docs/inDetail/persistent-intensity-layer.md).
### Examples
:::info
To see feature demonstration as example, check *LineSeriesXYFeatures*, *ThreadMultiChannel* and *SignalReader* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Scrollbars
One or more scrollbars can be added via ***chart. HorizontalScrollBars*** or ***chart. VerticalScrollBars*** collection property. The appearance is fully customizable, allowing defining even oval shaped buttons and scroll box. For example, a bitmap can be used as a button icon. ***Scrollbars*** can be used with all views, but the most apparent usage is in ***ViewXY***.

*Two different looking scrollbars.*
### Scrollbar properties
***HorizontalScrollBar*** can be aligned to fit the width of the graph by setting ***Alignment*** property to *BelowGraph*, *AboveGraph* or *GraphCenter*. Respectively, ***VerticalScrollBar*** can be aligned to fit the height of the graph by setting ***Alignment*** property to *LeftToGraph*, *GraphCenter* or *RightToGraph*. By setting ***Alignment*** to *None*, the scrollbar can be freely positioned with ***Offset*** property. Adjust its size with ***Size*** property.
```csharp
// Setting the position and the size of a scrollbar. Offset is based on the top-left corner of the chart
horizontalScrollBar.Alignment = HorizontalScrollBarAlignment.None;
horizontalScrollBar.Offset = new PointIntXY(100, 10);
horizontalScrollBar.Size = new Size(500, 30);
```
Scrollbars use 64-bit unsigned integer values instead of the usual 32-bit signed integer values. ***Value*** is the current position, ***Minimum*** is the minimum range value and ***Maximum*** is the maximum range value. This allows direct support for long measurements with high sampling frequency. For example, when ***SampleDataSeries*** is used in the measurement, set the sample index directly as scrollbar value. ***Minimum*** value represents the first sample index, and ***Maximum*** represents the last sample index.
***SmallChange*** property is the amount of increment or decrement, when a scroll button is clicked. If ***KeyControlEnabled*** is active and the scrollbar has focus, you can use also arrow keys to change the ***Value*** by ***SmallChange*** amount.
***LargeChange*** represents a page change, which occurs when the scrollbar is clicked outside the scroll box or scroll buttons. Use ***PageUp*** and ***PageDown*** keys to change the ***Value*** respectively.
***WheelChange*** sets the change value when mouse wheel is scrolled over the scroll bar.
### Scroll event
***Scroll*** event handler can be used in code to react to scrollbar value changes. Alternatively, ***ValueChanged*** event handler can be used. However, ***Scroll*** provides more information of how the scroll has been done.
### Scrollbars with decimals or negative values
As scrollbars are designed to use unsigned integers to support long measurements, they cannot be directly used when axis values are decimals or negative values. In these cases, the result will be a crash or otherwise bad usability due to rounding errors. However, Scrollbar Minimum and Maximum values do not have to be tied to axis ranges. This allows scaling the bars even if the axis values and/or data values are small decimals or negative numbers.
For example, if the values to be shown range from 0.500 to 1.500, the scrollbar can be set to use range 500 -> 1500. Respectively, with data ranges from -150 to 0, the scrollbar can use values from 0 to 150.
The following example shows how to modify a vertical scrollbar when the Y-axis values are decimals ranging from negative to positive.
```csharp
double yMin = -0.178; // Some arbitrary axis values
double yMax = 1.253;
double upShift = 0.178; // To prevent the scrollbar from using negative values
double scaleFactor = 1000.0; // To scale the scrollbar to use integer values
_chart.ViewXY.YAxes[0].Minimum = yMin;
_chart.ViewXY.YAxes[0].Maximum = yMax;
_chart.VerticalScrollBars[0].Minimum = (ulong)((yMin + upShift) * scaleFactor);
_chart.VerticalScrollBars[0].Maximum = (ulong)((yMax + upShift) * scaleFactor);
_chart.VerticalScrollBars[0].LargeChange = _chart.VerticalScrollBars[0].Maximum -
_chart.VerticalScrollBars[0].Minimum;
_chart.ViewXY.YAxes[0].SetRange(0.3, 0.6); // Display only a portion of the axis
```
```csharp
// The scroll event
private void VerticalScrollBar_Scroll(object sender, ScrollEventArgs e)
{
double newMin = (yMax + upShift) * scaleFactor - (double)e.NewValue -
currentRangeY + (yMin + upShift) * scaleFactor;
if (newMin < (yMin + upShift) * scaleFactor)
{
// The scroll bar cannot go below the minimum axis value
newMin = (yMin + upShift) * scaleFactor;
}
double newMax = newMin + currentRangeY;
if (newMax > (yMax + upShift) * scaleFactor)
{
// The scroll bar cannot go above the maximum axis value
newMax = (yMax + upShift) * scaleFactor;
newMin = newMax - currentRangeY;
}
// Adjusting axis range based on the scrollbar value, triggers RangeChanged event.
// Converts the values used by the scrollbar back to unscaled axis values.
_chart.ViewXY.YAxes[0].SetRange((newMin / scaleFactor - upShift) , (newMax / scaleFactor - upShift) );
}
```
```csharp
// RangeChanged -event to modify the axis ranges correctly
private void AxisY_RangeChanged(object sender, RangeChangedEventArgs e)
{
// Prevent axis minimum value from going below yMin set earlier
if (e.NewMin < yMin)
{
double newRange = e.NewMax - e.NewMin;
if (newRange <= yMax - yMin)
{
_chart.ViewXY.YAxes[0].SetRange(yMin, yMin + newRange);
}
else
{
_chart.ViewXY.YAxes[0].SetRange(yMin, yMax);
}
}
// Prevent axis maximum value from going above yMax set earlier
else if (e.NewMax > yMax)
{
double newRange = e.NewMax - e.NewMin;
if (newRange <= yMax - yMin)
{
_chart.ViewXY.YAxes[0].SetRange(yMax - newRange, yMax);
}
else
{
_chart.ViewXY.YAxes[0].SetRange(yMin, yMax);
}
}
// Modify the scrollbar based on the the new axis range.
else
{
double newRange = (e.NewMax - e.NewMin) * scaleFactor;
_chart.BeginUpdate();
_chart.VerticalScrollBars[0].LargeChange = (ulong)(newRange + 0.1);
_chart.VerticalScrollBars[0].Value = (ulong)((yMax - e.NewMax +
yMin + upShift) * scaleFactor);
_chart.EndUpdate();
currentRangeY = newRange;
}
}
```
### Examples
:::info
To see feature demonstration as example, check *Scrollbars*, *ThreadFedScrollbar* and *ExampleTradingScaleBreaks* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Sectors
***Sector*** object can be defined to indicate some angular or amplitude range (and added to ***ViewPolar. Sectors*** list). Define amplitude range with ***MinAmplitude*** and ***MaxAmplitude*** properties. Define angular range with ***BeginAngle*** and ***EndAngle***. Sector's circular motion can be done with mouse-cursor (by dragging object) - this modifies *angle* properties accordingly.

*Two examples utilizing sectors. The first figure, Wind Rose diagram, is made with several sectors of different colors. In the second figure, a dial is made with AreaSeries with a sector representing RPM meter red zone.*
### Examples
:::info
To see feature demonstration as example, check *ExampleLineSeriesPolar*, *PolarWindRose*, *ScatterPolarMouseSelecting* and *PolarRadar* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Sharing objects
## Sharing objects between other objects
LightningChart object model is tree-based. Every class has its parent object and a list of child objects. This tree-model allows child object to notify the parent object of its changes, allowing the parent to respond to it. Respectively, the parent notifies its parent and so on until the root node, LightningChart itself, is reached, which then knows how to refresh accordingly.
**Chart takes ownership of all the objects given to it and will dispose the objects when it no longer needs them.** This includes situations where a new object replacing an old one is given to chart, and the parent of the object is disposed. User must be aware of this, as otherwise it is possible to end up using disposed objects.
If an object is shared between another .NET component and LightningChart, and LightningChart disposes the object, the .NET component is left with a disposed object. LightningChart cannot detect parent sharing between LightningChart and other components.
:::danger[Important]
Sharing objects between other objects in the same chart, or other chart instances, is not allowed.
:::
```csharp
// Example #1 of wrong usage:
AnnotationXY annotation1 = new AnnotationXY();
chart.ViewXY.Annotations.Add(annotation1);
AnnotationXY annotation2 = new AnnotationXY();
annotation2.Fill = annotation1.Fill;
chart.ViewXY.Annotations.Add(annotation2);
```
:::tip
Issue: The same **Fill** object cannot be shared between multiple objects.
Correct way: Only copy properties if they are of ValueType (e.g. Integer, Double, Color)
:::
```csharp
// Example #2 of wrong usage:
SeriesEventMarker marker = new SeriesEventMarker();
chart.ViewXY.PointLineSeries[0].SeriesEventMarkers.Add(marker);
chart.ViewXY.PointLineSeries[1].SeriesEventMarkers.Add(marker);
```
:::tip
Issue: The same object shouldn't be added to a collection of multiple collections.
Correct way: Create several markers, one for each series.
:::
**Remember to subscribe to [ChartMessage event handler](/docs/how-to/debug-troubleshoot.md). In most cases it reports errors of invalid object sharing cases.**
---
## Signal tools
***LightningChart*** primarily is data visualization component. The ***SignalTools*** is small package for our users’ convenience, if they just need simple things in addition to charting. **Signal Tools** contains several components:
[***SignalReader***](#SignalReader-component) - generates real-time data stream reading signal files in different formats: *WAV (PCM)*, *sid* (biosignal file with marking), *ssd* (LightningChart's *sampled signal data* format). The playback can be automatically restarted with looping option;
[***AudioInput***](#AudioInput-component) - Reads real-time sampled data stream from sound card line-in (using e.g. microphone) through DirectSound. The data can be forwarded to chart, *AudioOutput* or your own data target;
[***SignalGenerator***](#SignalGenerator-component) - SignalGenerator is a multi-functional signal generator component. It allows combining different waveform types into single, real-time output signal. The waveform components can be set with a built-in user interface or by code;
[***SpectrumCalculator***](#SpectrumCalculator-component) - Converts data between time domain and frequency domain using Fast Fourier transform (FFT) algorithm. Optimal for calculating FFT conversion and power spectrum of sampled signal data;
[***AudioOutput***](#AudioOutput-component) - Allows real-time data stream playback via sound card line-out (using e.g. speakers) through DirectSound. The data can be fetched from *SignalGenerator*, *SignalReader*, *AudioInput* or other data source.
[***Signal filters***](#Signal-filters) - SignalProcessing namespace has built-in digital signal filters (*Finite Impulse Response* (FIR) filters and *Infinite Impulse Response* (IIR) filters).
### SignalGenerator component
***SignalGenerator*** component can be used to generate real-time signal. The signal is produced as the sum of different waveforms. Several ***SignalGenerator*** components can be linked by master-slave relationship, to produce a synchronized, multi-channel output. ***SignalGenerator*** is very useful when developing signal monitoring or data acquisition software with LightningChart.

*Signal generator component with Sine page selected.*
The waveforms are divided into following categories: *Sine*, *Square*, *Triangle*, *Noise*, *Frequency sweep*, and *Amplitude sweep*. Respective tab pages for them can be seen in the component. In *Sine* page, sine waveforms can be added. In *Square* and *Triangle* pages, square and triangle waveforms can be added respectively. In *Noise* page, random noise waveforms can be generated. In *Frequency* and *Amplitude* *sweep* pages, frequency and amplitude sweeps can be added. In All page, all the waveforms can be set in a stacked view.
:::info
To see EventMarkers used in example, check *Oscilloscope*, *SignalGenerator to speakers*, *Intensity persistent layer*, *ExampleHiSpeedXY*, *ExampleAreaSeriesRealTimeXY*, *ExampleFFT*, *ExampleLissajousXY* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
#### Sampling frequency, Output interval and Factor
***SamplingFrequency*** tells how many signal points are generated per second. Higher sampling frequency produces more accurate signal but comes with a cost of increased dataflow and overhead. With high sampling frequency, signals containing high frequencies can be presented. Sampling frequency must be more than twice the maximum signal frequency to fulfill Nyquist sampling theorem.
***OutputInterval*** sets the preferred interval of calculated output samples, in milliseconds. For example, if ***OutputInterval*** is set 100, a bundle of samples is received 10 times per second, after every 100 ms period. Using lower values will give smoother real-time monitoring output. Note that ***OutputInterval*** is not accurate and may vary with computer load. The output data stream automatically generates more samples if the period has been longer than expected. The data stream will get in shape also with high data rates and under heavy computer overhead.
***Factor*** multiplies the output samples by selected value. For example, to generate mV signal instead of V signal, set ***Factor*** to 1E-3.
#### Sine waveforms
Sine waveform is constructed with ***Amplitude***, ***Offset***, ***Frequency*** and ***DelayMs*** parameters. ***Amplitude*** is the maximum voltage difference from zero level. Note that the total range is bipolar. Peak-to-peak value will be 2 * ***Amplitude***. Offset is DC level added to the signal. In other words, positive values shift the signal up and negative values shift it down in the value range. ***Frequency*** tells the signal cycle count in Hertz. One cycle per second is frequency of 1 Hertz. ***DelayMs*** delays in the signal in milliseconds.

*A simple sine waveform signal with settings above.*

*The signal of two sine waveforms with their settings above.*
#### Square waveforms
Square waveform has one more parameter compared to sine waveforms, ***Symmetry***. The range for ***Symmetry*** is 0…1. ***Symmetry*** tells how long the signal stays in high state, related to cycle period. With a value of 0.5 the low and high states of the signal are of equal lengths.

*One square waveform signal, with symmetry of 0.8. Settings above.*
#### Triangle waveforms
Triangle waveform also has ***Symmetry*** parameter. It controls the way the triangles lean. 0.5 is the value for symmetrical triangle. Values under 0.5 lean left and values over it lean right.

*One triangle waveform signal, with symmetry of 0.7.*
#### Noise waveforms
Noise waveform is a randomly generated signal. Points get randomized between -***Amplitude*** and +***Amplitude***.

*Noise waveform signal generating random data points between amplidutes -30 and +30.*
#### Frequency sweeps
Frequency sine sweep runs from frequency 1 to frequency 2 in given time period, with constant amplitude. Use ***FrequencyFrom*** to set the start frequency, ***FrequencyTo*** to set the end frequency, ***Amplitude*** to set the constant amplitude, and ***DurationMs*** to set the duration in milliseconds.

*Frequency sweep*
#### Amplitude sweeps
Amplitude sine sweep runs from amplitude 1 to amplitude 2 in given time period, with constant frequency. Use ***AmplitudeFrom*** to set the start amplitude, ***AmplitudeTo*** to set the end amplitude, ***Frequency*** to set the constant frequency, and ***DurationMs*** to set the duration in milliseconds.

*Amplitude sweep*
#### Starting and stopping
Start the generator by pressing Start button or calling ***Start*** method. Stop the generator by pressing Stop button or calling ***StopRequest*** method. ***Stopped*** event will fire when stopping is complete.
#### Multi-channel generator with master-slave configuration
Several ***SignalGenerator*** components can be connected to produce a synchronized, multi-channel output.
***MasterGenerator*** controls the sampling frequency, start, stop and output of all generators. It produces the first channel in the output data stream.
Slave generators are connected to master generator by assigning their ***MasterGenerator*** property. Define the signal waveforms freely. Slave generators are started and stopped by the master generator. They get the output data stream channel index in the connection order. Slave generators must be connected before starting the master generator.
#### Output data stream
The output data stream consists of two-dimensional arrays, obtained via ***DataGenerated*** event handler. Generally, the event is raised after every ***OutputInterval***.
The event handler obtains a reference to a samples array, and a time stamp for the first samples bundle received during this interval. The first dimension of samples array represents channels and the second the samples for each channel. All channels have equal sample count.
Raising DataGenerated event:
```csharp
m_signalGenerator.DataGenerated += m_signalGenerator_DataGenerated;
private void m_signalGenerator_DataGenerated(DataGeneratedEventArgs args)
{
// Event code
{
```
To investigate the channel count of the data stream, get the length of first dimension:
```csharp
channelCount = args.Samples.Length;
```
To get the sample count of a channel:
```csharp
sampleBundleCount = args.Samples[0].Length;
```
The following code will demonstrate how to forward the output data directly to ***SampleDataSeries*** list of LightningChart while updating real-time monitoring scroll position.
```csharp
private void m_signalGenerator_DataGenerated(DataGeneratedEventArgs args)
{
chart.BeginUpdate();
int channelIndex = 0;
int sampleBundleCount = args.Samples[0].Length;
foreach (SampleDataSeries series in chart.ViewXY.SampleDataSeries)
{
series.AddSamples(args.Samples[channelIndex++], false);
}
//Set latest scroll position x
newestX = args.FirstSampleTimeStamp + (double)(sampleBundleCount - 1) / generatorSamplingFrequency;
chart.ViewXY.XAxes[0].ScrollPosition = newestX;
chart.EndUpdate();
}
```
:::note
Note that with args.Samples[0] you can access the master generator’s data. args.Samples[1] gives access to first slave generator data, args.Samples[2] to second slave etc.
:::
### SignalReader component
***SignalReader*** component allows reading data from a signal source file and playing it back with selected rate. ***SignalReader*** output data stream format is similar to [SignalGenerator](#Output-data-stream).
SignalReader component currently supports *wav*, *ssd* and *sid* formats. From version 12.5 ***SignalReader*** can read not only 16-bit WAV audio files, but also 24-bit and 32-bit (integer) WAV files.
#### Key properties
***FileName*** defines the file to be opened, for example *“c:\\wavedata\\audioclip1.wav”*
***Factor*** sets the output factor. Raw signal samples are multiplied by this value.
***OutputInterval*** is similar to [SignalGenerator’s property](#Sampling-frequency-Output-interval-and-Factor).
***IsLooping*** allows file read to jump to the beginning of the file, when the end of file has been reached.
After the file has been opened, the following properties can be used to get information about the file:
***ChannelCount***: the channel count of the file.
***SamplingFrequency***: sampling frequency in Hz.
***FileSize***: File size in bytes.
***Length***: Sample count for each channel. It may not be exact for all signal file formats.
***IsReaderEnabled***: Status telling is the component started and reading data. If ***Looping*** is set to false and end of file is reached, ***IsReaderEnabled*** will change to false.
#### Opening file quickly for playback
Call ***OpenFile(…)*** method supplied with a file name. The file name must have an extension of supported formats. Then, call ***Start()*** method.
```csharp
signalReader.OpenFile(“c:\\wavedata\\audioclip1.wav”);
signalReader.Start();
```
A playback of a PCM-formatted WAV file is then started.
The playback can be stopped by calling StopRequest() method.

*SignalReader reads a wav file and LightningChart SampleDataSeries draw the signal. A cursor line is used to mark the current reading position and the X-axis scroll position.*
:::info
To see EventMarkers used in example, check *ExampleSignalReader*, *ExampleWaveFFT*, *ExampleAudioSpectrogram3D*, *ExamplePersistentFFT* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### AudioInput component
***AudioInput*** component allows user to capture signal from Windows’ recording device to System.Double values. These values can then be rendered on LightningChart, sent to an [AudioOutput](#AudioOutput-component) component, saved to a file etc.
#### Properties
***BitsPerSample*** – Gets or sets how many bits are allocated per sample. Supported values are 8 and 16. If other values are used, 16 is used instead. It can be set when ***IsInputEnabled*** is false.
***IsInputEnabled*** – Gets or sets the state of this instance (i.e. starts or stops it). Setting this property true is the same as calling ***Start*** method where false is the same as calling ***Stop*** method.
***IsStereo*** – Gets or sets whether to use two channels (stereo) or just one (mono). Can be set when ***IsInputEnabled*** is false.
***RecordingDevice*** – Gets or sets the current recording device. Can be set when ***IsInputEnabled*** is false. By setting this property to null, Windows' default recording device is used.
***SamplesPerSecond*** – Gets or sets the sampling frequency. Can be set when ***IsInputEnabled*** is false.
***ThreadInvoking*** – Gets or sets whether this instance automatically synchronizes its events to the main UI thread, hence eliminating the need to call ***Control.Invoke*** method on caller's side.
***Volume*** – Gets or sets the volume, ranging from 0 to 100. Can be set when ***IsInputEnabled*** is false.
#### Methods
***GetRecordingDevices*** – Use this static method to get a list of available Windows recording devices.
***RequestStop*** – Signals this ***AudioInput*** instance to stop. Stop does not occur immediately after exiting this method. By subscribing to ***Stopped*** event, caller is notified when everything has stopped.
***Start*** – Starts reading audio from selected recording device. Started event is triggered when internal thread is about to start.
#### Events
***DataGenerated*** – Occurs when a new set of audio data has been generated. Data and its first sample’s time stamp can be read from a ***DataGeneratedEventArgs*** object that is provided as a parameter.
***Started*** – Occurs when an audio input has been started. ***StartedEventArgs*** object that is provided as a parameter, contains three public fields: ***BitsPerSample***, ***ChannelCount*** and ***SamplesPerSecond***.
***Stopped*** – Occurs when the audio input has been stopped.
#### Usage (WinForms)
##### Creation
Create a new ***AudioInput*** instance either manually in the source code or by dragging and dropping it from Visual Studio’s toolbox on to the form, user control etc.
If there is no need to show the GUI (i.e. if using an own GUI or controlling ***AudioInput*** object from the source code) then set ***Visible*** property false. ***Parent*** property is always recommended to be set so that when the parent control is disposed, ***AudioInput*** instance gets disposed automatically. If there is no parent, then ***Dispose*** method should be called when ***AudioInput*** instance is no longer needed. If a new ***AudioInput*** instance is created via Visual Studio’s toolbox, ***Parent*** property is automatically set.
##### Event handling
To get new samples from ***AudioInput*** instance, the user needs to subscribe at least to ***DataGenerated*** event. When ***DataGenerated*** event is triggered, new samples and the first sample time stamp from a ***DataGeneratedEventArgs*** object are provided as a parameter.
Subscribe to ***Started*** event to know when ***AudioInput*** instance has started its audio sampling task. A ***StartedEventArgs*** object provides information about ***AudioInput*** as a parameter, for example the number of bits per sample, is the stream audio mono or stereo, and how many samples per second are generated.
Subscribe to ***Stopped*** event to know when ***AudioInput*** instance has stopped. The event has no parameters, and its sole purpose is to tell user when everything has been stopped.
##### Configuring
Set ***ThreadInvoking = true*** to allow an ***AudioInput*** instance to synchronize its events to the main UI thread automatically but make sure that the ***AudioInput*** instance has a valid parent control. ***ThreadInvoking*** is set to false by default so do not forget to call ***Control.Invoke*** method if updating GUI in ***DataGenerated*** event handler.
Setting ***RecordingDevice*** property allows using other Windows’ recording devices than the default one. Get all available recording devices by using ***AudioInput’s*** static method ***GetRecordingDevices***.
Volume can be controlled via ***Volume*** property. Valid values are from 0 to 100 where 0 means mute and 100 maximum volume. The volume can also be set when ***AudioInput*** instance is enabled (i.e. generating samples).
Set ***SamplesPerSecond*** property to use difference sampling rate than the default (44100 Hz). Setting this property while ***AudioInput*** instance is enabled has no effect.
To use mono audio instead of stereo (default), set ***IsStereo*** to false. Setting this property while ***AudioInput*** instance is enabled has no effect.
If 8 bits per sample is preferred rather than 16 (default), set ***BitsPerSample*** property to 8. Valid values are 8 and 16 (default). This limitation comes from PCM wave format. Setting this property while ***AudioInput*** instance is enabled has no effect.
##### Starting
To start ***AudioInput*** instance, either set ***IsInputEnabled*** property true, or call ***Start*** method. ***DataGenerated*** event then provides a new set of audio samples which can e.g. be rendered using LightningChart instance.
##### Stopping
To stop ***AudioInput*** instance, set ***IsInputEnabled*** to false, or call ***RequestStop*** method. ***RequestStop*** method does not stop instantly. Instead, it signals ***AudioInput*** instance to stop as soon as it is possible. Subscribe to ***Stopped*** event to know when ***AudioInput*** instance has stopped.
#### Usage (WPF)
This chapter describes the usage of WPF version of ***AudioInput*** class. WPF version of ***AudioInput*** works mostly the same way as WinForms version. However, there are a couple of things that a WPF user should be aware of.
##### Creation
Create a new ***AudioInput*** instance either manually in code-behind or by dragging and dropping it from Visual Studio’s toolbox on to a window, user control etc.
If there is no need to show GUI (i.e. if using an own GUI or ***AudioInput*** object is controlled from the source code) then use ***AudioInput*** from **LightningChartLib.WPF.SignalProcessing** namespace. This particular class is derived from *FrameworkElement* and all its properties are bindable. For convenience, after having installed LightningChart® .NET SDK, ***LightningChartLib.WPF.SignalProcessing.AudioInput*** can also be found from Visual Studio’s toolbox so it can be dropped to a window, user control etc. and then moved in the XAML code to wherever it is needed. Necessary XML namespace will be added automatically this way.
There is also a ready-made GUI for ***AudioInput***. It can be found in ***LightningChartLib.WPF.SignalProcessing.Gui*** namespace. Visual Studio’s toolbox also has it after LightningChart® .NET SDK has been installed. Note that this is just a GUI for ***AudioInput*** class, but it contains an instance of ***AudioInput*** class which can be accessed. In other words, there is no need to create a new separate ***AudioInput*** instance.
:::info
To see EventMarkers used in example, check *ExampleAudioInput*, *ExampleAudioInputSpectrogram* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### AudioOutput component
***AudioOutput*** component allows user to convert System.Double signal data into an audio stream which is then played back through speakers or sent to Line-out connector of sound device.
#### Properties
***Balance*** – Gets or sets audio playback balance. Valid values are between -100 to 100. -100 means that audio is played only through the left speaker. 0 means that both speakers output audio. 100 means that audio is played only through the right speaker.
***BitsPerSample*** – Gets or sets how many bits are allocated per sample. Supported values are 8 and 16. If any other value is used, 16 is used instead. It can be set when ***IsOutputEnabled*** is false.
***IsOutputEnabled*** – Gets or sets the state of this instance (i.e. starts or stops it). Setting this property true is the same as calling ***Start*** method where false is the same as calling ***Stop*** method.
***IsStereo*** – Gets or sets whether to use two channels (stereo) or just one (mono). It can be set when ***IsOutputEnabled*** is false.
***PlaybackDevice*** – Gets or sets the current playback device. Can be set when ***IsOutputEnabled*** is false. By setting this property null, Windows' default playback device is used.
***SamplesPerSecond*** – Gets or sets sampling frequency. Can be set when ***IsOutputEnabled*** is false.
***Volume*** – Gets or sets volume (0-100). Can be set when ***IsOutputEnabled*** is false.
:::info
To see EventMarkers used in example, check *ExampleAudioOutputSignalReader*, *ExampleAudioOutputSignalGenerator* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### SpectrumCalculator component
***SpectrumCalculator*** component allows conversion between time domain and frequency domain.

*Example of source signal data (top) converted to frequency domain (bottom). Signal sampling frequency = 300 Hz, thus frequency scale is 300/2 = 150 Hz. The strong sine base line is 10 Hz (10 cycles / sec). Smaller signal of 100 Hz is added as noise. Both spikes are found in the power spectrum.*
The following public methods are available:
- ***CalculateForward***(double[] samples, out double[] fftData) - Converts time domain signal data to frequency domain by using FFT. Output fftData contains also negative values. Input and output data arrays must be of equal length. The length is the resolution of the data, spreading from 0 Hz to sampling frequency / 2 with equal frequency interval between output values.
- ***CalculateForward***(float[] samples, out float[] fftData) – Similar to the previous method, but for single accuracy floating point values.
***CalculateBackward***(double[] fftData, out double[] samples) - Converts frequency domain data to time domain. Makes signal samples from FFT data. Sample count equals input fftData length.
- ***CalculateBackward***(float[] fftData, out float[] samples) – Similar to the previous method, but for single accuracy floating point values.
- ***PowerSpectrum***(double[] samples, out double[] fftData) - Calculates power spectrum of signal data. Is the same as ***CalculateForward***, but with absolute output values.
- ***PowerSpectrum***(float[] samples, out float[] fftData) – Similar to the previous method, but for single accuracy floating point values.
- ***PowerSpectrumOverlapped***(double[] samples, int fftWindowLength, double overlapPercent, out double[] fftData, out int processedSampleCount) - Calculates the power spectrum by shifting the calculation windows inside source signal samples data, by overlap percent. Signal data must be longer than given FFT window length. The output FFT data is the length of fftWindowLength which is not necessarily the same as the length of the source data. The output data has absolute values.
:::info
To see EventMarkers used in example, check *ExampleFFT* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
### Signal filters
SignalProcessing namespace has built-in digital signal filters. They are designed to filter out unwanted frequencies from the acquired signal data. There are two types of filters. **Finite Impulse Response (FIR)** filters are amplitude stable, constant phase shift filters, which cause a constant lag in the data. The higher the factor count (taps), the longer the delay. ***Infinite Impulse Response (IIR)*** filters are minimal-lag filters, but introduce phase shift depending on the input frequency, and are unstable if designed poorly.
SignalProcessing namespace must be used in order to utilize signal filters. This allows creating ***FIRFilter*** and ***IIRFilter*** objects. To filter the data, call ***FilterData***(rawData, out filteredData) method of either of the objects to use the respective filter.
```csharp
using LightningChartLib.Wpf.SignalProcessing;
// Creating a FIR filter and filtersamples with it.
FIRFilter _firFilter = new FIRFilter();
double[] filteredSamples;
_firFilter.FilterData(rawData, out filteredSamples);
```
The filter classes have several methods regarding their behavior. ***SetFactor()*** for both filters and ***SetABFactors()*** for IIR filters can be used to modify the factors controlling for instance the data lag and unstable output limits. ***GetDelay()*** gets the current data lag while ***Reset()*** resets the internal delay and filtering buffers.

*Raw, unfiltered signal on the top, filtered signal on the bottom.*
:::info
To see EventMarkers used in example, check *ExampleSignalFilters* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## ViewSmith overview
Smith charts are generally used in electronics in impedance measurements and impedance matching applications.
Smith chart plots the data in real and imaginary values **(R + jX)**.

Data position is determined on 2D-plot by angular on circular Real and Imaginary log-log scales.

*ViewSmith property tree.*
### Axis
The Smith chart has only one real axis, which can be configured via extended property tree ***Axis***, see figure below.

*Smith axis property tree.*
Most of the properties are identical to [ViewPolar's axes](/docs/inDetail/Polar-overview.md) and [ViewXY's axes](/docs/inDetail/axis-class-properties.md) to customize and make the chart more attractive. There are also advanced properties specific to ***ViewSmith*** adjustment, e.g. ***GridDivCount***, ***GridImg*** and ***GridReal***, ***RealAxisLineVisible***, ***ShowAbsoluteValues***, ***ClipGridInsideGraph***.
When ***GridType*** property set as *DivCount*, ***GridDivCount*** defines the amount of circular grid lines on *Real Axes* and logarithmic grid lines on *Imaginary* scale. In contrast, when ***GridType*** property set as *Distance*, ***GridDivSpacing*** property controls the position of those line.
***GridImg*** and ***GridReal*** properties are responsible for customizing the grid lines either on *Real* or *Imaginary* scales. In addition, ***Visible*** property can be used to hide the grid, thus a user may hide one of them and continue to work with another.
***RealAxisLineVisible*** property hides the axis line.

*Real grid lines are hidden, Imaginary lines are visible.*

*Imaginary grid lines are hidden, real lines are visible.*
***ShowAbsoluteValues*** property defines which values will be on scales (absolute or normalized).
Disabling ***ClipGridInsideGraph*** makes the grid-lines visible outside the chart circle.

*ClipGridInsideGraph = False.*
The fully customized Smith chart can be seen below.

*Customized Smith chart.*
### Margins
When ***AutoSizeMargins*** is enabled, the graph size is adjusted so that there’s enough space for all the axes and chart titles. When it is disabled, ***ViewSmith.Margins*** property applies allowing setting margins manually.
In the run time, the margins rectangle can be retrieved in pixels (or DIPs) by calling ***ViewSmith. GetMarginsRect()*** method, which applies to both automatic and manual margins. It is useful when needing to do screen-coordinate based computation or object placement.
***ViewSmith. MarginsChanged*** event can be set to trigger when a margin rectangle has been changed because of, for example, resizing it.
The contents of the view are automatically clipped outside the margins. All contents are clipped other than the chart title, annotations and legend boxes as their position is defined in screen coordinates, allowing them to be freely positioned on the margins as well. A one or more pixel(s) wide border rectangle, ***Border. Width***, can be drawn to display where the margins are. By default, the border is not visible in ***ViewSmith***. The color of the rectangle can be changed via ***Border. Color***.
---
## Solve nearest data point
## Solve nearest data point (for line-series)
### Solve at X
The series implementing ***ITrackable*** interface (***SampleDataSeries***, ***SampleDataBlockSeries***, ***PointLineSeries***, ***LiteLineSeries***, ***DigitalLineSeries***, ***AreaSeries***, ***HighLowSeries***) can be solved by X screen coordinate or by X axis value.
Trackable series have methods for accurate and coarse value solving. The accurate method ***SolveYValueAtXValue*** loops through data points if necessary and finds the nearest data point match. The coarse method ***SolveYCoordAtXCoord*** uses cached rendering data of the series for solving the matching Y screen coordinate.
#### Accurate method, solving Y value by X value using data points array
```csharp
LineSeriesValueSolveResult result = series.SolveYValueAtXValue(cursor.ValueAtXAxis);
if (result.SolveStatus == LineSeriesSolveStatus.OK)
{
//PointLineSeries may have two or more points at same X value. If so, center it between min and max
yValue =(result.YMax + result.YMin) / 2.0;
return true;
}
```
**Note!** When ***cursor.SnapToPoints*** is disabled, the ***SolveYValueAtXValue*** returns interpolated value between the points adjacent to it (the intersection of cursor line and the series line).

*SolveYValueAtXValue interpolates the value between adjacent data points when SnapToPoints is disabled.*
#### Coarse method, solving Y screen coordinate by X coordinate using data points array
```csharp
LineSeriesCoordinateSolveResult result = series.SolveYCoordAtXCoord((int)Math.Round(fCoordX));
if (result.SolveStatus == LineSeriesSolveStatus.OK)
{
fCoordY = (result.CoordBottom + result.CoordTop) / 2f;
if (axisY.CoordToValue((int)Math.Round(fCoordY), out yValue) == false)
{
return false;
}
}
```
When the series holds a lot of data points, say > 100.000, it’s typically much faster to use the coarse method. However, it can be very inaccurate if the chart size or Y segment height in pixels is low. The coarse method’s screen coordinates can be converted into axis values by calling ***CoordToValue*** method of X and Y axis.
:::warning[note]
SolveYValue* methods will return interpolated point, if x-value is between adjacent points. In contrast, SolveYCoord* methods tries to find nearest point (NO interpolation).
:::
It is a good practice to use an [AnnotationXY](/docs/inDetail/annotation-XY.md) object to display values next to the cursor.

*LineSeriesCursor used to track PointLineSeries. The values are shown in an AnnotationXY object.*
#### Solving the data values from FreeformPointLineSeries / LiteFreeformLineSeries
***FreeFormPointLineSeries*** and ***LiteFreeformLineSeries*** implements methods for accurate and coarse value solving, which are mostly similar to the methods used for solving data values in the position of ***LineSeriesCursor*** for series implementing the *ITrackable* interface.
**Note!** FreeformPointLineSeries does not implement *ITrackable* interface and therefore cannot be tracked with ***LineSeriesCursor***.
The accurate method ***SolveYValuesAtXValue*** solves all Y-values for the given X-axis value and returns an iterable list of ***LineSeriesValueSolveResult***-structs.
```csharp
IList resultsAtValue = series.SolveYValuesAtXValue(value);
foreach (LineSeriesValueSolveResult result in resultsAtValue)
{
if (result.SolveStatus == LineSeriesSolveStatus.OK)
{
// Do something
}
else if (result.SolveStatus == LineSeriesSolveStatus.NoPointsFound)
{
// Do something
}
}
if (resultsAtValue.Count == 0)
{
// no points either
}
```
The coarse method ***SolveYCoordsAtXCoord*** solves all Y screen coordinates for given X screen coordinate and returns an iterable list of ***LineSeriesCoordinateSolveResult***-structs.
```csharp
IList resultsAtCoord = series.SolveYCoordsAtXCoord(value);
foreach (LineSeriesCoordinateSolveResult result in resultsAtCoord)
{
if (result.SolveStatus == LineSeriesSolveStatus.OK)
{
// Do something
}
else if (result.SolveStatus == LineSeriesSolveStatus.NoPointsFound)
{
// Do something
}
}
if (resultsAtCoord.Count == 0)
{
// no points either
}
```
If the given X-axis value or X screen coordinate hits between points, the result(s) will be formed from the interpolated value(s) / coordinate(s).
### Solve at X & Y
Line-series also have method to resolve nearest data point when X and Y is given either as screen coordinates or as axes values. Note that axes-value space and screen-coordinates space maybe stretched differently. Therefore, the shortest Euclidean distance (nearest point from reference position) may differ.
There are slight difference in name of methods used between line-series.
For ***PointLineSeries*** and ***FreeformPointLineSeries*** method names are: ***SolveNearestDataPointByCoord()*** and ***SolveNearestDataPointByValue()***.
For ***SampleDataBlockSeries***, ***SampleDataSeries***, ***LiteLineSeries***, ***LiteFreeformLineSeries*** and ***DigitalLineSeries*** method names are: ***SolveNearestSampleByValue()*** and ***SolveNearestSampleByCoord()***.
:::info
To see feature demonstration as example, check *ExampleScatterTracking*, *ExampleCursorProjectOnAxes* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## StencilAreas
[IntensityGridSeries](/docs/inDetail/IntensityGridSeries.md), [IntensityMeshSeries](/docs/inDetail/IntensityMeshSeries.md) and [Maps](/docs/inDetail/geographic-maps.md) have ***StencilArea*** feature which allows masking in or out areas of drawn data. For instance, if data is shown above a map, stencils can be used to limit the visible data to certain map areas, such as countries. ***StencilArea*** can be applied by creating a new ***StencilArea*** object, then defining its size as PointDouble2D -array via ***AddPolygon()*** or as a map layer via ***AddMapLayerIndex()***, and finally adding them to the series that should be masked.
There are two types of StencilAreas:
- ***AdditiveAreas*** creates a positive stencil mask - only data inside the area is drawn, while the outside is clipped.
- ***SubtractiveAreas*** creates a negative stencil mask - data inside the area is clipped, while the outside is drawn.
:::tip
Note that ***SubtractiveAreas*** are designed to work only together with AdditiveAreas - without them no clipping is applied.
:::
Whenever a ***StencilArea*** object is added to the list (***AdditiveAreas*** or ***SubtractiveAreas***), ***InvalidateStencil()*** or ***InvalidateData()*** should be called for the respective series. It is also recommended that the array of points defining the stencil is set in clockwise order.
### AdditiveAreas
Use ***AdditiveAreas*** to define the area that should be drawn. Everything outside it will be clipped.
```csharp
// Defining an additive StencilArea to an IntensityGrid
PointDouble2D[] stencilPoints = new PointDouble2D[] {
new PointDouble2D(30, 5),
new PointDouble2D(30, 95),
new PointDouble2D(195, 95),
new PointDouble2D(195, 5)
};
StencilArea stencilArea = new StencilArea(_intensityGrid.Stencil);
stencilArea.AddPolygon(StencilPoints);
_intensityGrid.Stencil.AdditiveAreas.Add(stencilArea);
_intensityGrid.InvalidateStencil();
```

*An IntensityGrid without any stencils on the top. On the bottom, the same grid with an AdditiveArea created by using the code above.*
### SubstractiveAreas
Use ***SubstractiveAreas*** to define areas which should not be drawn inside an ***AdditiveArea***.
```csharp
/// Defining two substractive StencilAreas to an IntensityGrid
PointDouble2D[] pnt2 = new PointDouble2D[] {
new PointDouble2D(130, 70),
new PointDouble2D(130, 90),
new PointDouble2D(160, 90),
new PointDouble2D(160, 70),
};
StencilArea stencilArea2 = new StencilArea(_heatMap.Stencil);
stencilArea2.AddPolygon(pnt2);
_heatMap.Stencil.SubtractiveAreas.Add(stencilArea2);
_heatMap.InvalidateStencil();
PointDouble2D[] pnt3 = new PointDouble2D[] {
new PointDouble2D(50, 10),
new PointDouble2D(50, 25),
new PointDouble2D(90, 25),
new PointDouble2D(90, 10),
};
StencilArea stencilArea3 = new StencilArea(_heatMap.Stencil);
stencilArea3.AddPolygon(pnt3);
_heatMap.Stencil.SubtractiveAreas.Add(stencilArea3);
_heatMap.InvalidateStencil();
```

*An IntensityGrid with two SubstractiveAreas, set by using the code above. Note that an AdditiveArea has to be set before using SubstractiveAreas.*
### Multiple StencilAreas
It is possible to set multiple ***StencilAreas***, both additive and substractive ones. In case two or more areas overlap, the areas are joined.

*Multiple StencilAreas are used. Some SubstractiveAreas overlap so the areas are joined. Transparent polygons with visible borders are also drawn to mark the locations of the stencils.*
:::info
To see feature demonstration as an example, check *ExampleMapStencil*, *Chromaticity diagram*, *ExampleSiliconWaferMap* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## StockSeries
Stock series allow stock exchange data visualization in candle-stick or stock bars format. Several stock series can be added in the same chart by adding multiple ***StockSeries*** objects in ***ViewXY. StockSeries*** list property. Select the style with ***Style*** property. The options are *Bars*, *CandleStick* and *OptimizedCandleStick*.

*StockSeries with CandleStick Style. A light blue PointLineSeries is set to go through all Close values.*
:::tip[Note]
***StockSeries*** offers only basic functionality. For more advance feature check [**TradingChart**](/docs/inDetail/trading-chart.md). ***Trader*** libraries consist of controls, tools and methods for creating trading and finance applications easily. The Trader library is built over robust and fast LightningChart API.
:::
### Styling
*OptimizedCandleStick* ***Style*** is used by default for performance reasons, starting from v.8.4. However, *OptimizedCandleStick* has only limited set of fill effects available - it only supports *Solid* and left-to-right direction *Linear* fill options (for series ***FillUp***. / ***FillDown***. **GradientFill** properties). Set ***Style*** to *CandleStick* for more advanced appearance options, including ***Bitmap***, *Radial*, *RadialStretched* and *Cylindrical* fills and borders for the candles (***FillBorder*** property). For maximum rendering performance, use *Bars* ***Style***, with ***StickWidth*** = 1.
Set the coloring and filling options with ***ColorStickDown***, ***ColorStickUp***, ***FillDown*** and ***FillUp*** properties. Adjust the stick width in pixels with ***StickWidth*** property, and the total data item width with ***ItemWidth*** property.

*StockSeries with Bars Style. Line series are used for showing linear regression fit and offset of that line (2 * standard deviation). A band is used for selecting a date range for line fit.*
### Behind
***StockSeries*** can be set to render before the line series, by setting Behind = True.
```csharp
// Modifying StockSeries properties.
stockSeries.Style = StockStyle.OptimizedCandleStick;
stockSeries.ItemWidth = 13;
stockSeries.StickWidth = 3;
stockSeries.Behind = false;
```
### Packing
***StockSeries*** also has data ***Packing*** property, which when enabled, causes data values close to each other to be packed to a single rendered item. This improves performance, especially with larger data sets, but the data might not be as accurate as without packing.
```csharp
// Enabling data packing.
stockSeries.Packing = StockSeriesPacking.On;
```
### Setting data to a StockSeries
Create a data array and set the array items. Each item has the following fields:
**Date** DateTime value (year, month, day)
**Open** Opening value of the day
**Close** Close value of the day
**Low** The lowest value during day
**High** The highest value during day
**Transaction** The total trading sum (optional)
**Volume** Count of shares traded (optional)
Keep the data always in ascending order by Date value (oldest date first).
```csharp
// Create data array
StockSeriesData[] data = new StockSeriesData[] {
new StockSeriesData(2010,09,01, 24.35, 24.76, 24.81, 23.82, 269210, 6610451.55),
new StockSeriesData(2010,09,02, 24.85, 24.66, 24.85, 24.53, 216395, 5356858.225),
new StockSeriesData(2010,09,03, 24.80, 24.84, 25.07, 24.60, 164583, 4084950.06),
new StockSeriesData(2010,09,06, 24.85, 25.01, 25.12, 24.84, 118367, 2950889.31)
};
// Assign the data array to series
chart.ViewXY.StockSeries[0].DataPoints = data;
```
### Setting X axis to date display
```csharp
chart.ViewXY.XAxes[0].ValueType = AxisValueType.DateTime;
chart.ViewXY.XAxes[0].LabelsAngle = 90;
chart.ViewXY.XAxes[0].LabelsTimeFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
chart.ViewXY.XAxes[0].MajorDiv = 24 * 60 * 60; // Major division is one day in seconds
chart.ViewXY.XAxes[0].AutoFormatLabels = false;
// Set datetime origin
chart.ViewXY.XAxes[0].DateOriginYear = data[0].Date.Year;
chart.ViewXY.XAxes[0].DateOriginMonth = data[0].Date.Month;
chart.ViewXY.XAxes[0].DateOriginDay = data[0].Date.Day;
```
Set the X axis range suitable for data:
```csharp
// X-axis stretched half a day at both ends. Use first and last date value.
chart.ViewXY.XAxes[0].SetRange(
chart.ViewXY.XAxes[0].DateTimeToAxisValue(data[0].Date) - 12 * 60 * 60,
chart.ViewXY.XAxes[0].DateTimeToAxisValue(data[data.Length - 1].Date) + 12 * 60 * 60
);
```
### Custom formatting of appearance
The ***StockSeries*** has ***CustomStockDataAppearance*** event handler, which can be used to format
appearance of series data items individually, overriding the generic fill and color styles applied with properties. In the event handler, modify width and colors for specific points.

*CustomStockDataAppearance used to highlight specific data items with greater width and brighter gradient colors.*
### Applying Scale breaks
To cut off non-trading hours and days, see [ScaleBreak, at X Axis specific properties](/docs/inDetail/axis-class-properties.md).
### Examples
:::info
To see feature demonstration as example, check *TradingMultiSegment*, *StockSeriesXY* and *StockTradingScaleBreaks* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## SurfaceGridSeries3D
***SurfaceGridSeries3D*** allows visualizing data as a 3D surface. In ***SurfaceGridSeries3D***, nodes are equally spaced in X dimension, and in Z dimension as well.

*Surface grid series with default style. Height data is made with a sine formula. Legend box shows the height coloring intervals.*

*Surface grid nodes. SizeX = 5, SizeZ = 7.*
### Setting surface grid data
- Set X range by using ***RangeMinX*** and ***RangeMaxX*** properties, to order the minimum and maximum value based on assigned X axis.
- Set Z range by using ***RangeMinZ*** and ***RangeMaxZ*** properties, to order the minimum and maximum value based on assigned Z axis.
- Set ***SizeX*** and ***SizeZ*** properties to give the grid a size as columns and rows.
Node distances are automatically calculated as

- Set Y values for all nodes:
Method, with Data array index
```csharp
for (int nodeIndexX = 0; nodeIndexX < columnCount; nodeIndexX ++)
{
for (int nodeIndexZ = 0; nodeIndexZ < rowCount; nodeIndexZ ++)
{
Y =//some height value.
gridSeries.Data[iNodeX, iNodeZ].Y = Y;
}
}
// Notify to refresh when the new values are ready
gridSeries.InvalidateData();
```
Alternative method, using SetDataValue
```csharp
for (int nodeIndexX = 0; nodeIndexX < columnCount; nodeIndexX ++)
{
for (int nodeIndexZ = 0; nodeIndexZ < rowCount; nodeIndexZ ++)
{
Y =//some height value
gridSeries.SetDataValue(nodeIndexX, nodeIndexX,
0, //X value ís irrelevant in grid
Y,
0,//Z value is irrelevant in grid
Color.Green); //Source point colors are not used in this example, so use any color here
}
}
// Notify to refresh when the new values are ready
gridSeries.InvalidateData();
```
### Creating surface from bitmap file
Surfaces can be created from bitmap images by using ***SetHeightDataFromBitmap*** method. The
surface gets the size of the bitmap (if no anti-aliasing or resampling is used). For each bitmap image
pixel, Red, Green and Blue values are summed. The greater the sum, the higher will be the height
data value for that node. Black and dark colors get lower values while bright and white colors get
higher values.

*Source bitmap and calculated surface height data. Dark values stay low while bright values get higher in the surface.*
### Fill styles
Use ***Fill*** property to select the filling style of the surface. The following options are available:
- *None*: By using this, no filling is applied. This selection is useful with wireframe meshes.
- *FromSurfacePoints*: The colors of the Data property nodes are used.
- *Toned*: ToneColor applies
- *PalettedByY*: Coloring by Y values by palette, see [Contour palette](#Contour-palette).
- *PalettedByValue*: Coloring by SurfacePoint's Value fields by palette, see [Contour palette](#Contour-palette).
- *Bitmap*: Bitmap image is stretched to cover the whole surface. Set the bitmap image in
***BitmapFill*** property. ***BitmapFill*** property has sub-properties to mirror the image vertically and horizontally.

*FromSurfacePoints fill. Color per data point.*

*Toned fill.*

*PalettedByY*

*Bitmap fill.*

*PalettedByValue*
### Contour palette
***ContourPalette*** property allows defining color steps for height coloring. ***ContourPalette*** can be used for:
- [Fill](#Fill-styles)
- [Wireframe mesh](#Wireframe-mesh)
- [Contour lines](#Contour-lines)
An unlimited count of steps can be defined for contour palette. Each step has a height value and a corresponding color.
The palette includes ***MinValue***, ***Type*** and ***Steps*** properties. For ***Type***, there are two choices: *Uniform* and *Gradient*. The contour palette of below figure:
- ***MinValue***: 0
- ***Type***: Gradient
- ***Steps***:
- Steps[0]: MaxValue: 25, Color: Red
- Steps[1]: MaxValue: 50, Color: Blue
- Steps[2]: MaxValue: 75, Color: Lime
- Steps[3]: MaxValue: 100, Color: White
The height values below first step value are colored with first step’s color.

*Surface grid series contour palette Type is set to Gradient.*
### Wireframe mesh
Use ***WireframeType*** to select the wireframe style. The options are:
- *None*: no wireframe
- *Wireframe*: a solid color wireframe. Use ***WireframeLineType.Color*** to set the color.
- *WireframePalettedByY*: wireframe coloring follows SurfacePoint's *Y* field ***ContourPalette*** (see [Contour palette](#Contour-palette)).
- *WireframePalettedByValue*: wireframe coloring follows SurfacePoint's *Value* field, ***ContourPalette*** (see [Contour palette](#Contour-palette)).
- *WireframeSourcePointColored*: wireframe coloring follows the color of the surface nodes
- *Dots*: wireframe lines consist of solid color dots.
- *DotsPalettedByY*: wireframe lines consist of dots colored by ***ContourPalette*** according to *Y* field of SurfacePoints.
- *DotsPalettedByValue*: wireframe lines consist of dots colored by ***ContourPalette*** according to *Value* field of SurfacePoints.
- *DotsSourcePointColored*: wireframe lines consist of dots whose coloring follows the color of the surface nodes.
Wireframe line style (***Color***, ***Width***, ***Pattern***) can be edited via ***WireframeLineStyle***.
:::note
Palette colored wireframe lines and dots may conflict with ***WireframeLineStyle.Pattern*** settings, for example *Dash* linestyle with wireframe set to *Dots*. Use solid line in one or the other.
:::

*WireframeType = Wireframe.*

*WireframeType = WireframePalettedByY.*

*WireframeType = SourcePointColored.*

*WireframeType = Dots.*

*WireframeType = DotsPalettedByY.*

*WireframeType = DotsSourcePointColored.*
#### Wireframe simultaneously with fill
When fill and wireframe are drawn in the same position in 3D model, Z-fighting may appear. It can be seen as broken wireframe lines. That is because it is impossible for the GPU to determine which object is closer to camera.

*Surface grid wireframe with filling. Z-fighting appears as broken wireframe lines.*
To prevent Z-fighting from occurring, use ***WireframeOffset*** or ***DrawWireframeThrough*** property. By using ***WireframeOffset***, the wireframe is moved slightly in 3D model space. ***DrawWireframeThrough*** draws the wireframe through the filling, whether or not the part of the surface is visible to the camera.

*WireframeOffset = (X=0; Y=0.1; Z=0).*

*DrawWireframeThrough is enabled.*
### Contour lines
Contour lines allow quick interpretation of height data without filling the surface with paletted fill. Contour lines can be used combined with fill and wireframe. By setting ***ContourLineType*** property, contour lines can be drawn with different styles:
- *None*: no contour lines are shown
- *FastColorZones*: The lines are drawn as thin vertical zones. Allows very powerful rendering, which suits well for continuously updated or animated surface. Steep height changes are shown as thin line, as gently sloping height differences are shown with thick line. All lines use the same color defined as ***ContourLineColor*** property. The zone height can be set by ***FastContourZoneHeight*** property.
- *FastPalettedZones*: Like *FastColorZones*, but line coloring follows ***ContourPalette*** options (see [Contour palette](#Contour-palette)).
- *ColorLineByY* and *ColorLineByValue*: Contour lines are made with actual lines. Rendering takes longer than *FastColorZones*. The line width and color can be adjusted with ***ContourLineWidth*** and ***ContourLineColor*** properties. Contour lines can also be shifted with ***WireframeOffset*** property (if ***ContourLineWidth*** ≤1), to remove possible Z-fighting with filling.
- *PalettedLineByY* and *PalettedLineByValue*: like *ColorLineByY* and *ColorLineByValue*, but line coloring follows ***ContourPalette*** options (see [Contour palette](#Contour-palette)).

*ContourLineType = FastColorZones.*

*ContourLineType = FastPalettedZones.*

*ContourLineType = ColorLine.*

*ContourLineType = PalettedLine.*

*ContourLineType = PalettedLineByValue.*
### Fadeaway
***SurfaceGridSeries3D***, [SurfaceMeshSeries3D](/docs/inDetail/SurfaceMeshSeries3D.md) and [WaterfallSeries3D](/docs/inDetail/WaterfallSeries3D.md) have a ***FadeAway*** property, which allows fading away the series towards the back of the chart. ***FadeAway*** is measured in percents, valid range being from 0 (no fadeaway, the default value) to 100 (full fadeaway). The higher the value, the more transparent the data with high Z value will become.
### Scrolling surface data
***SurfaceGridSeries3D*** and [SurfaceMeshSeries3D](/docs/inDetail/SurfaceMeshSeries3D.md) have ***InsertRowBackAndScroll*** and ***InsertColumnBackAndScroll*** methods for performance optimized periodical data adding. They insert a new data row or column into the surface series’ data table while dropping the oldest values, i.e. the first data row off. Consider the following 3D spectrum display (figure below). New FFT values are added as a new row (close to camera), and the old data and the time axis (Z axis) must be scrolled. The oldest surface values must be dropped off.
***InsertRowBackAndScroll*** and ***InsertColumnBackAndScroll*** take the new data as a double array, but also require new minimum and maximum values for both surface series and the scrolled axis (Z dimension/axis for ***InsertRowBackAndScroll*** and X dimension/axis for ****InsertColumnBackAndScroll****). This constant adjusting of series and axis ranges enables the scrolling effect.

*Presenting 3D spectrum with surface grid. InsertRowBackAndScroll method is used for performance optimized data adding. Fadeaway property is 100 to make the surface smoothly fade away towards the back of the chart. A perspective camera is used.*

*A spectrogram with surface grid. InsertColumnBackAndScroll method is used. An orthographic camera above the model gives straight and perpendicular projection. SuppressLighting is enabled to remove unwanted light reflections. Fadeaway = 0 for making the grid series fully visible.*
### Handling transparency
See [TransparencyRenderMode](/docs/inDetail/transparency-render-mode.md).
### Examples
:::info
To see feature demonstration as example, check *SimpleSurfaceGrid3D*, *SurfaceFlatContourProjection*, *SurfaceGridValueColored* and *SurfaceWater3D* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## SurfaceMeshSeries3D
***SurfaceMeshSeries3D*** is almost similar to [SurfaceGridSeries3D](/docs/inDetail/SurfaceGridSeries3D.md) as they both mostly have the same properties. The biggest difference is that surface nodes can be positioned freely in 3D space. In other words, the surface does not have to be rectangular. ***SurfaceMeshSeries3D*** allows warping the surface virtually to any shape, for example to a sphere or a human head.

*Surface mesh nodes. SizeX = 4, SizeZ =4.*

*SurfaceMeshSeries3D, geometry made as a pipe.*
### Setting surface mesh data
- Set ***SizeX*** and ***SizeZ*** properties to give the grid a size as columns and rows.
- Set X, Y and Z values for all nodes:
Method, with Data array index
```csharp
for (int nodeIndexX = 0; nodeIndexX < columnCount; nodeIndexX ++)
{
for (int nodeIndexZ = 0; nodeIndexZ < rowCount; nodeIndexZ ++)
{
meshSeries.Data[nodeIndexX, nodeIndexZ].Y = xValue;
meshSeries.Data[nodeIndexX, nodeIndexZ].Y = yValue;
meshSeries.Data[nodeIndexX, nodeIndexZ].Z = zValue;
meshSeries.Data[nodeIndexX, nodeIndexZ].Value = dataValue;
}
}
// Notify to refresh when the new values are ready
meshSeries.InvalidateData();
```
Alternative method, usage of SetDataValue
```csharp
for (int nodeIndexX = 0; nodeIndexX < columnCount; nodeIndexX ++)
{
for (int nodeIndexZ = 0; nodeIndexZ < rowCount; nodeIndexZ ++)
{
meshSeries.SetDataValue(nodeIndexX, nodeIndexZ,
xValue,
yValue,
zValue,
dataValue,
Color.Green); // Source point colors are not used in this example, so use any color here
}
}
// Notify to refresh when the new values are ready
meshSeries.InvalidateData();
```
### Examples
:::info
To see feature demonstration as example, check *ExampleSurfaceMesh3D*, *ValueBased3DContouring*, *SteppingMesh3D*, *GlobeSurface3D* and *SurfaceMeshBars* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## TradingChart
***Trader*** libraries (*LightningChart.WPF.Trading.NET4.dll* / *LightningChart.WinForms.Trading.NET4.dll*) consist of controls, tools and methods for creating trading and finance applications easily. The Trader library is built over robust and fast LightningChart API.
***TradingChart*** is currently the main control. ***TradingChart*** comes with a compact interface of properties and methods to build trading applications, without the API overhead that comes from complex engineering applications. Current version includes WPF and WinForms Forms charts.
This document illustrates the basic usage of LightningChart® ***TradingChart*** as well as most of its available properties and settings. There are also several ***TradingChart*** based examples in [Interactive Examples](/docs/getting%20started/RunningDemo.md) application. It is recommended to check those as well to get better understanding of building trading applications with ***TradingChart***.
### Basic usage
#### Creating TradingChart
In order to use ***TradingChart***, corresponding assemblies should be added to the project. First, add *LightningChart. WPF / WinForms .Trading.NET4.dll* to the References of the project. Reference to the regular LightningChart control (*LightningChart. WPF / WinForms .Charting.NET4.dll*) should also be added to ensure all the chart’s features work properly. Next import all the types from Trader namespace with
```csharp
using LightningChartLib.WPF.Trader;
// OR
using LightningChartLib.WinForms.Trader;
```
Now it is possible to create TradingChart -objects.
```csharp
// Creating a TradingChart component
TradingChart _chart = new TradingChart();
// WPF. Adding chart into the parent container, in this case a grid.
(Content as Grid).Children.Add(_chart);
// WinForms. Adding chart into the parent container, in this case a Form.
_chart.Parent = this;
_chart.Dock = DockStyle.Fill;
```
It is also possible to create a ***TradingChart*** component by dragging it from Visual Studio’s toolbox.
If successfully created, TradingChart should look like the following.

*A TradingChart has been created and added to a container.*
#### Deploying TradingChart
To be able to run ***TradingChart*** applications in computers the software is deployed into, a Deployment Key has to be applied in code. This is done similarly to regular LightningChart (see [Deployment](/docs/beginners%20guide/deploymentV11.md)). Reference to the internal charting component has to be added to the project: *LightningChartLib.WPF.Charting.LightningChart* / *LightningChartLib.WinForms.Charting.LightningChart*.
### Configuring user interface
***TradingChart*** has several properties to control the appearance of the user interface.
#### Setting color-theme
***TradingChart*** has several pre-defined color-themes to choose from. ***SetAppearance()*** -method can be used to change the theme.
```csharp
// Setting a color-theme.
_chart.SetAppearance(Appearance.Dark);
```
Color-theme can also be changed via the color menu located in the toolbar on the left of the chart.

*Some of the pre-defined color-themes*
:::note
Note that changing color-theme overrides manually set colors for indicators and drawing tools. Therefore, individual colors should be modified only after setting the color-theme.
:::
#### Setting price chart type
***TradingChart*** has several price chart types available: *Candlesticks, Bars, Line and Mountain*. Chart type button in the toolbar can be used to switch between the types during runtime. ***PriceChartType*** -property can be used to change the chart type in code.
```csharp
// Show trading data as a mountain.
_chart.PriceChartType = PriceChartType.Mountain;
```

*Available price chart types: Candlesticks, Bars, Line and Mountain.*
#### UI components
***TradingChart’s*** user interface consists of two main parts: the chart itself and the toolbar located on the left of the chart. The latter can be shown and hidden by pressing the arrow button on the bottom-left corner of the chart. Also, when adding study indicators (indicators appearing below the price chart), additional button appears in the indicator’s segment, allowing user’s to remove the indicator if needed.

*TradingChart’s main user interface components.*
Time range button in the toolbar opens a selection of pre-defined time ranges, allowing users to change the shown time range while the application is running.
Indicator and drawing tool menus open a list of available indicators and drawing tools respectively. Clicking an indicator on the list adds it to the chart, while clicking on a drawing tool initiates drawing. See drawing tools chapter for further information.
The remaining two buttons on the toolbar are chart type button for changing the current chart type and color menu for changing the color-theme. Check previous chapters for further details.
The toolbar can also be hidden in code by disabling ShowToolbar property.
```csharp
// Hiding the toolbar.
_chart.ShowToolbar = false;
```
Some technical indicators such as *MACD* and *RelativeStrengthIndex* are drawn in a separate segment below the chart. In these cases, a horizontal line called Segment splitter is automatically drawn between the segments. Dragging this line by mouse allows modifying the heights of the segments. Segment splitters can be hidden by disabling ***ShowSegmentSplitters*** -property. This also prevents modifying the segment heights by mouse dragging.
```csharp
// Hide the vertical lines drawn between segments.
_chart.ShowSegmentSplitters = false;
```
### Using internal LightningChart control
***TradingChart*** is built on top of a regular ***LightningChart*** control. ***GetInternalChart()*** -method allows direct access to this internal chart instance and all of its properties. It is therefore possible to have a combination of features from both charts. To access the internal chart a reference to respective assembly must be included in the project (i.e. *LightningChart.WPF.Charting.NET4*).
```csharp
// Changing properties of the internal chart
LightningChart chart = _tradingChart.GetInternalChart();
chart.ViewXY.GraphBackground.Color = Colors.Black;
// Alternatively
_tradingChart.GetInternalChart().ViewXY.GraphBackground.Color = Colors.Black;
// Adding a regular Annotation to a TradingChart
LightningChart chart = _tradingChart.GetInternalChart();
AnnotationXY anno = new AnnotationXY(chart.ViewXY, chart.ViewXY.XAxes[0], chart.ViewXY.YAxes[0]);
chart.ViewXY.Annotations.Add(anno);
```
It should be noted that changing properties of ***TradingChart*** may override settings done directly to the internal chart control. For example, modifying the appearance of ***TradingChart*** overrides the above [GraphBackground](/docs/inDetail/background-fill.md) color setting. Furthermore, actions such as adding various series to their respective collections should be done with caution as the same collections are also used by the ***TradingChart*** series.
```csharp
// Example of a conflicting situation.
LightningChart chart = _tradingChart.GetInternalChart();
StockSeries stockSeries = new StockSeries(chart.ViewXY, chart.ViewXY.XAxes[0], chart.ViewXY.YAxes[0]);
chart.ViewXY.StockSeries.Add(stockSeries);
chart.ViewXY.StockSeries[0].Visible = false;
```
The above example does not change the visibility of the newly added ***StockSeries***, instead the OHLC-data loaded to TradingChart will be hidden as the same ***StockSeries*** collection is used by the ***TradingChart*** and its internal chart. The loaded OHLC-data is rendered using a ***StockSeries*** which reserves the first index of that collection.
### Adding trading data
Trading data can be added to TradingChart by setting data in code via ***SetData()*** and ***AddData()*** methods, or by reading from a csv-file. In the former case, the trading data can be from any source as long as it can be presented in OHLC-format. The data source is up to the user to define, as LightningChart does not offer any built-in data providers.
#### Adding data in code
***TradingChart*** has several methods to add, update and remove trading chart.
***SetData*** method sets an array of new data points to the chart, replacing the old data. The array entries are of OhlcData type, each consisting of Open, High, Low, Close and DateTime fields, as well as optional Volume and OpenInterest fields. The method also allows setting currency and title for the dataset.
```csharp
// Using SetData to set new dataset to the chart.
OhlcData[] data = new OhlcData[]
{
new OhlcData() { Open = 10, High = 12, Low = 9, Close = 11, DateTime = new DateTime(2025, 10, 20), Volume = 150 },
new OhlcData() { Open = 11, High = 13, Low = 10, Close = 10, DateTime = new DateTime(2025, 10, 21), Volume = 200 },
new OhlcData() { Open = 9, High = 12, Low = 8, Close = 10, DateTime = new DateTime(2025, 10, 22), Volume = 250 }
};
_chart.SetData(data, "USD", "StockName");
```
***AddData*** method adds one or more data points to the end of the existing data. It works similarly to SetData, but has one more optional parameter: *zoomToFit* which when enabled, automatically zooms the chart to fit all data on screen after the new data has been added. This setting is enabled by default.
```csharp
// Using AddData to add one data point at the end of existing data.
_chart.AddData(new OhlcData[] { new OhlcData() { Open = 14, High = 16, Low = 10, Close = 13, DateTime = new DateTime(2025, 10, 23), Volume = 350 } }, "USD", "StockName", true);
```
***UpdateLastDataPoint*** updates the last (newest) data point of the current set displayed in the chart. Even though the method takes DateTime value as part of OhlcData struct, it does not update the time stamp of the point, only OHLC-values and optional Volume and Open Interest values are affected.
```csharp
// Updating the last data point. Given DateTime value has no effect.
_chart.UpdateLastDataPoint(new OhlcData() { Open = 13, High = 16, Low = 11, Close = 14, DateTime = new DateTime(2025, 10, 23), Volume = 340 });
```
***ClearData*** removes all trading data from the chart. It also takes two parameters, *clearIndicators* and *clearDrawingTools*, which allow removing all added technical indicators and drawing tools if necessary.
```csharp
// Removing all data. Added indicator are kept while drawing tools are removed.
_chart.ClearData(false, true);
```
#### Reading data from file
***TradingChart*** can read trading data directly from a .csv -file via ***GetOhlcDataFromFile()*** -method. It takes file name (and path) as a parameter and returns an array of OHLC -data.
```csharp
// Read trading data from a file
OhlcData[] dataFromFile = _chart.GetOhlcDataFromFile("fileName.csv");
```
***GetOhlcDataFromFile()*** -method assumes that the data in the file is in the following column order: DateTime, Open, Close, High, Low, Volume (Optional), OpenInterest (Optional). DateTime field doesn’t have to contain hours, minutes and seconds. Currently, accepted date formats are “yyyy-mm-dd”, “yy-mm-dd” and “dd-mm-yyyy”. Accepted separators include dash (-) and backslash (/).
After the data has been read, use ***SetData()*** -method to add the data to the chart:
```csharp
// Set data to the chart
_chart.SetData(dataFromFile, "Symbol", "Data set title");
```
Loading data from a file automatically adjusts the time range of the chart based on the first and the last DateTime values of the data set.
#### Adjusting time range
The time range of the chart can be adjusted via the toolbar on the left of the chart. The top button in the toolbar shows the current selected time range. Clicking it opens a time range selection menu, showing all available time range options. Clicking one of these options automatically modifies the trading data based on the selected time value.
If the selected time range is longer that the length of available data, time range will be adjusted based on the data. For instance, if three years is selected but there is only one year of data available, time range of one year will be shown. Furthermore, the selected time range is always based on the latest time value of the loaded data set. For example, if the latest date of the data is 31.08.2025, selecting one-year time range shows data between 01.09.2025 – 31.08.2025.
TradingChart also allows setting the time range in code. ***SetTimeRange()*** -method takes *startTime* and *endTime* parameters, that define the desired time range. The method also takes optional third parameter, *dropDataOutsideRange*, which when enabled (default option) drops all data outside the given range.
```csharp
// Adjust time range to show the first half of the year 2025. Drop other data.
_chart.SetTimeRange(new DateTime(2025, 1, 1), new DateTime(2025, 6, 30), true);
```
:::note
Note that pressing the time range buttons in the toolbar, or loading data from a file, overrides the time range set by SetTimeRange().
:::
### Data cursor
***TradingChart*** has a built-in data cursor which automatically tracks the visible trading data and technical indicators and shows their current values in a legend box. The cursor tracks data and indicators that are in the segment the cursor is currently over on. For instance, if a *Relative Strength Index* indicator has been added to the chart, its values will not be tracked as they are shown in a separate segment below the chart, unless the cursor is moved over that segment.Data cursor does not track drawing tools.
Data cursor tracks the Close values of the OHLC-data by default. This can be changed via ***OhlcField*** property.
```csharp
// Set cursor to track High values.
_chart.DataCursor.OhlcField = PriceChartOhlcField.High;
```
By default, all data and every indicator will be tracked. It is however possible to control which series should be tracked. ***TrackOhlcData*** -property can be disabled to prevent the cursor from tracking the OHLC data.
```csharp
// Data cursor doesn’t track the OHLC data loaded to chart.
_chart.TrackOhlcData = false;
```
Disabling ***TrackOhlcData*** affects only the OHLC data, indicators will still be tracked. To prevent cursor from tracking specific indicators, their ***TrackIndicator*** property can be disabled.
```csharp
// Stops tracking this indicator
simpleMovingAverage.TrackIndicator = false;
```
***TrackIndicator*** is available for indicators which are drawn in the same segment as OHLC data. In other words, segment indicators such as *MACD* and *Relative Strength Index* are always tracked if mouse is moved over the segments they belong to.

*Data cursor tracking trading data and every added indicator. The price values are shown in the legend box next to the cursor. Relative Strength Index is not tracked since it is shown in a separate segment.*
### Data packing
TradingChart has ***DataPacking*** property which when enabled, causes data values close to each other be packed to a single rendered item. This improves performance, especially with larger data sets, but the data might not be as accurate as without packing.
```csharp
// Enabling data packing.
_chart.DataPacking = true;
```
### Technical indicators
***TradingChart*** has several built-in Technical Indicators, which are automatically calculated based on the loaded trading data. Some indicators also have certain user-defined property settings affecting the calculations, for example, time period count for determining the number of time periods the indicator is based on.
#### Adding indicators
TradingChart has an ***Indicators*** list which is used to store all technical indicators. To add any technical indicator to the chart, first create and configure the indicator, then add it to ***Indicators*** -list.
For example, adding a ***RelativeStrengthIndex***:
```csharp
RelativeStrengthIndex rsi = new RelativeStrengthIndex()
{
LineWidth = 1f,
PeriodCount = 14,
HighColor = Colors.Lime,
LowColor = Colors.Red
};
_chart.Indicators.Add(rsi);
```
All available indicators can also be added via the indicator menu found in the toolbar. Clicking an indicator in the menu adds it to the chart as well as to the ***Indicators*** -list. The indicators added this way always use their default settings for properties such as ***PeriodCount***.
#### Removing indicators
Removing technical indicators can be done by removing them from TradingChart’s ***Indicators*** list. The indicator is automatically disposed after removing it from the list.
```csharp
_chart.Indicators.Remove(indicator);
```
Removing all indicators of same type:
```csharp
List itemsToRemove = new List();
foreach (Indicator ind in _chart.Indicators)
{
if (ind is RelativeStrengthIndex)
itemsToRemove.Add(ind);
}
foreach (Indicator i in itemsToRemove)
_chart.Indicators.Remove(i);
```
Indicators can also be removed via the user interface. Overlay indicators (drawn on top of the price data) can be removed by right-clicking them and selecting “Yes” from the confirmation window that appears. Study indicators (indicators appearing in their own segments) can be removed by pressing Remove button located near the top-left corner of the indicator’s segment.

*Bollinger Band has been right-clicked. Remove indicator button is also marked in the image.*
#### Indicator types and properties
Technical indicators are either drawn on top of the trading data in the main segment (overlay), or in a separate segment below the chart (study) in which case the segment is automatically created when the indicator is added.
Indicators have several properties that can be used to modify their appearance or the calculations they are based on. These properties can be modified when the indicator is created or any time after its creation.
```csharp
// Modifying indicator properties after its creation.
rsi.PeriodCount = 10;
rsi.LineColor = Colors.Blue;
rsi.LineWidth = 2;
```
Common indicator properties:
- ***PeriodCount*** Set the number of time periods used to calculate indicator values. Default value depends on the indicator.
- ***LineWidth*** Set the width of the indicator line where applicable. If the indicator composes of several lines, the property affects them all.
- ***Color*** Set the color of the indicator line where applicable. If the indicator composes of several lines, there is a separate Color-property for each line.
- ***TrackIndicator*** When enabled, data cursor will track this indicator and show its current value in the legend box. Only applicable to indicator shown on top of the trading data. Indicators in separate segments are always tracked.
- ***LimitYToStackSegment*** If enabled, the indicator is clipped outside its segment.
Some technical indicators also have properties that are specific to that indicator, for instance ***NumberOfStandardDeviations*** for *Bollinger Band*. These properties are set similarly to the common properties.
#### List of available indicators (and their abbreviations)
**Envelopes**
- Bollinger Band
- Donchian Channels
- Fractal Chaos Bands
- High Low Bands
- Keltner Channels
- Moving Average Envelopes (MAE)
- Prime Number Bands
- Standard Error Bands
- Stoller Average Range Channel
**Moving Averages**
- Exponential Moving Average (EMA)
- Simple Moving Average (SMA)
- Triangular Moving Average (TMA)
- Time Series Moving Average (TSMA)
- Variable Index Dynamic Average (VIDYA)
- Variable Moving Average (VMA)
- Volume Weighted Moving Average (VWMA)
- Weighted Moving Average (WMA)
- Welles Wilder’s Smoothing Average (WWS)
**Oscillators – Money Flow**
- Accumulation/Distribution (A/D)
- Chaikin Money Flow
- Chaikin Oscillator
- Ease of Movement
- Elder’s Force Index
- Klinger Volume Oscillator (KVO)
- Market Facilitation Index
- Money Flow Index
- Negative Volume Index
- On-Balance Volume (OBV)
- Positive Volume Index
- Price Volume Trend
- Trade Volume Index
- Twiggs Money Flow
- Volume
- Volume Oscillator
- Volume Rate of Change (Volume ROC)
- Williams Accumulation Distribution (Williams AD)
- Williams Variable Accumulation Distribution (WVAD)
**Oscillators – Price**
- Aroon Oscillator
- Awesome Oscillator
- Balance of Power
- Commodity Channel Index (CCI)
- Center of Gravity
- Chande Forecast Oscillator (CFO)
- Chande Momentum Oscillator (CMO)
- Coppock Curve
- Detrended Price Oscillator
- Elder-Ray Index
- Elder Thermometer (custom version)
- Fractal Chaos Oscillator (FCO)
- Intraday Momentum Index (IMI)
- Moving Average Convergence Divergence (MACD)
- Moving Average Convergence Divergence Custom (MACD Custom)
- Momentum Oscillator
- Percentage Price Oscillator (PPO)
- Performance Index
- Pretty Good Oscillator
- Prime Number Oscillator (PNO)
- QStick
- Rainbow Oscillator
- Rate of Change (ROC)
- Relative Strength Index (RSI)
- Stochastic Momentum Index (SMI)
- Stochastic Oscillator
- Stochastic Oscillator Smoothed
- True Strength Index (TSI)
- Ultimate Oscillator
- Ultimate Oscillator Smoothed (UO ST)
- Williams Percent Range (Williams %R)
**Statistics**
- Correlation Coefficient
- Kurtosis
- Median Price
- Skewness
- Standard Deviation
- Standard Error
- Typical Price
- Weighted Close
**Trend Indicators**
- Accumulative Swing Index (ASI)
- Average Directional Index (ADX)
- Aroon
- Gopalakrishnan Range Index (GAPO)
- Ichimoku Cloud
- Linear Regression
- Parabolic Stop-and-Reverse (PSAR)
- Random Walk Index
- Range Action Verification Index (RAVI)
- Schaff Trend Cycle (STC)
- Schaff Trend Cycle Signal (STC Signal)
- System Quality Number Trend (SQN Trend)
- Supertrend
- Swing Index
- Triple Exponential Average (TRIX)
- Vertical Horizontal Filter (VHF)
**Volatility**
- Average True Range (ATR)
- Chaikin Volatility
- Ehler Fisher Transform
- High Minus Low
- Historical Volatility
- Mass Index
- Z-Value
**Other Indicators**
- Open Interest
#### Custom indicators
TradingChart allows users to create their own custom indicators. There are three custom indicator types to choose from.
##### Custom Overlay
*Custom Overlay* allows adding a single line to top of the price data. It can be configured using the same ***LineWidth***, ***LineColor*** etc. properties as other similar indicators. However, *Custom Overlay* has two major differences. First, its values are not automatically calculated based on the trading data. Instead, ***AddDataValues()*** method should be used to assign values to the indicator. The method accepts an array of double values. Second, *Custom Overlay* has ***Offset*** property, which can be used to set horizontal offset to the indicator. This can be used to place the indicator in a correct position in relation to the price data.
```csharp
// Creating Custom Overlay indicator.
CustomOverlay co = new CustomOverlay();
co.LineColor = Colors.Green;
co.Offset = 10;
_chart.Indicators.Add(co);
co.AddDataValues(myDoubleArray);
```
##### Custom Study
*Custom Study* creates a custom indicator below the price chart in a separate segment. It is composed of one or more lines or histograms, which means the indicator configuration and data addition is done differently from *Custom Overlay*. ***AddDataSeries***() -method takes an array of double values, as well as information about the indicator type (line or histogram), indicators color, name, and optional bar width used for histograms.
```csharp
// Creating Custom Study indicator.
CustomStudy cs = new CustomStudy();
cs.Offset = 10;
_chart.Indicators.Add(cs);
cs.AddDataSeries(myDoubleArray, true, Colors.Green, "IndicatorName", 2);
```
##### Two Histograms and Line
*Two Histograms and Line* is a custom indicator which allows showing given data in a separate segment using two histogram and a line. Unlike the other indicators the data isn’t based on the loaded OHLC-dataset. Instead, a separate dataset can be assigned to the indicator.
Properties and methods specific to Two Histograms and Line:
- ***LineSeriesTitle*** Sets the title for the indicator line.
- ***HistogramColor1*** / ***HistogramColor2*** Sets the color for the bars in the respective histogram.
- ***HistogramWidth1*** / ***HistogramWidth2*** Sets the width for the bars in the respective histogram.
- ***HistogramTitle1*** / ***HistogramTitle2*** Sets the title for the respective histogram.
- ***HistogramsStacked*** When enabled, the two histograms are stacked on top of each other.
- ***AddLine()*** Adds the line to the indicator. Needs a DateTime array, Y-value array, line width and color as parameters. Note that this should be called after the indicator has been added to the chart’s indicator collection.
- ***AddHistogram()*** Adds a histogram to the indicator. Needs a DateTime array, Y-value array, bar width, color and histogram index as parameters. The last parameter accepts values 1 and 2. The number indicates which histogram should be added or updated. Note that this should be called after the indicator has been added to the chart’s indicator collection.

*A custom indicator, Two Histograms and Line*
#### Nested indicators
From Trader version 3.0 (LightningChart v 12.4) onwards, ***TradingChart*** has nested indicators feature. This allows indicators to use other indicators as a basis of their calculations instead of just the price data. For instance, A *Simple Moving Average* can be set to be based on a *Relative Strength Index*, causing it to be drawn on top of that instead of on top of the price data.
***SetSource()*** -method can be used to assign indicators as sources for other indicators. The method also accepts *OhlcField* enumerator value in case user wants the indicator to use other values besides Close values as a source.
```csharp
// Setting Relative Strength Index as the source for the Simple Moving Average.
// Both indicators have been created earlier in the code.
sma.SetSource(rsi);
// Set Simple Moving Average to be based on High values instead of Close values.
sma.SetSource(OhlcField.High);
```
If the contents of the chart’s ***Indicators*** list are known, it can also be used to set the source.
```csharp
(_chart.Indicators[0] as SimpleMovingAverage).SetSource(_chart.Indicators[1], 0);
```

*Simple Moving Average based on Relative Strength Index.*
***SetSource()*** also takes an optional *seriesIndex* parameter. This is used when the source indicator consists of more than one component. For example, *seriesIndex* can be used to control whether an indicator uses *Bollinger Band’s* upper, mid, or lower band as the source.
:::note
Note that if an indicator’s formula uses more than one OHLC-data fields, the source will replace Close values in it. In case Close values are not used, High values are replaced instead.
Nested indicators feature is not available for custom indicators or Open Interest. Furthermore, indicator cannot be set to its own source.
:::
### Drawing tools
Drawing tools are visual tools which can be freely drawn on the ***TradingChart***. All drawing tools, except *FreehandAnnotation*, are based on one or more control points. The first point is set when drawing a drawing tool has started. The next control points are set when the chart is left-clicked. These control points can also be moved by dragging them after they have been set. Drawing tools are drawn and updated in real-time during drawing and while control points are being moved.

*Trend line has been drawn. Control points can be seen at both ends of the line.*
#### Adding drawing tools
TradingChart has a build-in drawing tool menu for drawing tools, located in the toolbar to the left of the chart. Opening the menu and selecting a drawing tool instantiates the respective drawing tool and enters drawing mode, meaning that left-clicking the chart adds the first control point. Afterwards, each click adds another control point until all points are drawn.
Drawing tools can also be drawn by calling their ***StartDrawing()*** method. After the method has been called, drawing is started as soon as the chart is left-clicked, which then sets the first control point.
```csharp
// Start drawing a yellow Trend line.
TrendLine trendLine = new TrendLine();
trendLine.LineColor = Colors.Yellow;
_chart.DrawingTools.Add(trendLine);
trendLine.StartDrawing();
```
Adding drawing tools in code behind works similarly to adding technical indicators. TradingChart has ***DrawingTools*** list which is used to store all the drawing tools. However, since drawing tools are drawn based on two control points, these points have to be set via ***SetControlPointsAndDraw()*** -method.
```csharp
// Adding a drawing tool in code behind
FibonacciArc fibonacciArc = new FibonacciArc();
fibonacciArc.FillEnabled = true;
_chart.DrawingTools.Add(fibonacciArc);
// Setting control points.
fibonacciArc.SetControlPointsAndDraw(
new Point(10, 200),
new Point(20, 300)
);
```
:::note
Note that drawing tool has to be added to ***DrawingTools*** collection before setting its control points. Furthermore, it is currently not possible to add ***FreehandAnnotations*** in code behind.
:::
#### Removing drawing tools
Drawing tools can be removed by highlighting one of the control points via mouse over and pressing Delete key. Removing drawing tools in code is done similarly to indicators (see [Removing indicators](#Removing-indicators)). There is also ***DisposeAllDrawingTools()*** -method, which removes all drawing tools from the chart.
```csharp
// Clears and disposes all drawing tools.
_chart.DisposeAllDrawingTools();
```
When new trading data is set to chart or when time range is changed via time range buttons, all drawing tools are by default automatically cleared. ***AutoClearDrawingTools*** -property controls this functionality. Its default value ***NewDataAndTimeRange*** causes the above behaviour. Setting the property to *NewData* option clears drawing tools when a new data set is loaded, but not when time range is changed. *None* prevents all automatic clearing (calling ***DisposeAllDrawingTools()*** -method still works).
```csharp
// Clear drawing tools when new data set is loaded but not when time range is changed.
_chart.AutoClearDrawingTools = ClearDrawingTools.NewData;
```
#### List of Drawing tools
There are several properties that all drawing tools have.
Common drawing tool properties:
- ***LineColor*** Set the color of all the lines the drawing tool has. Affects also control points.
- ***LineWidth*** Set the width of all the lines the drawing tool has. Affects also control points.
- ***LabelColor*** If the drawing tool has text labels, changes their color.
- ***Magnetic*** When enabled, the drawing tool lines are automatically attached to the nearest OHLC-value in vertical direction. Disabled by default.
- ***LimitYToStackSegment*** If enabled, the drawing tool is clipped outside the main segment.
[add empty line]: #
##### Elliot Wave
Elliot Wave draws a wave pattern between several control points.
Properties specific to Elliot Wave:
- ***WaveType*** Changes the type of the wave. The wave types differ in length and in the markings used.

*Elliot Wave has been drawn to the chart.*
[add empty line]: #
##### Fibonacci Arc
A trend line is drawn between two control points, followed by multiple arcs intersecting the line at levels 38.2%, 50.0%, 61.8% and 100%. The arcs are centered on the second control point.
Properties specific to Fibonacci Arc:
- ***FillEnabled*** When enabled, the areas between the arcs are colored.
- ***LabelDistance*** Controls how far in pixels the labels are from their respective arc lines.
- ***FullCircle*** When enabled, the arcs are drawn as full circles.

*A Fibonacci Arc has been added to the chart.*
[add empty line]: #
##### Fibonacci Fan
Draws a trend line between two control points, then several Fibonacci fan lines starting from the first point and crossing an “invisible” vertical line at the X-value of the second point based on Fibonacci levels at 38.2%, 50.0% and 61.8%.
Properties specific to Fibonacci Fan:
- ***FillEnabled*** When enabled, the areas between the fan lines are colored.
- ***LabelDistance*** Controls how far in pixels the labels are from their respective fan lines.

*A Fibonacci Fan with colored fills enabled (FillEnabled = true).*
[add empty line]: #
##### Fibonacci Retracements
Draws a trend line between two control points, then several horizontal retracement lines based on selected price range (height) of the trendline. The retracement lines are drawn at Fibonacci level of 38.2%, 50.0% and 61.8%.
Properties specific to Fibonacci Retracements:
- ***FillEnabled*** When enabled, the areas between the retracement lines are colored.
- ***LabelDistance*** Set how far in pixels the labels are from the respective retracement lines.

*Fibonacci Retracements with colored fills enabled (FillEnabled = true).*
[add empty line]: #
##### Freehand Annotation
Draws a polygon of any shape based on the mouse movement. A text can be shown inside the polygon.
Properties specific to Freehand Annotation:
- ***FillColor*** Changes the fill color of the annotation
- ***BorderColor*** Changes the border color of the annotation
- ***BorderWidth*** Changes the border width of the annotation
- ***FillEnabled*** When enabled, fills the annotation with color set via FillColor.
- ***ShowText*** When enabled, shows a text inside the annotation. The location of the text is calculated automatically to be in the center of gravity.
- ***AnnotationText*** Sets the text to be shown when ***ShowText*** is enabled.
- ***TextColor*** Sets the color of the text.
- ***FontSize*** Sets the font size of the text.

*A Freehand Annotation has been drawn. A text is shown in the center of the annotation (ShowText = true).*
[add empty line]: #
##### Head and Shoulders
Head and Shoulders pattern draws a baseline with three peaks.
Properties specific to Head and Shoulders:
- ***FillColor*** Changes the fill color of the peak areas.

*Head and Shoulders pattern in a trading chart*
[add empty line]: #
##### Linear Regression
Calculates and draws a linear regression line between two control points. Then draws two channel lines, one above and one below the regression line based on the selected channel type.
Properties specific to Linear Regression:
- ***ShowExtensions*** When enabled, draws dashed extension lines which extend to the last value of the loaded trading data.
- ***FillEnabled*** When enabled, colors the areas between the channel and the regression line.
- ***ChannelType*** Determines the used Linear Regression Channel type such as standard deviation channel, Raff channel and regression line only.
- ***NumberOfStandardDeviations*** Sets the number of standard deviations defining how far the channel lines are from the regression line. Has effect only when ***ChannelType*** is set to *StandardDeviations*.

*A Linear Regression Channel based on one standard deviation, ChannelType = StandardDeviations, NumberOfStandardDeviations = 1.*
[add empty line]: #
##### Pitchfork
Pitchfork, also known as Andrews Pitchfork, can be used to identify support and resistance levels for a stock's price. It places three control points on the chart and draws a line from the first point through the midpoint of the other points.
Properties specific to Pitchforkn:
- ***FillColor*** Changes the fill color of the area between the Pitchfork lines.

*Pitchfork has been added tot he chart.*
[add empty line]: #
##### Trend Line
Draws a straight line between two control points.
Properties specific to Trend Line:
- ***ShowExtensions*** When enabled, draws dashed extension lines which extend to the first and the last value of the loaded trading data.

*Trend Line with extensions enabled (ShowExtension = true).*
[add empty line]: #
##### Triangle
Draws a triangle based on three control points.
Properties specific to Triangle:
- ***FillColor*** Changes the fill color of the Triangle.

*Triangle on a trading chart.*
[add empty line]: #
##### XABCD Pattern
Draws a five-points pattern to the chart.
Properties specific to XABCD Pattern:
- ***FillColor*** Changes the color XAB- and BCD-areas of the pattern.
- ***ShowRatios*** When enabled, shows ratio values between various legs. Set true by default.

*XABCD Pattern has been added to the chart. ShowRatios is enabled.*
[add empty line]: #
##### Other available drawing tools
- Arrow
- Cross Line
- Cycle Lines
- Date Range
- Ellipse
- Fibonacci Extension
- Fibonacci Time Zones
- Flat Top/Bottom
- Horizontal Line
- Horizontal Ray
- Parallel Channel
- Plain Text
- Price Range
- Rectangle
- Sine Wave
- Text Box
- Vertical Line
### TradingChart troubleshooting
***TradingChart*** automatically shows some error messages when something is not working as expected. The messages are displayed on top of the chart as well as in Visual Studio’s output window. The error text above the chart is removed when it is either clicked or a new data set is loaded to the chart.

*An error message is displayed above the chart.*
It is possible to disable the error messages shown above the chart via ***ShowErrorMessages*** property in which case they are shown only in the output window.
```csharp
// Do not show error messages above the chart.
_chart.ShowErrorMessages = false;
```
#### Error list
Below is a list of several error messages, possible reasons for them, and how they could be fixed. Note that the list does not contain every possible error. In case an error cannot be solved, contact LightningChart’s technical support at support@lightningchart.com.
*Message: “Unable to obtain data from provider.”*\
**Explanation**: TradingChart cannot connect to data provider and therefore cannot fetch any data.\
**Possible fix**: Ensure that Internet connection is working.
*Message: “No data for given time range.”*\
**Explanation**: There is no trading data found for the given time range.
**Possible fix**: Try using a different time range.
*Message: “Time range set to: start time – end time”*\
**Explanation**: This is not an actual error. Instead, it informs that the time range was changed, but the change is not visible because there is no data loaded to the chart.
**Possible fix**: Call SetTimeRange() after a data set has been loaded. Alternatively, just load a new data set from a provider in which case the previously set time range will be used.
*Message: “End time should be after start time.”*\
**Explanation**: Time range is set incorrectly when setting it manually.
**Possible fix**: Ensure that the start date of the time range is before the end date.
*Message: “Data array contains no points.”*\
**Explanation**: This message occurs only when SetData() -method is called in code while being given an empty data array.
**Possible fix**: Ensure that the OhlcData -array given to SetData() is not null or empty.
*Message: “Data contains empty values.”*\
**Explanation**: This is more of a warning that an actual error message. It means that the loaded OHLC-data set contains at least one empty value, either Open, High, Low, Close or Volume field has a string value of “”. Note that zero does not count as an empty value and will be drawn on the chart.
**Possible fix**: This message does not prevent TradingChart from working. The data will be loaded and drawn normally, but the empty values will be skipped. It is up to user to implement a logic to handle these cases if necessary.
*Message: “Circular indicator sources detected. Failed to set the source indicator.*\
**Explanation**: This message appears if two or more indicators are using each other as sources when using nested indicators feature.
**Possible fix**: Check what sources the indicators are using. Avoid situations where indicator A uses Indicator B as source while B uses A as source.
*Message: “Problem with connection to Arction server.”*\
**Explanation**: TradingChart cannot fetch required license information from LightningChart’s server.
**Possible fix**: This error most likely is not caused by user. Contact LightningChart’s technical support to receive further information about the current server status.
---
## 3D TransparencyRenderMode
## 3D TransparencyRenderMode property/feature
While rendering opaque surface is straightforward, things get a bit more complicated with semi-transparent or transparent surfaces as they should allow seeing other 3D-series and objects as well as data points behind them. LightningChart offers 3 options for handling transparency of the surface: *Unordered*, *ShaderApproximation* and *OrderingTriangles*, each with their advantages and disadvantages. ***TransparencyRenderMode*** property can be used to select this.
*Unordered* - Renders transparent object faces in the order they are created. This is good for all non-transparent surfaces and identical to the old library behavior. For translucent surfaces it may work under certain view angles, but could be completely opaque from other angles, or alternatively light effect on surface may appear incorrect (artifacts may be seen).
*ShaderApproximation* - Uses shader for transparency effect. This approach is almost as fast as Unordered, but partial transparency is handled correctly between multiple surfaces or on the same surface. The drawback is that surface edge is less smooth (more ragged/aliased) compared to *Unordered* or *OrderingTriangles* options. When different types of translucent series/objects are rendered in 3D charts, *ShaderApproximation* option of ***TransparencyRenderMode*** should be used, as it helps to mitigate artifacts and improve translucent object handling in the chart.
*OrderingTriangles* - Orders object face triangles in proper z-order. This would be slow on items with large number of faces (1 million or more). It also doesn’t work with multiple surfaces (viewing angle should match multiple surface order).

*On the left, two WaterfallSeries3D with the one in front having transparent fill using ShaderApproximation. On the right, semi-transparent PointLineSeries3D coiled as a spring.*

*Semi-transparent SurfaceMeshSeries3D wrapped as a tube on the left. On the right, Several SurfaceGridSeries3D with top one having transparent fill using ShaderApproximation.*
In earlier version (10.5.1), only surface type series (***SurfaceGridSeries3D***, ***SurfaceMeshSeries3D*** and ***WaterfallSeries3D***), as well as for ***PointLineSeries3D***, had it. From LightningChart version 12.0 onwards, ***TransparencyRenderMode*** is available for all other 3D series types: ***BarSeries3D***, [***MeshModels***](MeshModel.md), ***Polygon3D***, [***VolumeModel***](VolumeModel.md) and ***Rectangle3D***. When different types of translucent series/objects are rendered in 3D charts, *ShaderApproximation* option of ***TransparencyRenderMode*** should be used. The new feature helps to mitigate artifacts and improve translucent object handling in the chart.
:::warning
Note that this property is available only when DirectX 11 renderer is used, in other words when RendererDeviceType is either HardwareOnlyD11 or SoftwareOnlyD11.
:::

*Example ExampleTranslucentChart3D*
:::info
To see feature demonstration as example, check *ExampleTranslucentChart3D* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## Universal Data Parser
From version 12.6 UniversalDataParser control can be used.
A drop-in WPF dashboard for LightningChart. The user drags data files onto it, picks what to draw and
where, and the parser reads the file, works out its shape and renders it into a chart. Everything is
built on robust and fast LightningChart controls.
UniversalDataParser is a UserControl which can handle dashboard creation and data loading without a single line of code. Just drag-and-drop data source, create desired layout and add chart-type you need or like.

*UDP controls highlighted: UDPParser, SmartGridControl, UDPIsometricPanel, EmptyGridCell. Not highlighted cells in SmartGridControl hold UDPViewer (4 charts in total).*
### 1.1 Requirements
| | |
|---|---|
| Framework | WPF on .NET Framework 4.8, or WPF on .NET 10. |
| Assembly | `LightningChart.WPF.UDP.NET4` on .NET Framework, `LightningChart.WPF.UDP.NET10` on .NET. The control is a companion assembly beside the charting library rather than part of it. Each goes with the charting assembly of its own framework - NET4 with `LightningChart.WPF.Charting.NET4`, NET10 with `LightningChart.WPF.Charting.NET10` - and the pairing is not optional. The parser uses members the charting library keeps internal, and both assemblies carry the same version from one build to the next, so a mismatched pair loads without any complaint from the loader and fails at the first moment one of those members is needed. Deploy both from the same build. |
| Namespace | `LightningChartLib.WPF.Charting.CustomControls.UniversalDataParser` |
| Rendering | DirectX 11 or DirectX 9 through the LightningChart rendering engine |
| Thread | All controls are WPF controls and belong to the interface thread. Parsing and render-data building are moved to background threads internally; nothing in the public API is safe to call off the dispatcher. |
### 1.2 The controls
| Control | What it is |
|---|---|
| `UDPParser` | The panel on the left: dropped files, their series, the visualization mode list, and the Render / Append / Save / Load buttons. One per dashboard. |
| `SmartGridControl` | The layout area on the right. Viewers, isometric blocks and empty cells are dragged into it, split, resized with splitters and removed. |
| `UDPViewer` | One chart with its own context menu and render settings. Created by dragging into the grid. |
| `UDPIsometricPanel` | A block that projects another viewer's data into a 2D isometric picture. Dragged in like a viewer. |
| `EmptyGridCell` | A placeholder cell, so a layout can be built before the charts exist. |
Only `UDPParser` and `SmartGridControl` are placed by the host application. The rest are created by the
grid when the user drags them in, or by a restored session.
### 1.3 Quick start
In XAML file define two containers - one for the parser, one for the grid:
```xml
```
In code-behind — build on `Loaded`, not in the constructor:
```csharp
using LightningChartLib.WPF.Charting.CustomControls.UniversalDataParser;
public partial class DashboardView : UserControl, IDisposable
{
private UDPParser _parser;
private bool _built;
public DashboardView()
{
InitializeComponent();
Loaded += OnLoaded;
}
private void OnLoaded(object sender, RoutedEventArgs e)
{
if (_built)
return;
_built = true;
_parser = new UDPParser();
ParserHost.Children.Add(_parser);
LayoutHost.Children.Add(new SmartGridControl { ConnectedParser = _parser });
}
public void Dispose()
{
Loaded -= OnLoaded;
if (_parser != null)
{
_parser.Dispose();
_parser = null;
}
}
}
```
That is the whole integration. `ConnectedParser` is what ties the two halves together: the grid registers
each viewer it creates with that parser, and the parser offers them in **Select Target Viewer**.
:::tip[Note]
Build the content on `Loaded` rather than in the constructor. An exception thrown from a constructor
cannot be shown by most hosts, and a control that failed to construct cannot be disposed cleanly.
:::
#### Opening with a session
A session file (`.udpsession`) stores a whole dashboard: the layout, the viewers and the files that were rendered into them. Load one if you want the application to open with a dashboard already filled in instead of an empty grid. Do it after the parser and the grid have been added to the window, so there is something for the session to restore into.
```cs
try
{
await _parser.LoadSessionFromFileAsync(sessionPath);
}
catch (Exception ex)
{
MessageBox.Show(
"Could not load the session." + Environment.NewLine +
sessionPath + Environment.NewLine + Environment.NewLine + ex.Message,
"Universal Data Parser", MessageBoxButton.OK, MessageBoxImage.Warning);
}
```
**Await it.** The method reads and re-renders every file the session names, which takes time, and everything it has to report comes back through the task. Call it without awaiting and you neither know when the dashboard is ready nor reliably observe failures. The call has to be made from an `async` method, which in a WPF `Loaded` event handler means `async` void; keep the `try/catch` inside that handler.
:::note
A session stores file paths, not file contents, and a path that no longer resolves is skipped on its own rather than failing the whole restore. The layout is rebuilt either way, so a session whose files have moved opens as viewers with nothing in them. That is deliberate.
:::
### 1.4 Licensing
```csharp
UDPViewer.SetLicenseKey("your-deployment-key");
```
Call it once, before the first viewer is created. It forwards to `LightningChart.SetDeploymentKey`, so an
application that already sets the key globally does not need this.
### 1.5 Watching the charts the parser creates
The charts are created inside viewers. Two process-wide callback properties expose their lifetime:
```csharp
UDPViewer.ChartCreatedHandler = chart => _myChartList.Add(chart);
UDPViewer.ChartDisposingHandler = chart => _myChartList.Remove(chart);
```
Assign these callbacks once at application level. Each property holds one delegate: assigning a new value replaces the previous callback, and clearing it affects every UDP viewer in the process. If several components need notifications, install one dispatcher or explicitly combine the delegates. Release references captured by the callback when the application no longer needs them.
```csharp
UDPViewer.ChartCreatedHandler = null;
UDPViewer.ChartDisposingHandler = null;
```
#### Following the viewers themselves
A viewer also raises `RenderCompleted` on the interface thread once a render has finished and its chart holds the result. It is raised on the interface thread, so the handler can read the chart directly. Use this event, and not the chart's own repaint events, whenever you need to react to the data a viewer is showing.
The host never constructs a viewer, so there is nothing to subscribe to at startup. Viewers appear as the user drags them into the grid and as a session is restored. The parser announces each one:
```csharp
_parser.ViewerRegistered += OnViewerRegistered;
_parser.ViewerUnregistered += OnViewerUnregistered;
// Any viewer already there, which is the case when a session was
// restored before this code ran.
foreach (UDPViewer viewer in _parser.Viewers)
viewer.RenderCompleted += OnRenderCompleted;
private void OnViewerRegistered(object sender, UDPViewerEventArgs e)
{
e.Viewer.RenderCompleted += OnRenderCompleted;
}
private void OnViewerUnregistered(object sender, UDPViewerEventArgs e)
{
e.Viewer.RenderCompleted -= OnRenderCompleted;
}
private void OnRenderCompleted(object sender, EventArgs e)
{
UDPViewer viewer = (UDPViewer)sender;
Debug.WriteLine(viewer.ViewerName + " finished a render.");
}
```
`ViewerUnregistered` is raised before the viewer is disposed, so the handler can still read it. Subscribing on registration and unsubscribing on removal is the whole pattern; there is no need to poll `Viewers`.
### 1.6 The Parser Panel

*Parser Panel in details*
What the user sees on the left, top to bottom:
| Element | Does |
| :--- | :--- |
| **Drop area** | Accepts dragged files. Unrecognized extensions are ignored silently. |
| **Parsed datasets** | Every file read, multi-selectable with `Ctrl` / `Shift`. **Remove selected** or `Delete` drops them. |
| **Select series to plot** | The columns of the selected dataset, each with a checkbox. **All**, **None** and **Invert** act on the list. |
| **Select Target Viewer** | Every viewer registered by the connected grid, by name. |
| **Select Visualization Mode** | Only the modes that suit the selected dataset's shape. |
| **Axis and point options** | **Single Y-axis** or **Stacked Y-axes**, **Render points as pixels**, **Show Legend**, and a downsample percentage. |
| **DRAG** blocks | The layout grid can be divided again and again by dragging one of blocks. |
| **RENDER NEW** | Replaces what the target viewer holds. |
| **ADD TO CHART** | Appends to it, keeping what is already drawn. |
| **SAVE / LOAD [SESSION](#18-Sessions)** | Writes or reads a `.udpsession` file. |
| **[⚙ CHART SETTINGS…](#19-Render-Settings)** | The render settings of the selected target viewer. |
| **[GRID OPTIONS…](#110-Grid-options)** | The layout grid and every chart in it: whether the charts redraw while a cell is being resized and how long they wait before they do, whether the splitters are shown, and **Reset Layout**, which empties the grid after asking and keeps the dataset list. |
#### Recognised Extensions
* `.csv`, `.txt`, `.asc`, `.json`, `.obj`, `.las`, `.png`, `.jpg`, `.jpeg`, `.bmp`
Every dropped file is analysed on a background thread, so the interface stays responsive while a large file is read. The analysis works out the delimiter, whether there is a header row, the column names and their types, and the overall shape of the data. The file then appears in the dataset list, and the visualization modes that suit it become selectable.
### 1.7 The Layout Grid
`SmartGridControl` is a split layout that can be divided again and again. Drag a block onto an existing one and the cell splits in the direction of the drop, so dropping near the left edge puts the new block on the left, near the top puts it above, and so on. Dropping into the middle of an empty cell fills that cell instead of splitting it. When a block is removed, the block beside it grows to take the space back.
| Member | Does |
| :--- | :--- |
| `ConnectedParser` | The parser that viewers in this grid register with. Set it once, when the grid is created. |
| `SplittersVisible` | Whether the splitters are shown. Read-only; set through the two calls below. |
| `ToggleSplitters()` | Flips splitter visibility. |
| `SetSplittersVisible(bool)` | Sets it directly. |
| `ApplyGridOptions(options)` | Hands a `UDPGridOptions` to every chart already in the layout. Splitter visibility is not part of it - a restored layout brings its own - so set that through `SetSplittersVisible`. |
| `GetSession()` | The current layout as a `SmartGridSession`. |
| `RestoreSession(session)` | Rebuilds the layout from one. |
| `LoadLayout(session)` | The same, by another name. |
| `ResetLayout()` | Empties it. Every viewer is removed, unregistered and disposed, and the viewer counter restarts. |
| `ClearLayoutProgrammatically()` | Empties it without resetting the counter. |
| `RemoveElement(element)` | Removes one block, promoting its sibling. |
| `DisposeLayoutTree()` | Disposes everything and disconnects the parser. |
### 1.8 Sessions
A session is an XML document (.udpsession) holding three things: the datasets, the render operations, and the layout.
| Type | Holds |
| :--- | :--- |
| `UDPSession` | Datasets, RenderOperations, Grid |
| `UDPSessionDataset` | File path and the series selection made on it |
| `UDPSessionRenderOperation` | Viewer id, dataset path, mode, stacked axes, pixel points, downsample percentage, append |
| `SmartGridSession` | Viewer count, splitter visibility, layout root |
| `SmartGridNode` | One node: Viewer, Empty or Split, with its children and split ratio |
- The control is a **companion assembly**, not part of the charting library, and it is built for **.NET Framework 4.8** and **.NET 10** from one set of sources. Deploy it beside the charting assembly of the same framework and the same build.
- Sessions store **file paths, never file contents**. Restoring one re-reads and re-analyses every source file, so a file that has moved is skipped rather than failing the load.
- They record what the viewers show, not the history of how they got there: operations a later non-appending render superseded are not written, so opening a session does not read the same file twice.
- Modes are serialized by name, so a session written by an earlier build keeps its meaning when an enum gains members.
| Call | Does |
| :--- | :--- |
| `LoadSessionFromFileAsync(path)` | Reads the file and restores everything. Await it. |
| `LoadSessionAsync(session)` | The same from an object already deserialized. |
| `LoadLayoutOnly(session)` | Rebuilds the layout, loads no data. |
### 1.9 Render Settings
Every viewer carries its own `UDPRenderSettings`, reached from the parser's **Chart Settings** button or in code through `UDPViewer.RenderSettings`. The dialog edits a clone: **Cancel** discards its changes, while **OK** clamps and assigns them to the selected viewer and saves them as the defaults for subsequently created viewers. These settings are consumed by later renders; accepting the dialog does not rebuild content already in the chart. Viewer context-menu commands are separate, immediate edits.
#### Limits
| Setting | Meaning | Default |
| :--- | :--- | :--- |
| `MaxStackedAxes` | How many stacked segments show Y axes. If segment count above it, YAxes won't be visible. | 64 |
| `MaxPointsPerSeries` | Points before a series is split into chunks | 500 000 |
| `MaxGridCellsPerTable` | Cells before an intensity grid is split | 1 000 000 |
| `MaxBarsPerSeries` | Bars before rows are binned | 250 |
| `MaxCachedDataCells` | Caches files with no more than this many parsed values | 10 000 000 |
#### Appearance and behavior
| Setting | Meaning | Default |
| :--- | :--- | :--- |
| `BarAggregation` | Aggregated-bar value: furthest from zero (Peak) or arithmetic mean (Mean) | Peak |
| `AreaBaseMode` | Area baseline: SeriesMinimum, Zero, Custom value | SeriesMinimum |
| `AreaBaseValue` | The custom level | 0 |
| `SurfaceContourLines` | Contour lines on 3D surfaces | off |
| `PolarGridVisible` | Polar grid | on |
| `PolarAreaFilled` | Filled polar areas | off |
| `SmithReferenceMode` | Smith reference impedance: Taken from the data, 50 ohms or Custom value | FromData |
| `SmithReferenceValue` | The custom reference impedance | 50 |
| `SeriesAllowUserInteraction` | Series respond to the pointer | on |
| `ObjectsAllowUserInteraction` | 3D objects respond to the pointer, and mesh triangle tracking | off |
| `SeriesHighlight` | None, brighten or blink under the pointer | None |
| `DarkBackground` | Chart theme | dark |
| `LegendBoxVisible` | Legend box | off |
| `XYAxisXReversed` / `YReversed` | Axis direction | off |
| `StackedAxesReversed` | Order of stacked bands | off |
| `XYGridVisible` | XY grid | on |
| `XYPointMarkersVisible` | Point markers on line series | off |
| `IntensityGridPixelRendering` | Pixel rendering instead of interpolated | off |
| `View3DLighting` | How a 3D scene is lit: Standard, FromCamera, Surround, Uniform, Studio, SoftDome or HighContrast | Standard |
| `View3DLightMarkersVisible` | Mark each light in the scene, with a draggable handle | off |
| `View3DOrthographic` | Parallel projection | off |
| `View3DAxesVisible` | 3D axes | off |
| `View3DSceneScalePercent` | How much of the view the scene fills | 80 |
| `View3DWallsVisible` | Scene walls | off |
| `View3DOrientationArrowsVisible` | Axis direction arrows | off |
| `DataCursorVisible` | Data cursor | off |
| `IsometricModelDrawnAs` | Isometric model style: Vertices, All face edges, Outline edges or Filled faces | All face edges |
| `IsometricAskAbovePoints` | Prompts before an isometric panel draws if more than this many projected points | 200 000 |
#### Persevering Render Settings
```csharp
UDPRenderSettings settings = UDPRenderSettings.LoadUserDefaults();
settings.MaxPointsPerSeries = 250000;
settings.Clamp();
settings.SaveUserDefaults();
```
Written to `%LOCALAPPDATA%\LightningChart\UniversalDataParser\RenderSettings.xml`. `Clamp()` brings every value back into a workable range; `Clone()` gives an independent copy, which is what the settings dialog edits until it is accepted. Calling `SaveUserDefaults()` changes the defaults used by later viewers; it does not apply the object to an existing viewer unless it is also assigned to that viewer's `RenderSettings`.
### 1.10 Grid options

*UDP Grid options window, when parser's Grid Options button is clicked.*
`UDPGridOptions` is the other half: what belongs to the layout area rather than to one viewer. It is reached from the parser's **Grid Options** button, or in code through the static `UDPGridOptions.Current`, which every chart the parser creates reads as it is built. The dialog edits a clone the same way the chart settings do; **OK** clamps it, assigns it to `Current`, saves it as the user default and hands it to every chart already in the grid through `SmartGridControl.ApplyGridOptions(options)`.
| Option | Meaning | Default |
| :--- | :--- | :--- |
| `UpdateOnResize` | Charts redraw continuously while a cell is being resized. Off holds the last image and redraws once the size has settled, which is what keeps a splitter drag following the pointer on a dashboard of expensive charts. Applied to the chart's own `ChartRenderOptions.UpdateOnResize`, whose engine default is the opposite. | off |
| `UpdateOnResizeTimer` | Milliseconds after the last size change before that redraw happens. Applied to `ChartRenderOptions.UpdateOnResizeTimeInterval`. Used only while UpdateOnResize is off. | 500 |
| `SplittersVisible` | Whether the grid shows the splitters that resize its cells. | on |
| `Reset Layout...` button | Removes every viewer and empty cell from the layout and returns it to the initial state. Asks first. The list of loaded files is kept. Disabled while there is nothing to empty, and while a render is running. |
### 1.11 Disposal
`UDPParser.Dispose()` is the one call the host needs. It disposes the connected grid, every viewer in it and every chart in those, unregisters the viewers, and releases the bookkeeping the control keeps outside the charts.
Disposing a viewer, whether by removing it or by disposing the parser, also:
- cancels a load that is still running,
- closes the tool windows that viewer opened,
- detaches the axis handlers it installed,
- drops the mesh, image-plane and grid-origin bookkeeping keyed by its chart, and
- calls `ChartDisposingHandler` before the chart goes.
### 1.12 Threading, Cancellation and Large Files
* File analysis and most parsing, palette-range scanning and render-data construction run on background threads. Chart-object creation and the final render run on the interface thread.
* A batch load shows an overlay naming the file and phase. If **Cancel** button is pressed: it stops at the next cancellation check during background work or between files, but it cannot interrupt synchronous chart rendering that has already started. Files already drawn remain visible.
* The public session-loading methods do not accept a caller-supplied cancellation token. Their lifetime token is cancelled by `UDPParser.Dispose()`; the viewer's Cancel button controls an active data-load batch.
* A render into a chart is wrapped in one update, so a multi-file batch paints once rather than after every file.
* LAS point clouds are read in chunks; the chunk size is the global `UDPParser.LasChunkSize`.
* Series longer than `MaxPointsPerSeries` are split into chunks that share their seam sample, so no gap appears between them.
* Parsed rows are cached on the dataset only while they fit `MaxCachedDataCells`; above that they are read again on the next render. Parsed OBJ models follow the same cap.
* A dataset notices when its file changes on disk and drops its caches rather than drawing a stale copy.
### 1.13 API reference
#### UDPParser
ConnectedGrid | The grid this parser renders into.
Viewers | The viewers currently offered as render targets.
ViewerRegistered | Raised when a viewer becomes a render target. Subscribe to its events here.
ViewerUnregistered | Raised before a viewer is disposed. Unsubscribe here.
RegisteredViewers | The entries behind the target list. Bound to the list box, so of no use outside it; use Viewers.
RegisterViewer(viewer) | Offer a viewer as a render target. The grid does this for you.
UnregisterViewer(viewer) | Stop offering one.
LoadSessionFromFileAsync(path) | Restore a whole dashboard from file.
LoadSessionAsync(session) | Restore from an object.
LoadLayoutOnly(...) | Restore only the layout.
ToggleSplitters() | Toggle the grid's splitters.
LasChunkSize | Static. LAS records per chunk.
Dispose() | Tears down the parser, the grid and every viewer.
#### UDPViewer
ViewerName | Dependency property. The name shown in the target list and on the chart.
SessionId | Identity across a session save and restore.
RenderSettings | This viewer's settings.
LegendBoxVisible | Legend box state.
EnableAxisContextMenu | Whether right-clicking an axis opens the engine's own menu.
RenderCompleted | Raised on the interface thread once a render has finished.
ChartCreatedHandler | Static. Called with every chart the control creates.
ChartDisposingHandler | Static. Called before each is disposed.
SetLicenseKey(key) | Static. Deployment key.
#### UDPIsometricPanel
ConnectedParser | The parser whose viewers it can follow.
SourceViewerName | The viewer it is following, by name. This is the value stored in a session file.
Dispose() | Detaches from the source and the parser and disposes its chart.
### 1.14 Enumerations
Enum | Members
DataSourceKind | DelimitedText, AscLidar, BinaryLidar, Image, GeoRoute, Json, ObjModel
DataShape | VectorXY, MultiChannelXY, Matrix
ChartDataType | Integer, Float, Double, DateTime, Unknown
AscLidarFormat | TerrainGrid, PointCloudXyzRgb
SavedCsvFormat | None, XY, XYWithText, XYError, HighLow, Stock, LineCollection, PointLine3D, PointLine3DWithIntensity, PointLine3DWithColor, PointLine3DWithColorAndSize, Polar, IntensityGrid, SurfaceGrid3D
BarAggregation | Peak, Mean
AreaBaseMode | SeriesMinimum, Zero, Custom
SmithReferenceMode | FromData, FiftyOhms, Custom
IsometricOrientation | Top / Bottom × Front / Back × Right / Left, which gives eight corners
IsometricDrawMode | Automatic, Points, Lines
IsometricModelStyle | Vertices, AllEdges, Outline, Filled
UDPLightingScheme | Standard, FromCamera, Surround, Uniform, Studio, SoftDome, HighContrast
### 1.15 Troubleshooting
Symptom | Cause
A dropped file does nothing | Its extension is not in the recognised list. Nothing is reported for a file the parser does not claim.
No target viewer offered | The grid has no viewer yet, or its ConnectedParser was never set.
Render button disabled | A render is already running, or no dataset, target and mode are all selected.
A mode is missing from the list | The dataset's shape does not suit it. A file with two columns cannot make a 3D surface, and an OBJ model cannot make a candlestick chart.
Session restores an empty layout | The files it names have moved. Paths are stored, contents are not.
A chart is blank after a render | Check the dataset's series selection: a column of text encodes to no number and is dropped rather than drawn at zero.
Settings changed but nothing moved | Render settings are read as a render goes. Change them, then render.
### 2.1 Input Formats
Format | Read as
.csv .txt | Delimited text. Delimiter, header row, column names, stock columns and X axis type are detected. Files this parser saved itself are recognized by their header and read back in the same shape.
.asc | ESRI ASCII grid: either a terrain raster or an XYZ+RGB point cloud. The no-data value, the cell size and the real-world corner are read along with it.
.las | Uncompressed 3D LiDAR (Light Detection and Ranging) point cloud data, read in chunks. Embedded RGB is used when the point format supplies it; otherwise points use the height palette.
.json | Flat or nested. Nested documents become parallel-coordinate axes or a spider chart, with categorical axes carrying their category names as ticks.
.obj | Wavefront model with its .mtl materials, textures, per-vertex colours, faces and line strips.
.png .jpg .jpeg .bmp | It can be rendered as a 2D intensity grid, a 3D luminance surface carrying the source pixel colours, or a textured 3D plane.
:::tip[LAS scope]
The reader consumes XYZ coordinates from uncompressed LAS records. RGB is recognised in point formats 2, 3, 5, 7, 8 and 10 when the record is long enough. It does not use intensity, classification, waveform or coordinate-reference metadata for colouring or rendering. Native RGB is retained by the compact coloured pixel path; choose height-palette colouring when rendering the cloud through a non-pixel point representation.
:::
### 2.2 Schema detection
Each file is analysed once, and what is found decides which modes are offered:
* **Delimiter**, detected from the first two non-empty lines. Comma, semicolon and tab are supported; quoted fields and doubled quotes are handled, and decimal commas are considered when choosing between comma and semicolon. Space is not a general delimited-text separator.
* **Header row**, distinguished from data by whether its cells parse as numbers.
* **Column names**, which become series names and axis titles.
* **X axis type**: number or date-time, with day-month and month-day orders told apart.
* **Stock columns**: Date, Open, High, Low, Close, Volume, matched by name rather than position.
* **Saved formats**: a file this parser wrote is recognized from its header and read back into the same chart type it came from.
* **Shape**: a two-column vector, a multi-channel table, or a matrix.
* **Grid geometry** for ASC: corner, cell size and no-data value from the header.
* **Extreme magnitudes**: columns far from zero or in a very narrow band are scaled into a range the renderer can hold, and the scaling is disclosed in the axis or series title.
### 2.3 Visualization modes
**ViewXY** — `PointLine`, `FreeformLine`, `Area`, `Bar`, `BarAggregated`, `IntensityGrid`, `StairSteps`,
`HighLow`, `Stock`, `SampleData`, `ParallelCoordinates`, `LiteFreeformLine Map`.
**View3D** — `PointLine`, `Scatter`, `SurfaceMesh`, `MeshModel`, `ImagePlane`, `ParallelCoordinates`.
**Polar** — `Line`, `Area`, `Spider`.
**Smith** — `PointLine`.
**Pie3D** — `Slices`.
Only the modes that suit a dataset's shape are offered for it.

*An example of Visualization modes suggested for bitmap image.*
### 2.4 ViewXY
- Multi-channel data on stacked or layered Y axes. `MaxStackedAxes` limits visibility of stacked Y-axes, not the number of series or segments. When above the limit the stacked layout remains, but axis titles, labels, ticks and grids are suppressed.
- Long series are drawn in chunks that share their seam sample, so no gap appears and no final sample is lost.
- Bars: raw mode draws one bar per row. Aggregated mode bins the visible rows to at most `MaxBarsPerSeries`, anchors power-of-two bins to sample zero, states the rows per bar in the title, and re-bins as the X axis changes. `BarAggregation` selects either the value furthest from zero (`Peak`) or the arithmetic mean of finite values (`Mean`).
- Intensity grids with interpolated or pixel rendering, a transparent palette step for no-data cells, and value scaling where the magnitude exceeds what the shader carries.
- Candlestick with a volume pane below it, as segments of one chart so the two pan and zoom together along X.
- Parallel coordinates, one axis per attribute, the lines recomputed as axes are dragged or zoomed.
- Stair steps, high-low, area with a choice of base level, sample-data and digital line series.
- A map mode for geographic routes, with a region selector.
- Wheel zoom in both directions; `Shift` and `Ctrl` restrict it as the engine defines, and `Alt` zooms one stacked segment alone.
### 2.5 View3D
- Point clouds, scatter, surface meshes, terrain grids, image planes and imported models in one scene, all fitted to the same axes.
- Geographic grids carry a real-world corner, and those numbers are large: an Ordnance Survey tile starts near easting 365000. The first grid rendered into a chart fixes an origin for that chart, and every grid after it has the same origin subtracted. That is what keeps a set of tiles laid out side by side instead of stacked on top of one another.
- Scene dimensions follow the data's own proportions, with extreme ratios clamped so a thin axis stays visible and a thin one is lifted towards a floor rather than snapped to it.
- Anything sized in world units, such as a mesh model or an image plane, is rescaled whenever the axes move. That is what lets a model and a terrain share one scene without either being the wrong size.
- Camera: fit, top, front and side views, perspective or orthographic, and an adjustable scene box.
- Per-object section clipping: a clip box per mesh or point-line series, with six indicator planes drawn without the depth test so they are visible from any angle.
- The near clip distance is set to the larger of 0.5 and 5% of the camera view distance when the 3D scene is reset. This improves depth-buffer precision; it reduces, but cannot guarantee the elimination of, z-fighting. Geometry closer than the near plane is clipped.
- The 3D point-size tool applies one size, from 0.1 to 50 axis units, to adjustable non-compact point series. It includes OBJ data rendered as scatter points, but not a `MeshModel`, compact points or pixel-optimized points.
### 2.6 OBJ models
- Materials and textures from the .mtl are preserved rather than overwritten with a palette.
- Alpha-cutout masks (map_d), which models use for foliage, fur and grilles, are drawn through the normal depth-writing path. The rest of the scene does not have to switch to order-independent transparency because of them.
- Transparency mode can be selected for all models or for one model: normal, ordered triangles, or order-independent.
- The opacity window changes only material parts that were transparent in the source OBJ/MTL. It applies one absolute opacity to those parts across the chart and can restore their source alpha values; it is not a per-model control and does not make originally opaque materials transparent.
- On import, source materials, textures and supported OBJ vertex colors are preserved when available; otherwise a height palette supplies fill color. The menus can replace mesh fill or wireframe with a single color or a height palette, globally or per model. They do not provide a command to restore source coloring after it has been replaced.
- Surface and wireframe are shown and hidden separately.
- Face culling is off, so a model with mirrored parts and opposite winding still draws.
Models sit at the coordinates the file states, on the same axes as everything else. The engine's right-handed-to-left-handed depth conversion is applied once and used by every reader of the file alike.
- A model with no faces is drawn as points or line strips instead of a mesh.
### 2.7 Polar, Smith and Pie3D
- **Polar**: line and filled-area series, with an optional grid, and a spider chart built from nested JSON where each level becomes an axis.
- **Smith**: complex column pairs plotted against a reference impedance taken from the data, fixed at 50 Ω, or set by hand.
- **Pie3D**: one slice per row, for a categorical column against a value column.
### 2.8 Isometric block
This block follows one viewer and draws whatever it holds as a true isometric projection. The projection is computed once into two coordinates and the result is drawn as an ordinary 2D chart. That has three practical consequences: nobody can rotate the picture out of the arrangement it was drawn in, it prints and pastes exactly as it looks on screen, and it uses the 2D render path rather than the 3D one.
* Eight corners: top or bottom, front or back, left or right. All eight foreshorten the three axes equally; they differ only in which faces are in view.
* The scale is kept equal in both screen directions whatever shape the block is dragged into: the axes are re-ranged on every resize so one projected unit stays as wide as it is tall. Stretching one direction against the other would undo the equal foreshortening the projection exists for, and a cube would come out a box. The picture is sized to fit the shorter direction and centred in the longer, so nothing is ever cropped.
* Draw modes: automatic, points or lines.
* A model can be drawn four ways, chosen under **Model Drawn As** in the block's right-click menu and defaulted in the render settings: ***Vertices*** for the bare points, ***All Face Edges*** for the model exactly as its file stores it, ***Outline Edges***, which leaves out the edge between two faces lying in the same plane so a box looks like a box rather than like the triangles it was cut into, and ***Filled Faces***, which fills those same flat faces back to front and draws the outline over them.
* Depth is the coordinate the projection throws away, and it can be put back as color. Switch it on when a wireframe is hard to read, because it is what tells the near face of a shape from the far one.
* A large model is not projected unasked. Above a point count you set in the render settings the block says how big the picture would be and offers a button, and asks once when the model in the followed viewer changes.
* Adjustable point size and line width, light or dark ground.
* The three axes are made same length before projecting. As result, if data's X-Y-Z values differ by orders of magnitude, it comes out as a line rather than a picture.
* Both screen axes are given the same span, so a unit is the same length on each.
* It follows its source: whenever that viewer renders, the projection is rebuilt.
### 2.9 Context menus
Context Menu is open when clicked on the Viewer with secondary mouse button. Context Menu is content dependent.

*An example of Context Menu when ViewXY chart under UDP.*
Common
Fit All Data
Reset Axes
Data Cursor
Legend Box
Copy Image to Clipboard
Save Image As…
Export Series CSV…
Dark Background
Chart Info…
Series Tools: show, hide, distinct colors
Pointer Interaction: per series and per object, plus All
Clear Chart
Remove Viewer
ViewXY
X/Y Axis Visible
Grid
Point Markers
X/Y Axis Reversed
Reverse Axis Order
Reset Axis Positions
Render Grid as Pixels
Fit X Axis
Fit Y Axis
Fit All Axes
Select Map Region
Parallel Coordinates tools
View3D
Camera: Fit, Top, Front, Side
Perspective / Orthographic View
Lighting: seven schemes, plus Show Light Positions
Orientation Arrows
Adjust 3D Dimensions…
3D Axes
3D Walls
Bounding Box
Section Planes…
3D Objects: one submenu per object
3D PointLine / Scatter Coloring
Mesh Models
Adjust Mesh Models…
Mesh Surface: Show / Hide
Mesh Coloring: palette, single color, vertex color
Set Palette Gradient…
Mesh Wireframe: off, single color, palette
Mesh Transparency: normal, ordered triangles, OIT
Adjust transparent material opacity…
**Pointer Interaction** lists every series and object in the chart with a checkable entry each, and an **All** above them that sets the lot and writes it into the render settings so the next render keeps it. A mesh gives up its triangle tracking with its interaction, which is the part that can be demanding on a model of millions of triangles.
The isometric block has its own menu: **Drawn As**, **Model Drawn As**, **Colour by Depth**, **Point Size**, **Line Width**, **Dark Background**, **Copy...**, **Save...** and **Remove...**.
### 2.10 Tool windows
Here is the list of dialog-windows used by Universal Data Parser (UDP).
Window | Does
Chart Settings | Future-render settings for the selected target viewer. The dialog edits a copy; OK assigns and saves it, while Cancel discards it.
Chart Info | Every series and object in the chart: view, category, name, type, visibility and data count.
[Section Planes](#Section-Planes) | A clip box per object, with a range slider per axis and six indicator planes.
Adjust Mesh Models | Position, rotation and size of each mesh, live.
Mesh Transparency | One opacity applied across source-transparent material parts in the chart, with a source-value reset.
3D Point Size | Uniform size for adjustable non-compact 3D point series; mesh geometry and pixel points are excluded.
3D Dimensions | The scene box, with a reset to what the render created.
All of them are closed when the viewer that opened them is disposed or its chart is reset.
#### Section Planes
If View is based on View3D and it data is visualized ans MeshModel or PointLineSeries3D, then context-menu will allow to select 'Section Planes...'. In dialog window user can select X, Y and Z axes range (in percentage) to shown /clipped. For example, in the image below MeshModel vertices cut in 25-75% X-range and 30-70% in Z-range.

*Section Planes dialog window.*

*MeshModel example. On the left, normal rendering. On the right clipped same model (according settings above) with Section Planes visible.*
### 2.11 Export
* Copy the chart image to the clipboard as a bitmap.
* Save the chart image: PNG, JPEG, TIFF, BMP, and the vector formats EMF and SVG. The format follows the extension.
* Export the rendered data as CSV, in the same formats this parser reads back: XY, high-low, stock, 3D point-line with color and size, polar, intensity grid and surface grid.
* Save the whole dashboard as a session and load it again.
---
## Updating chart data or properties
Every property or series data value change will cause the LightningChart control to be redrawn. Every redraw will cause CPU and display adapter overhead. If more than one property is programmatically changed at the same time, the property changes should be made between ***BeginUpdate()*** and ***EndUpdate()*** method calls, as a batch. ***BeginUpdate()*** will stop drawing the control until ***EndUpdate()*** is called. There is an internal counter for pending ***BeginUpdate()*** calls, and when an equal amount of ***EndUpdate()*** calls have been reached, ***EndUpdate()*** redraws the control. The following example demonstrates how to update chart with minimal load to the computer.
```csharp
chart.BeginUpdate(); //Disable redraws
//Add data to series
chart.ViewXY.SampleDataSeries[0].AddSamples(multiChannelSampleStream[0], false);
chart.ViewXY.SampleDataSeries[1].AddSamples(multiChannelSampleStream[1], false);
chart.ViewXY.SampleDataSeries[2].AddSamples(multiChannelSampleStream[2], false);
//Update point counter bar
chart.ViewXY.BarSeries[0].SetValue(0,1,(double)totalPointsCollected,””, false);
// Point counter label
chart.Title.Text = totalPointsCollected.ToString();
// Set monitoring scroll position to latest x
newestX = firstSampleTimeStamp + (double)(pointsLen - 1) / genSampFreq;
chart.ViewXY.XAxes[0].ScrollPosition = newestX;
chart.EndUpdate(); // Enable redraws and redraw
```
The internal counter allows using nesting updates as follows:
```csharp
void MainMethod()
{
chart.BeginUpdate();
chart.Title.Text = “My title”; chart.ViewXY.XAxes[0].AxisColor = Colors.Red;
UpdateSeriesColors();
chart.EndUpdate();
// Repaints only once.
}
private void buttonCreate_Click(object sender, EventArgs e)
{
UpdateSeriesColors(); // Repaints only once
}
void UpdateSeriesColors()
{
chart.BeginUpdate();
foreach(PointLineSeries series in chart.ViewXY.PointLineSeries)
{
series.LineStyle.Color = Color.Yellow;
}
chart.EndUpdate();
}
```
Updating series data depends on how the data is stored. For array series, ***InvalidateData()*** method has to be called after updating the array contents, otherwise the UI doesn’t get notified about the changes.
ObservableCollection, useful for data binding in WPF bindable chart, will update itself with every point or point's field because of automatic notifications. Thus, ***InvalidateData()*** is not needed. However, ObservableCollections cause slightly reduced performance compared to arrays or lists, which is noticeable especially when having a large amount of data points ([see also here](/docs/beginners%20guide/ChartEditionsV11.md#Editions-and-performance)).
---
## ViewPie3D (InDetail)
***ViewPie3D*** presents data as pie and donut charts, in 3D.

*Example of a 3D Pie chart and a Donut chart.*
### Properties

*ViewPie3D object tree.*
Select the chart type, *Pie* or *Donut*, by using ***Style*** property. Control the zooming, panning and rotation with ZoomPanOptions property tree, [similarly to View3D](/docs/inDetail/ZoomPanRotate3D.md).
***Camera*** property controls the viewpoint (see [3D Camera](/docs/inDetail/3D-overview.md)). Predefined lighting setup can be selected with ***LightingScheme*** property. Use ***Material*** property and its sub-properties to adjust general 3D surface appearance and shininess.
Use ***DonutInnerPercents*** to set the donut inner radius, ***Rounding*** to adjust edge rounding radius, ***StartAngle*** to rotate the pie, and ***Thickness*** to adjust pie thickness. ***ExplodePercents*** adjusts how far away the exploded pie slice is, when slice’s ***Explode*** is set *true*.
***TitlesStyle*** sets the pie slice text of one of the following: *Titles*, *Values* or *Percents*. Edit ***TitlesNumberFormat*** for example to “0.0 TWh” to include units in the end.
***Annotations*** can be used [as in View3D](/docs/inDetail/annotation-3D.md).
### Pie slices
Pie chart data is stored in ***ViewPie3D. Values*** collection. Each item in the list is of type ***PieSlice***. Edit the data value with ***Value*** property. Set title string into ***Title.Text*** property. By defining ***TitleAlignment*** = *Outside*, the title is drawn outside the pie.

*The Values list editor of a Pie chart.*
### Setting data by code
Data is stored in the ***ViewPie3D. Values*** list as ***PieSlices***.
```csharp
//Add pie slice data
//By using true as last parameter, the slice is automatically added to
//chart.ViewPie3D.Values collection
PieSlice slice1 = new PieSlice("Hydroelectric", Color.FromArgb(150, Color.Aqua), 1.0, chart.ViewPie3D, true);
PieSlice slice2 = new PieSlice("Gas", Color.FromArgb(150, 0, 0, 0), 2.1, chart.ViewPie3D, true);
PieSlice slice3 = new PieSlice("Nuclear", Color.Lime, 1.3, chart.ViewPie3D, true);
PieSlice slice4 = new PieSlice("Oil & coal", Color.FromArgb(240,0,0,0), 3.2, chart.ViewPie3D, true);
PieSlice slice5 = new PieSlice("Others", Color.Yellow, 0.66, chart.ViewPie3D, true);
slice3.Explode = true;
```

*Data set into chart. Third slice is separated by using slice3.Explode = true.*
### Viewing pie chart in 2D
Set the camera as predefined camera from top.
```csharp
chart.ViewPie3D.Camera.SetPredefinedCamera(PredefinedCamera.PieTop);
```

*Pie chart shown as 2D, with a predefined camera from top.*
### Examples
:::info
To see feature demonstration as example, check *Pie2D*, *ExamplePie3D* and *ExampleDonut* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## VolumeModel
## Volumetric Rendering (VolumeModel)
***VolumeModel*** is a tool for volumetric data visualization via *Direct Volume Rendering*. ***VolumeModel*** takes the volume data and visualizes it. LightningChart’s volume rendering engine is based on the *Volume Ray Casting*.
An image is produced by the algorithm via the volume data sampling along the tracks of the rays which travel inside the dataset. A simple realization of hardware acceleration for *Volume Ray Casting* requires generating boundaries for a volume object. Usually, they are represented by a cube. High rendering quality without artifacts, and usage of the interchangeable ray function are the main advantages of this technology.
***RayFunction*** is the core of the algorithm providing it with a very high level of flexibility. The technique is powerful because it specifies the way how the data is sampled and combined. This makes it a very useful tool for feature extraction.
:::info
To see feature demonstration as example, check *Volume head*, *Volume flow*, *Volume geo*, *Volume skeleton*, *Volume wave interference*, *ExampleColoringVolumeModel*, *ExampleTranslucentChart3D* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
:::danger[Note]
VolumeModels are available only when DirectX 11 renderer is used.
:::
### Loading data
There are several ways how the data can be imported to the ***VolumeModel***:
- Data can be supplied to ***Data*** property as a collection of images which represent slices of the dataset
- Data can be supplied directly to the constructor of the ***VolumeModel*** in various ways
- Data can be supplied to the ***VolumeModel*** via one of the ***Load-*** functions
***LoadFromBytes()***, ***LoadFromSliceMap()*** and ***LoadFromSlices()*** functions and constructors allow supplying data as a collection of slices (similarly to Data property) or as a string with a path to the folder with the slices (with .NET supported image extension). The data can also be provided as a texture map created by our tool. A texture map consists of slices, but its supplement also needs additional information about the number of slices on the picture. This is required for efficient usage of GPU input buffers. Texture maps can be created via ***ChartTools.CreateMap()*** function. Direct input of texture map is used to speed up the start of an application for a very big dataset.
### Properties
***VolumeModel*** contains typical properties of a 3D object in LightningChart, for example ***Visible***, ***Rotation***, ***Size***, ***Position***, ***AllowUserInteraction***, and ***HighLight***. In addition, the object has specific properties, which define how Volume Rendering engine handles volumetric data.

*Properties tree of VolumeModel*
#### Ray Function
***RayFunction*** property allows choosing one of the three ways of voxel sampling and composition available in LightningChart Volume Rendering Engine:
- Accumulation collects and combines as much data as possible. The visualization which is produced by this technique looks like a semi-transparent gel. The figure below shows an example of Accumulation application visualizing a medical dataset.

*Example of a medical application for the RayFunction.Accumulation*
- MaximalIntensity takes into account only the brightest values sampled by the ray. Visually it provides a very similar result to X-ray images. It allows to get an additional information about the internal structure of the object. MaximalIntensity applications for skeleton visualization and ultrasound wave’s interference simulation are shown below.

*Examples of a Maximum Intensity Ray Function application*
- Isosurface draws the model surface in a way that it looks like a polygonal model rendering. The result is very similar to those produced by Indirect Volume Rendering. Figures show examples of Isosurface applications for the visualization of human skull CT and simulation of water flow.

*Examples of an Isosurface Ray Function application*
#### Threshold
The Volume Rendering Engine can apply a threshold range (***Threshold*** property) to the ***VolumeModel***. ***Threshold*** removes colors outside the range. Every color channel (R, G or B) can have its own range, where values are between 0.0 and 1.0. The voxel is visualized only if the corresponding color values are lower than the high boundary, and higher than the low boundary at all the channels. This property is not taken into consideration by the mouse hit test.

*Example of two different threshold settings. Threshold.Max is same for both images, and equal 1.0. On the left, Threshold.Min = (0.5f, 0.5f, 0.5f), which cut away skin and soft tissues. On the right, Threshold.Min = (0.2f, 0.2f, 0.2f). RayFunction = Isosurface.*
#### Color clipping
Volume models have ***ClipColorRange*** and ***ColorRangeToClip*** properties, which like ***Threshold***, can be used to clip certain colors from the model. However, they work the opposite way. Color clipping doesn’t render colors within the defined color ranges, whereas ***Threshold*** removes colors outside the range.
***ClipColorRange*** controls whether color clipping is enabled or not. ***ColorRangeToClip*** allows setting the actual color ranges that should be removed. Minimum and maximum clip values can be set via ***Min*** and ***Max*** properties for each color channel separately. Alternatively, all values can be modified simultaneously by assigning ***RangeRGB*** object to ***ColorRangeToClip***. The clipped values should be between 0.0 and 1.0. After the ranges have been set, each color combination that is within the defined ranges will be clipped. Clipping takes all color channels into account simultaneously.
```csharp
// Enabling color clipping.
_chart.View3D.VolumeModels[0].ClipColorRange = true;
// Modifying a single channel value.
_chart.View3D.VolumeModels[0].ColorRangeToClip.Min.R = 0.1;
// Assigning all clip ranges simultaneously.
_chart.View3D.VolumeModels[0].ColorRangeToClip =
new RangeRGB(new PointRGB(0, 0, 0), new PointRGB(0.2, 0.2, 0.2));
```

*Original Volume Model on the left. On the right, color clipping is used to remove the blue channel.*
#### Slice Range
***SliceRange*** property allows cutting away a part of the ***VolumeModel*** along X-, Y- or Z-axis. It is a very useful tool for the exploration of the object’s internal structure. ***SliceRange*** contains two boundaries, ***Min*** and ***Max***, both of which are represented by three pointing float values (values are between 0.0 and 1.0).

*Example of Accumulation Ray Function and SliceRange modification*
#### Sampling Rate Options
**Sampling Rate** is a very important property to the final image quality. It defines how often the volume dataset is sampled along the ray’s track. A higher *Sampling Rate* produces better quality but requires more powerful hardware. Sampling Rate influences [***RayFunction***](#Ray-Function) options, especially *Accumulation*. Artefacts produced by low sampling rate are less noticeable when using *MaximalIntensity*. Furthermore, *Isosurface* can be too sharp at a very high sampling rate. Usually, the sweet spot equals to the number of voxels on the side which is placed along the ray tracks.
***SamplingRateOptions*** contains several options for **Sampling Rate Manager**. *Sampling Rate Manager* is needed to reach the optimal balance between quality and frame rate for a hardware. By default, *Sampling Rate Manager* is turned on by the property ***Enabled*** being set *true*. If set *false*, ***ManualSamplingRate*** value will be used. ***SamplingRateRange*** defines the boundaries for *Sampling Rate Manager*. ***Inertness*** specifies how rapid is the reaction of sampling rate in case of performance changes. ***TargetFPS*** is a target value, which sampling rate manager tries to achieve.

*Example of low sampling rate: 32(left), 64(right)*
#### Smoothness
***Smoothness*** property prevents too high details of the surface. It smoothens the surface of the model and reduces some noise and other artifacts.

*Example of too high sampling rate, fixed by smoothness property. RayFunction = Isosurface.*
#### EmptySpaceSkipping
***EmptySpaceSkipping*** property defines a resolution of empty space, skipping sampling. A low value (16-32) of ***EmptySpaceSkipping*** improves the performance but can cause artifacts in the model edges.

*Example of too low EmptySpaceSkipping property value. RayFunction = Isosurface.*
#### Opacity
***Opacity*** specifies the behavior of *Accumulation* option of ***RayFunction***. The lower the ***Opacity***, the more transparent the object will be.

*Example of Accumulation Ray Function Opacity modification: 15% (left), 45% (right).*
#### Transfer function: Brightness and Darkness
One of the very basic method to customize the look of a volumetric rendering is to use
a transfer function. ***Brightness*** and ***Darkness*** properties define the image’s transfer function. It is represented by the linear function:
:::tip[Transfer function]
output = Brightness * ( input - Darkness ),
:::
where ***Darkness*** works as Subtrahend for original RGB colors, while ***Brightness*** works as Coefficient. If ***Brightness*** >1, corresponding RGB values in output will be brighter.
### Examples
:::info
To see feature demonstration as example, check *VolumeHead*, *VolumeFlow*, *VolumeGeo*, *VolumeSkeleton*, *VolumeWaveInterference*, *ColoringVolumeModel* and *TranslucentChart3D* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## WaterfallSeries3D
With ***WaterfallSeries3D***, the data is visualized in area strips. Areas can be filled, wire-framed and contour-lined like [SurfaceGridSeries3D](/docs/inDetail/SurfaceGridSeries3D.md). In Y-dimension, area starts from ***BaseLevel*** property value. The node data can be set like in [SurfaceMeshSeries3D](/docs/inDetail/SurfaceMeshSeries3D.md).

*Two waterfall series. On the left violet series, X and Z are in rectangular form. BaseLevel = 10. On the right redgreen-blue series, X and Z values are bent, and each row is placed in different horizontal location.*
WaterfallSeries3D is especially handy for presenting traditional 3D spectrum.

*Waterfall series used for traditional spectrum presentation.*
### Examples
:::info
To see feature demonstration as example, check *WaterFall3D*, *Spectrum3D* and *Spectrum3DWaterfall* from [our Demo](/docs/getting%20started/RunningDemo.md).
:::
---
## XAML serialization
## XAML serialization compatibility
LightningChart .NET supports XAML serialization from version 12.0. This means that .NET class ***XamlWriter*** can be used to serialize LightningChart object into XAML markup, while .NET class ***XamlReader*** can be used to read XAML input and create a LightningChart object. By using *XamlWriter.Save()* and *XamlReader.Load()* methods user can save the state of the Chart (save value for the most of its properties) and import that state next time user opens the application. The example of XAML string of serialized Chart shown in screenshot.
:::note
1) Series Data/Points properties are not serialized;
2) VolumeModel properties are not serialized;
3) starting from 12.0 version it is perfectly fine to create chart in *.xaml code with non-bindable edition of LightningChart, although if someone needs to bind chart properties, then MVVM edition of LightningChart should be used.
:::

*Example Xml/XAML file after XamlWriter.Save()*
### Using global string for serialization
If application is not closed during XAML serialization, then string can be used to store and retrieve state of the Chart. For example, saving XAML with
```csharp
string SavedXaml = XamlWriter.Save(_chart);
```
and loading XAML string with
```csharp
_chart.Dispose();
StringReader stringReader = new StringReader(SavedXaml);
XmlReader xmlReader = XmlReader.Create(stringReader);
_chart = (LightningChart)XamlReader.Load(xmlReader);
```
### Using file for serialization
LightningChart object can be serialize directly to file, and then deserialized from that file. For example, saving XAML with
```csharp
// Open or create the output file.
using (FileStream xamlFile = new FileStream(@"c:\temp\test.xml", FileMode.Create, FileAccess.ReadWrite))
{
// Save the contents of the Chart to the file stream that was just opened.
XamlWriter.Save(_chart, xamlFile);
}
```
and loading from XAML file
```csharp
_chart.Dispose();
using (FileStream xamlFile = new FileStream(@"c:\temp\test.xml", FileMode.Open))
{
_chart = (LightningChart)XamlReader.Load(xamlFile);
}
```
:::info
To see feature demonstration as example, check *ExampleXamlSerialization* from [our Demo](/docs/getting%20started/RunningDemo.md).
While ExampleXamlSerialization shows how ‘state’ of a chart could be saved and restored, Demo allows to save XAML string of serialized Chart of any example (button ‘Extract Xml’).
:::
---
## Series rendering order in ViewXY
When rendering series of the same type in ViewXY, they are rendered in the same order as they appear in the corresponding collection (series type). For example, from ***SampleDataBlockSeries*** list series at 0 index will be rendered first, followed by series at index 1 etc. Different types of series are rendered in a predefined order in LightningChart. That can be manipulated by changing the XAxis index the particular series is assigned to, because all series assigned to the first XAxis are rendered first (followed by all series assigned to the second XAxis).
### ZIndex
From version 12.4 properties ***SeriesXY. ZIndex*** and ***ViewXY. ApplyZIndex*** are added, which allows to customize z-order. User needs to set ***ZIndex*** value higher (default is -1), if one wants series to be rendered at the top. Once ***ApplyZIndex*** is enabled, new order is applied. When ***ZIndex*** is the same, the series appearing earlier in series collection is rendered first. Note that this feature is different from ordering titles in LegendBox (see [series LegendBoxOrderIndex property](/docs/inDetail/legend-box-properties.md)).

*On the left normal rendering order of BarSeries, on the right reversed (by setting ZIndex in reverse)*
---
## Data overview or zoom-bar window
Sometimes it is very useful to have a data overview window next to the zoomed-in chart. Such functionality can be done with ***ZoomBar*** and ***LiteZoomBar*** controls.
### ZoomBar
***ZoomBar*** is a custom XY chart, that can be used to get an overview of the whole dataset and to zoom the chart to specific areas. When a Zoom bar is created, it takes the chart (it is referring to) as a parameter. Since Zoom bar is a separate instance of LightningChart, it can be placed on a different container than the main chart. *CustomControls* namespace needs to be used in order to use Zoom bars.
```csharp
using LightningChartLib.WPF.Charting.CustomControls;
// Creating a LightningChart object, then adding a Zoom bar referring to it. LightningChart _chart = new
LightningChart(); mainGrid.Children.Add(_chart);
zoomBarGrid.Children.Add(new ZoomBar(ref _chart));
```
***ZoomBar*** automatically shows all the series in the main grid. However, ***ZoomBarOptions***, which contains all properties to control Zoom bar behaviour, has ***SeriesToUse*** option that allows hiding specific series types. It is possible to hide the line while keeping the points visible and vice versa. By default, points are hidden in Zoom bar, only the line is visible. Note that if the line or the points are not visible in the main chart, they cannot be shown in the Zoom bar either.
For example,
```csharp
// Hiding all PointLineSeries lines in the Zoom bar chart.
zb.ZoomBarOptions.SeriesToUse.PointlineSeries.LineVisible = false;
```

*A Zoom bar has been added below the main chart, giving an overview of the whole data. Data points of the Point Line Series are visible in the main chart but not for the respective series in the zoom bar.*
In real-time charts, where new data is constantly added, the ***ZoomBar*** is unable to update itself automatically. In these cases, series specific add data method such as ***AddDataToPointLineSeries()*** or ***AddDataToHighLowSeries()*** should be called with the added data points as a parameter.
```csharp
// Updating series in Zoom bar. The first parameter is the series index.
zoomBar.AddDataToPointLineSeries(0, seriesPointArray);
```
Alternative for updating ***ZoomBar*** chart is to call ***ZoomBar. Invalidate*** with input argument specifying which series type to update.
```csharp
// Updating series in Zoom bar. The input argument specifies which series type to update.
zoomBar.Invalidate(InvalidateSeries.SampleDataSeries);
```
In version 12.4 ***Pan*** property is added to ***ZoomBar*** user-control. ***Pan*** property controls the direction of zoom-box movement inside this custom control. Previously (also the default behavior after 12.4) zoom-box can be dragged with mouse-cursor in both directions. With ***Pan*** it is possible to limit zoom-box dragging only to Vertical or Horizontal direction.
### LiteZoomBar
From version 12.4 ***LiteZoomBar*** control can be used. ***LiteZoomBar*** is a UserControl for XY chart, which can be used to get an overview of the whole dataset and to zoom the chart to specific areas. As name suggest, ***LiteZoomBar*** is lightweight version of [ZoomBar](#ZoomBar). It is basically a bitmap image (of reference chart) with range selection rectangle on top. Therefore, it lacks the normal interactivity of LightningChart or [ZoomBar](#ZoomBar). However, the memory consumption is significantly reduced.
When a Zoom bar is created, it takes the chart (it is referring to) as a parameter. ***LiteZoomBar*** can be used as standard UserControl. For example, it can be placed in separate Window, Form, grid cell or even on top of the main chart. *CustomControls* namespace needs to be used in order to use Zoom bars.
```csharp
using LightningChartLib.WinForms.Charting.CustomControls;
_Window = new Form();
_Window.Location = new Point(this.Left + 50, this.Top + 50);
LiteZoomBar liteZoomBar = new LiteZoomBar(ref _chart);
liteZoomBar.Dock = DockStyle.Fill;
_Window.Controls.Add(liteZoomBar);
```
***LiteZoomBar*** does not have way to fully customize the appearance like in [ZoomBar](#ZoomBar), but few options are still available. User can set ***Options*** to change appearance of selection box, visibility of axes, legendbox or chart title, or the size of the margins (Note, ***AutoAdjustMarginsInSnapshot*** should be disabled for ***ViewMarginsInSnapshot*** to be taken into account). ***LiteZoomBarOptions*** may be set like the following:
```csharp
liteZoomBar.Options = new LiteZoomBarOptions()
{
BorderColor = Color.FromArgb(0x66, 0xCC, 0xFF),
BorderThickness = 2,
ShowXAxisInSnapshot = false,
ShowYAxisInSnapshot = false,
ShowLegendInSnapshot = false,
AutoAdjustMarginsInSnapshot = false,
ViewMarginsInSnapshot = new Padding(50),
ShowTitleInSnapshot = false,
};
```
.png)
*LiteZoomBar has been added as separate window on to top of the main chart, giving an overview of the whole data.*
When user needs to update/refresh ***LiteZoomBar*** / screenshot of main chart, one should call ***liteZoomBar. RefreshZoomBar()*** method.
---
## Zooming and panning (XY)
## Zooming and panning (ViewXY)
Zooming and panning are configurable and can be performed by left or right mouse button. Zooming can be also performed with mouse wheel. Zooming and panning could be performed on touch screen as well.
Use ***ViewXY. ZoomPanOptions*** to control the zooming and panning settings.

*ZoomPanOptions properties and sub-properties*
### Zooming with touch screen
Set two fingers on the chart and pinch the fingers closer to zoom out, or away to zoom in.
The chart tries to detect if intensions to do a horizontal or vertical zooming, or both at same time. This feature is called ‘zooming with rails’, which can be controlled by ***MultiTouchZoomDirection*** (*Free/ XAxis/ YAxis/ Rails*).
By pinching/spreading fingers above an X or Y axis or their labels, the zooming applies to that specific axis only.
Zooming with touch can be disabled by setting ***MultiTouchZoomingEnabled*** = false.
### Panning with touch screen
Set two fingers on the screen and slide them at same pace to pan the view.
Some systems support panning with inertia, so it is possible to “throw” the fingers off the screen, and the view keeps panning and finally slows down until stopped.
By setting a finger above an X or Y axis or labels of it, and sliding the finger, the panning applies to that specific axis only.
### Left mouse button action
Set ***DevicePrimaryButtonAction*** to *Zoom*, to enable zooming with left mouse button. Set it to *Pan* to enable panning. To disable zoom and pan from left mouse button, set it to *None*.
### Right mouse button action
Set ***DeviceSecondaryButtonAction*** to *Zoom*, to enable zooming with right mouse button. Set it to *Pan* to enable panning. To disable zoom and pan from right mouse button, set it to *None*.
### RightToLeftZoomAction
***RightToLeftZoomAction*** applies when ***DevicePrimaryButtonAction*** or ***DeviceSecondaryButtonAction*** is set to *Zoom*. ***RightToLeftZoomAction*** specifies what happens when mouse zooming is made from right to left (mouse X button down-coordinate > button up-coordinate). The following selections are available:
ZoomToFit:
Fits all Y axes and X axes so that all series data belonging to them is shown. By using ZoomPanOptions.ViewFitYMarginPixels with greater value than 0, the axes are scaled so that given space in pixels is reserved empty of data, in both Y axis minimum and maximum end.
RectangleZoomIn:
Zooms in with rectangle, as in zooming from left to right.
ZoomOut:
Zooms out, by using ZoomFactor.
RevertAxisRanges:
Sets axis values to specific values, which are restored after the view has been zoomed or axis ranges have been otherwise modified. In each axis, there’s RangeRevertEnabled property, which controls if the axis range should be reverted. If it’s enabled, RangeRevertMinimum and RangeRevertMaximum properties are applied to the axis when dragging mouse from right to left, and the mouse button is released.
PopFromZoomStack:
Sets the same axis ranges that were used when zooming-in last time, in other words, goes back to the previous zoom level.
### Zooming with mouse button
#### Zoom in/out by clicking
Use ***ZoomFactor*** property to control the how much closer/farther the zoom is applied. To apply negative zoom effect, set value as inverse value (1/factor). The zoom is applied using mouse cursor position as a zoom center point.
X dimensional zoom:
With chart control focused, press Shift key down. Zoom X cursor appears. Click configured mouse button to zoom in, and the other button to zoom out.
Y dimensional zoom:
With chart control focused, press Ctrl key down. Zoom Y cursor appears. Click configured mouse button to zoom in, and the other button to zoom out. When using a stacked ***YAxisLayout***, zooming applies to all graph segments (Y axes). By pressing Ctrl and Alt keys down, the Y dimensional zoom is applied only to the graph segment the mouse was clicked over.
Press both Shift and Ctrl(+Alt) keys down simultaneously, for applying zoom to both X and Y dimensions.
#### Zooming with mouse cursor options
With configured mouse button, drag a rectangle around the area to be zoomed, from upper left corner to bottom right corner. Both X and Y dimensions are affected. To limit rectangle drawing/zoom inside graph area enable ***RectangleZoomLimitInsideGraph*** property.
***RectangleZoomMode*** -property allows configuring in which position the zoom rectangle is drawn and what how different directions should be handled. By default, the property is set to *HorizontalAndVertical*, meaning that the area drawn by dragging mouse from left to right is to be zoomed. Respectively zoom-out rectangle is drawn when mouse is dragged from right to left. If ***RectangleZoomMode*** is set to *Horizontal* or *Vertical*, only that direction will be zoomed.
Both X-axes and Y-axes have ***axis. ZoomOrigin*** -property which can be used to set the position around which the zooming rectangle will be centered. If ***RectangleZoomMode*** is set to use *AboutYAxisZoomOrigin*, *AboutYAxisZoomOrigin* or *AboutXYZoomOrigin*, the position set via ***ZoomOrigin*** settings will always be used as a center point of the zoom rectangle.

*Standards settings: ZoomPanOptions.RectangleZoomMode = HorizontalAndVertical. ZoomOrigin has no effect on the zooming rectangle.*

*ZoomPanOptions.RectangleZoomMode = Horizontal. Only X-axis is zoomed, while Y-axis remain unchanged.*

*ZoomPanOptions.RectangleZoomMode = Vertical. Only Y-axis is zoomed, while X-axis remain unchanged.*

*ZoomPanOptions.RectangleZoomMode = AboutXYZoomOrigin. Mouse down position ignored. Zoom rectangle is drawn relatively to ZoomOrigin (of both Axes) and mouse current position.*

*ZoomPanOptions.RectangleZoomMode = AboutXAxisZoomOrigin. Zoom rectangle is centered around XAxis.ValueOrigin. Vertical size of zoom rectangle defined by mouse-down and mouse-up position.*

*ZoomPanOptions.RectangleZoomMode = AboutYAxisZoomOrigin. Zoom rectangle is centered around YAxis.ValueOrigin. Horizontal size of zoom rectangle defined by mouse-down and mouse-up position.*
:::note
***ViewXY.ZoomPanOptions*** properties ***RectangleZoomAboutOrigin*** and ***RectangleZoomDirection*** are replaced with ***RectangleZoomMode*** in version 9.0.1. Older properties removed completely in v10.0.1.
:::
#### Configuring Zoom in rectangle
When ***DevicePrimaryButtonAction*** or ***DeviceSecondaryButtonAction*** property is set to *Zoom*, zoom-in rectangle appears when zooming. The zoom rectangle border and fill style can be modified by using ***ZoomRectFill*** and ***ZoomRectLine*** properties.
#### Configuring zoom out rectangle
When ***RightToLeftZoomAction*** is set to *ZoomToFit*, *ZoomOut*, *RevertAxisRanges* or *PopFromZoomStack*, the zoom out rectangle appears when zooming. Configure its fill by ***ZoomOutRecFill*** and line style by ***ZoomOutRectLine***.
### Zooming with mouse wheel
When ***WheelZooming*** is enabled, zoom in by scrolling the mouse wheel upwards and zoom out by scrolling it downwards. The zoom center is the position of mouse cursor. Use ***ZoomFactor*** to adjust the mouse wheel zoom strength (Note, the ***ZoomFactor*** is used indirectly, because also wheel’s delta taken into account).
By keeping Shift key pressed, the zoom is applied only to X dimension. By keeping Ctrl key pressed, the zoom applies only for Y dimension.
### Zooming and panning with device wheel over axis
Use ***AxisWheelAction*** to configure the outcome of device wheel actions applied over an axis.
None:
The wheel does nothing
Zoom:
Zoom only the axis the pointer is currently over
Pan:
Pan only the axis the pointer is currently over
ZoomAll:
Zooms all X axes if pointer is over an X axis, or all Y axes if over a Y axis. Applies to other axes only when YAxisLayout = Layered.
PanAll:
Pans all X axes if pointer is over an X axis, or all Y axes if over a Y axis. Applies to other axes only when YAxisLayout = Layered.
### Panning with mouse button
Configure ***DevicePrimaryButtonAction*** or ***DeviceSecondaryButtonAction*** to *Pan* for panning to work. Drag the graph area with the configured mouse button pressed down. To stop panning, release the button. Panning scrolls both X and Y axes by dragged amount, if ***PanDirection*** is *Both*. By setting ***PanDirection*** *Vertical*, it only targets Y axes. Respectively, ***PanDirection*** *Horizontal* targets only X axes. Use ***PanThreshold*** to give some tolerance in pixels before the panning starts to affect. It’s very handy when using ContextMenuStrip control assigned for the chart control, preventing it to open every time the panning stops.
### Enabling/disabling Ctrl, Shift and Alt
Zoom operations support these modifier keys, and by default, they are enabled. To disable them, set ***AltEnabled*** = False, ***CtrlEnabled*** = False or ***ShiftEnabled*** = False.
### Zoom in/out with code
Use ***ViewXY. ZoomByFactor(…)*** method to zoom with a center point and a zoom factor. Use ***ViewXY. Zoom(…)*** method to zoom with rectangle. ***ViewXY. ZoomToFit()*** method fits invokes ”Zoom to fit” operation (fits all Y axes and X axis so that all series data is shown).
### Zooming an axis by code
Set values to X or Y axis ***Minimum*** and ***Maximum*** properties. Use ***Axis. SetRange(…)*** to set them both at same time.
### Linking Y axes zoom with same units
By enabling ***RectangleZoomUnitsLinkYAxes***, all the Y axes having the same ***Units.Text*** string get the same Y axis range as the axis that was rectangle zoomed.

*Stacked view with 5 Y axes. When rectangle zoom is applied over a graph segment, the Y axes of it get zoomed, and the new Y axis range is copied to all Y axes having the same Units.Text.*
### Automatic Y fit
Use ***AutoYFit*** property to control the automatic Y axis adjustment. Automatic Y fit can be used to adjust the Y axis ranges to show all the data in the chart in visible X axis range. It is intended especially for real-time monitoring purposes. The fit is applied in time intervals, use ***UpdateInterval*** to set the interval in milliseconds. ***MarginPercents*** can be used to define if any empty space should be left between the series and the graph borders. By enabling ***Through***, the fitting analysis is made for all data, but may cause some overhead in performance critical systems. By disabling it, only a small piece of latest data is used for fitting routine and may cause improper behavior in certain applications.
***AutoYFit*** can be enabled via ***ZoomPanOptions***:
```csharp
_chart.ViewXY.ZoomPanOptions.AutoYFit.Enabled = true;
```
Which Y-axes are automatically fit should be also defined. With ***AutoYFit. TargetAllYAxes***, automatic Y fit can be applied to every Y-axis simultaneously. Alternatively, ***yAxis. AllowAutoYFit*** can be enabled for each Y-axis separately.
```csharp
// Enable AutoYFit for all Y axis.
_chart.ViewXY.ZoomPanOptions.AutoYFit.TargetAllYAxes = true;
// Enable AutoYFit only for this Y axis.
_chart.ViewXY.YAxes[0].AllowAutoYFit = true;
```
:::tip
***AxisY*** class also has ***Fit()*** methods for fitting in Y dimension.
:::
:::tip
Examples of usage could be found in our Demo application (see [Learning from Demo](/docs/getting%20started/RunningDemo.md)): *Signal reader; Audio L+R, area, spectrograms; Waveform, persistent spectrum*.
:::
### Aspect ratio
***AspectRatioOptions. AspectRatio*** controls the X/Y (or longitude / latitude in maps) ratio.
By default, it is set *Off* allowing X and Y axis ranges be set individually. By setting the aspect ratio to *Manual*, the ***AspectRatioOptions. ManualAspectRatioWH*** property can be used to set the preferred ratio. Changing ***ManualAspectRatioWH*** adjusts the x axis Minimum and Maximum properties to get the desired aspect ratio. Zooming operations will follow aspect ratio setting.
***ManualAspectRatioWH*** is calculated as follows:
***ManualAspectRatioWH*** = View width in pixels / View height in pixels * X axis range / Y axis range
For example:
***ManualAspectRatioWH*** = 1530 / 902 * (20 – 0) / (100 – 0)
Width and height of the view depends on the window size. Axis ranges are simply maximum – minimum.
When ***AspectRatio*** is other than *Off*, axis scaling nibs are not available.
For maps ([Geographic maps (in ViewXY)](/docs/inDetail/geographic-maps.md)), ***AspectRatio*** = *AutoLatitude* is a very useful option. *AutoLatitude* changes the aspect ratio dynamically when viewing the map in different locations. The aspect ratio is determined by the center point of the view.
### Excluding specific X or Y axes from zooming and panning operations
To exclude specific X or Y axes from Zooming operations, set ***axis. ZoomingEnabled*** = *False*
To exclude specific X or Y axes from Panning operations, set ***axis. PanningEnabled*** = *False*
### Modifying zooming and panning behavior with event handlers
Besides ***ViewXY. ZoomPanOptions*** properties tree, user can use event handlers to control the zooming and panning settings. The event handlers could be used for fine turning zooming and panning functionality/behavior. The relevant events are ***ViewXY. BeforeZooming***, ***ViewXY. BeforePanning***, ***Axis. RangeChanged***, ***ViewXY. Panned*** and ***ViewXY. Zoomed***.
The example of usage could be found in how-to pages: [limit zooming range](/docs/how-to/limit-axis-range.md).
---
## Zooming and panning (InDetail)
***ZoomPanOptions***, ***ZoomCenter***, ***ZoomScale*** properties and ***ZoomToFit()*** method can be used to control the zooming and panning behavior.
### Zooming by code
Zooming can be applied by code, by setting ***ZoomCenter*** and ***ZoomScale*** properties. ***ZoomCenter*** is defined as relative X-Y ranges:
Horizontal panning
- X = -1: polar view's left edge at center of chart area
- X = 0: polar view's center at center of chart area
- X = 1: polar view's right edge at center of chart area
Vertical panning
- Y = -1: polar view's bottom edge at center of chart area
- Y = 0: polar view's center at center of chart area
- Y = 1: polar view's top edge at center of chart area
***ZoomScale*** is the magnifying factor. For example, value 2 makes the chart appear twice as large in both X (vertical) and Y (horizontal) direction compared to 1. When ***ZoomScale=1***, the diameter of polar circle is equal to chart's width or height (depending which one is smallest).
### Mouse-zooming features
Mouse-zooming features can be configured in ***ViewPolar. ZoomPanOptions*** property tree.

*ViewPolar's ZoomPanOptions.*
### Zooming operations and methods
Various zooming operations under ***ZoomPanOptions*** can be set as mouse actions. For example, when properties ***DevicePrimaryButtonAction*** and/or ***DevicePrimaryButtonAction*** set for a *Zoom* option, the ***RightToLeftZoomAction*** property’s option *DefaultSettings* returns the initial zoom and centering settings. If ***RightToLeftZoomAction*** property’s option is *ZoomToData* (called *FitView* before v8.4), then action moves the viewpoint to show all data inside the margins. If ***RightToLeftZoomAction*** property’s option is *ZoomToLabelsArea*, action shows the whole data frame including labels inside the margins.
ViewPolar has the ***ZoomPanOptions. ZoomPadding*** property, which works similarly to View3D [ZoomPadding](/docs/inDetail/ZoomPanRotate3D.md).
The zooming operations can also be accessed in code as methods by using ***ZoomToFit()*** with ***ZoomAreaRound*** parameter (options are *Data*, *LabelsArea* and *DefaultSettings*). For instance, calling ***ZoomToFit(ZoomAreaRound.LabelsArea)*** method gets the same result as performing *ZoomToLabelsArea* operation via mouse action.

*Polar chart before and after a zooming operation, ZoomPadding = 50. On top, the chart has been manually zoomed but no zoom operation has been called; ZoomPadding has no effect. Below, ZoomToLabelsArea was used, which also takes the labels into account when zooming.*
---
## Zooming, panning and rotating
***ZoomPanOptions*** properties can be used to control the zooming, panning and rotation settings.
Depending on the settings, zooming can be performed with mouse wheel, by touch screen pinching/spreading, or by painting a box on selected 3D plane. Panning, box zooming, and rotating can all be performed by left, middle or right mouse button, as they are configurable. Panning can be made for the whole 3D chart, or so that primary axes are adjusted while keeping the 3D scene location the same.

*ZoomPanOptions properties and sub-properties, with DevicePrimaryButton / DeviceTertiaryButtonAction / DeviceSecondaryButtonAction options on the right.*
### Mouse wheel zooming
Scroll mouse wheel up to zoom in, and down to zoom out. Use ***WheelZoomFactor*** to adjust the amount of applied zoom with every mouse wheel event. To disable mouse wheel zooming, set ***AllowWheelZoom*** to false. By default, this is set true.
### Box zooming
To enable box zooming, assign the box zooming to a mouse button action property. For example, ***DevicePrimaryButtonAction*** = *ZoomXZ* causes the box zoom to apply to XZ plane. Y dimension is not affected. Set *ZoomXZ* or *ZoomYZ* respectively for zooming other planes.

*On the left, XZ-plane box zooming in progress. On the right, the outcome of the zooming. X and Z axis ranges are modified while Y axis range stays the same.*
Zoom in by dragging box from left to right. The zoomed ranges are applied to axes related to the selected plane. To zoom only specific dimension, X, Y or Z, select *ZoomX*, *ZoomY* or *ZoomZ*.
Zoom out by dragging box from the right to left. Zooming out is applied by factor set in ***BoxZoomOutFactor***. Zooming out shows a cross in the front of the box. It can be disabled by setting ***BoxZoomingOutCrossVisible*** = False.
### ZoomPadding
***ZoomPadding*** property defines the amount of empty space left between the 3D model and the margins after a zooming operation. ***ZoomPadding*** has no effect when moving the chart or zooming manually, for example by mouse scrolling. Furthermore, ***ZoomPadding*** does not apply to rectangle-based zooming.
Setting ***ZoomPadding*** in WinForms:
```csharp
chart.View3D.ZoomPanOptions.ZoomPadding = new Padding(10, 30, 10, 10);
```
Setting ***ZoomPadding*** in Wpf:
```csharp
chart.View3D.ZoomPanOptions.ZoomPadding = new Thickness(10, 30, 10, 10);
```

*ZoomPadding leaves empty space between data/labels and the margins if for example ZoomToDataAndLabels operation is used as in this case.*
### ZoomToDataAndLabels
In View3D, *ZoomToDataAndLabels* operation causes the available area, limited by margins and [ZoomPadding](#ZoomPadding), to be used as optimally as possible by moving the camera closer/farther. Axes, labels, series data and markers are all kept visible. Chart title, annotations and legend boxes are ignored as their position is defined in screen coordinates. *ZoomToDataAndLabels* maintains the viewing angle while the contents of the view are centered.
By default, ***DevicePrimaryButtonDoubleClickAction*** property is set as *ZoomToDataAndLabels*, meaning double-clicking the mouse left button activates the operation. Disable this by changing the property to *Off*. In code, *ZoomToDataAndLabels* can be invoked by ***View3D.ZoomToFit(ZoomArea3D.DataAndLabelsArea)*** method.

*ZoomToDataAndLabels operation has been activated. Data series, axes, walls etc. have been optimally fitted within the margins. Orientation arrows follow the bottom-left corner of the graph area but legend boxes are ignored. ZoomPadding = 0 for all edges, thus no empty space is left between the margins and the DataAndLabelsArea.*
:::note
Note that *ZoomToDataAndLabels* takes ***MinimumViewDistance*** property of the camera to account, meaning that in some cases the full available graph area might not be used as the camera can’t get close enough to the chart. A ***ChartMessage*** notification is sent in this case.
:::
### Rotating and panning
***View3D. Camera*** can be rotated around the 3D model by pressing the assigned mouse button down and by dragging horizontally or vertically. ***Camera.*** ***RotationX***, ***RotationY*** and ***RotationZ*** properties are updated.
When (***ZoomPanOptions***) a mouse button action is set to *Pan*, panning updates ***Target*** property of ***Camera***. When mouse button action is set to *PanPrimaryXZ*, *PanPrimaryXY* or *PanPrimaryYZ*, the primary X, Y and Z axes ranges are adjusted. For example, *PanPrimaryXZ* adjusts X and Z axes when dragging with mouse. Secondary X, Y and Z axes are not altered.
Set ***DevicePrimaryButtonAction*** / ***DeviceTertiaryButtonAction*** / ***DeviceSecondaryButtonAction*** to *Pan/PanPrimaryXZ/PanPrimaryXY/PanPrimaryZ* to enable panning. Set it to *Rotate* to enable rotating. To disable panning and rotating from mouse button, set it to *None*.
Use ***PanSensitivity*** to control the amount of applied panning. Respectively, use ***RotationSensitivity*** to control the amount of applied rotation.
### Zooming with touch screen
Set two fingers on the chart, and pinch them closer to zoom out, or away to zoom in. To disable zooming with touch screen, set ***MultiTouchZoomEnabled*** to False.
### Panning with touch screen
Set two fingers on the chart and move them to the same direction to apply panning. To disable panning with touch screen, set ***MultiTouchPanEnabled*** to False.
### Using mouse wheel over an axis
When mouse wheel is scrolled over an axis, the chart makes axis-specific zooming or panning.
***WheelAreaThickness*** adjusts how wide the mouse wheel sensitive area is near the axis.
***AxisWheelAction*** can be used to select between zooming and panning.
### Zooming, rotating and panning by code
3D view is rotated by moving the ***View3D.Camera*** with ***RotationX***, ***RotationY*** and ***RotationZ*** properties. With *Perspective* and *Orthographic* camera, zoom can be done by setting ***ViewDistance***. With *OrthographicLegacy* camera, the ***Dimensions*** are changed to achieve zooming. Panning is done by setting camera ***Target*** as 3D model coordinates.
---
## Zooming and panning (3)
Zooming and panning options and methods in ***ViewSmith*** work exactly the same as in [ViewPolar](/docs/inDetail/ZoomPanPolar.md).
---
## Introduction
LightningChart® .NET SDK is an add-on to Microsoft Visual Studio, consisting of data visualization related software components and tool classes for WPF (_Windows Presentation Foundation_), UWP (_Universal Windows Platform_) and _Windows Forms_ .NET platforms. That is, LightningChart® .NET is available for x86, x64, ARM and ARM64 platforms.
:::tip[NOTE]
LightningChart® .NET assemblies compiled with ***'Any CPU'*** as Platform Target. This mean that application runs as a 64-bit process whenever possible and falls back to 32-bit when only that mode is available. However, the 64-bit variables computed with full 64-bit precision in both 64-bit and 32-bit operating modes.
:::
LightningChart components are delivered for serious scientific, engineering, measurement and trading solutions. The rendering performance and very advanced features are its special focus.
LightningChart components use low-level DirectX11 and DirectX9 GPU acceleration instead of slower GDI/GDI+ or WPF Graphics APIs. LightningChart has fallback to DirectX11/DirectX10 [WARP software rendering](https://learn.microsoft.com/en-us/windows/win32/direct3darticles/directx-warp) when GPU is not accessible, such as in some virtual machine platforms.
### About this document
This document is a collection of tips how to get started and a brief User’s Manual. This document will grow to include not only essential key features, but also every detail of library. Please bookmark this page and visit to find new tips & tricks, code excerpts or just for inspiration.
---
## LightningChart And Ai
Generating code with large language models (LLMs) is a rapidly growing area of interest for developers. While LLMs are often capable of generating working code it can be a challenge to consistently generate code for libraries like LightningChart .NET that have several different versions and use cases.
This section is dedicated to hosting resources to help developers use AI tools with LightningChart .NET better.
### LightningChart MCP Server
By far the easiest way to transform your AI Agents to high-performance charting specialists, is to install the LightningChart MCP server.
**What does this do?**
- It strongly urges your agent to **refer to the official LightningChart documentation**, instead of hallucinated training data memories or random Stack Overflow searches.
- Your agent receives an **LLM-optimized Index** of the entire LightningChart documentation, which is very effective for finding the most suitable documentation page depending on the task at hand, rather than using up a lot of context by reading massive chunks of documentation.
- Last, but not least, we share our hand-written "common mistakes" section with the Agent context, which **prevents majority of recurring mistakes** that Agents otherwise tend to do
**How to install it?**
Choose your AI coding assistant below for specific local setup instructions.
**Claude**
Run the following command in your terminal:
```bash
claude mcp add --scope user lightningchart-dotnet -- npx -y @lightningchart/dotnet-mcp-server@latest
```
**Codex**
Write the following configuration to `.codex/config.toml`:
```toml
[mcp_servers.lightningchart]
command = "npx"
args = ["-y", "@lightningchart/dotnet-mcp-server@latest"]
enabled = true
```
**Antigravity**
Add the following configuration to your MCP settings file:
```json
{
"mcpServers": {
"lightningchart": {
"command": "npx",
"args": ["-y", "@lightningchart/dotnet-mcp-server@latest"]
}
}
}
```
**Cursor**
Add the following configuration to your MCP settings file:
```json
{
"mcpServers": {
"lightningchart": {
"command": "npx",
"args": ["-y", "@lightningchart/dotnet-mcp-server@latest"]
}
}
}
```
**Windsurf**
Add the following configuration to your MCP settings file:
```json
{
"mcpServers": {
"lightningchart": {
"command": "npx",
"args": ["-y", "@lightningchart/dotnet-mcp-server@latest"]
}
}
}
```
**Warp**
Add the following configuration to your MCP settings file:
```json
{
"mcpServers": {
"lightningchart": {
"command": "npx",
"args": ["-y", "@lightningchart/dotnet-mcp-server@latest"]
}
}
}
```
**Other**
Many clients have a UI for adding a custom MCP server. Use these values:
- Name: LightningChart
- Transport: STDIO
- Command: npx
- Arguments: -y
- Arguments: @lightningchart/dotnet-mcp-server@latest
Or add the equivalent JSON configuration:
```json
{
"mcpServers": {
"lightningchart": {
"command": "npx",
"args": ["-y", "@lightningchart/dotnet-mcp-server@latest"]
}
}
}
```
:::tip
If your agent does not automatically use the LightningChart MCP server when you start charting-related tasks, add a rule like this to your `AGENTS.md`, `CLAUDE.md`, or equivalent project instructions:
```text
- For any charting related task, pull up the "lightningchart" MCP server for context before starting.
```
:::
#### Online hosted MCP server
The local setup above is recommended because it runs the MCP server on your own machine. If your agent fails to acknowledge that the LightningChart MCP server exists after you configure it, it was likely unable to start the local `npx` server. In that case, use the online hosted version instead by choosing your AI coding assistant below.
**Claude**
Run the following command in your terminal:
```bash
claude mcp add --scope user --transport http lightningchart-dotnet https://lightningchart.com/net-charts/mcp/
```
**Codex**
Write the following configuration to `.codex/config.toml`:
```toml
[mcp_servers.lightningchart]
url = "https://lightningchart.com/net-charts/mcp/"
enabled = true
```
**Antigravity**
Add the following configuration to your MCP settings file:
```json
{
"mcpServers": {
"lightningchart": {
"url": "https://lightningchart.com/net-charts/mcp/"
}
}
}
```
**Cursor**
Add the following configuration to your MCP settings file:
```json
{
"mcpServers": {
"lightningchart": {
"url": "https://lightningchart.com/net-charts/mcp/"
}
}
}
```
**Windsurf**
Add the following configuration to your MCP settings file:
```json
{
"mcpServers": {
"lightningchart": {
"url": "https://lightningchart.com/net-charts/mcp/"
}
}
}
```
**Warp**
Add the following configuration to your MCP settings file:
```json
{
"mcpServers": {
"lightningchart": {
"url": "https://lightningchart.com/net-charts/mcp/"
}
}
}
```
**Other**
Many clients have a UI for adding a remote MCP server. Use these values:
- Name: LightningChart
- Transport: HTTP
- URL: https://lightningchart.com/net-charts/mcp/
Or add the equivalent JSON configuration:
```json
{
"mcpServers": {
"lightningchart": {
"url": "https://lightningchart.com/net-charts/mcp/"
}
}
}
```
After installation, your Agent will automatically pull in the LightningChart knowledge context when it identifies a charting related prompt!
Source code can be found in [GitHub](https://github.com/Lightning-Chart/lightningchart-dotnet-mcp-server).
### LightningChart Agent Skill
An alternative flavour to the MCP Server, is the official LightningChart .NET Agent **Skill**.
This is also found as open-source in [GitHub](https://github.com/Lightning-Chart/lightningchart-dotnet-agent-skill).
It does the exact same thing, only the installation and use flavour is different:
**Installation**
Copy the `lightningchart-dotnet` folder into a skills directory supported by your agent.
- Project-local Agent Skills location: `.agents/skills/lightningchart-dotnet/`
- OpenAI Codex local skills location: `.codex/skills/lightningchart-dotnet/`
- Claude local skills location: `.claude/skills/lightningchart-dotnet`
Restart the agent/tool. Some times, skills need to be explicitly invoked by mentioning them in your prompt. But in our experience, agents tend to pick the skill up proactively, as long as the task is related to charting.
### llms.txt
In our experience LLM's are very poor at working with specific 3rd party libraries out of the box, because their training data is a mix of all the existing versions of that library. They also tend to hallucinate results by mixing data from various different libraries.
For this purpose, we provide versions of our developer documentation and API reference in LLM friendly formats here:
- lcdotnet-docs-llms.txt
- lcdotnet-api-llms.txt
**Our recommendation** is to ensure your LLM has access to these files and specifically instruct the LLM to use them as the source of truth on all matters regarding LightningChart .NET.
If in practice your LLM attempts un-optimal approaches such as:
- Guessing links to API reference
- Scraping https://lightningchart.com/net-charts/docs/ directly
- Google/Stack overflow searches with LightningChart .NET related keywords
**Then it is most likely a sign that you should tweak or alter your prompt and reattempt the command.**
Our recommendation is to download `lcdotnet-docs-llms.txt` and `lcdotnet-api-llms.txt` to your repository and add following section to your `AGENTS.md`, `CLAUDE.md` or equivalent:
If not already using the LightningChart Skill or MCP server, then you can simply download `lcdotnet-docs-llms.txt` and `lcdotnet-api-llms.txt` to your repository and add following section to your `AGENTS.md`, `CLAUDE.md` or equivalent:
```
- You MUST always use the local files lcdotnet-docs-llms.txt and lcdotnet-api-llms.txt as the only sources of truth for all matters regarding how to use LightningChart .NET
```
### Working with chat-based LLMs
In our experience, chat-based LLMs have much more trouble following a seemingly simple instruction like "refer to X for guidance".
Furthermore, there are great differences between platforms. For example:
- GPT-5.2 - the LLM tells you that it will stick strictly to the specified documentation, then proceeds to dump hallucinated API usages that have never existed in the library
- Sonnet 4.5 / Opus 4.5 - these models were able to follow the instructions well and provide up to date and well referenced recommendations
You can confirm whether the model is listening to your requirement by additionally asking it to cite all references, and checking if it lists external sources.
When receiving non-working results, the reason is often referencing several years old API documentation pages or just answering directly from training data.
Ideally it would be sufficient to just include this in every new chat context:
```
- You MUST always use the https://lightningchart.com/net-charts/docs/llms.txt and https://lightningchart.com/net-charts/api-documentation/llms.txt as the only sources of truth for all matters regarding how to use LightningChart .NET library.
```
Some chat tools also support loading skills / connecting MCP servers!
Here is also an alternate version of developer documentation intended for LLMs where all text content is put into one large file.
In our experience, this doesn't work too well but you can give it a try.
- lcdotnet-docs-llms-full.txt
---
## Milestones / changelog
A brief list of features introduced in latest releases of LightningChart .NET. Here user can find summary of release notes. The complete version history could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login). There changelog for each version list also error fixes and other improvements.
For future trends in LightningChart .NET development check our [Roadmap page](/docs/roadmap.md).
### Version 12.6.1
- LightningChart changed the target framework: .NET Framework 4.8 and .NET 10.0.
- Added [Universal-Data-Parser](/docs/inDetail/universal-data-parser.md) a UserControl which can handle dashboard creation and data loading without single line of code.
- [Custom-colored](/docs/inDetail/advanced-line-coloring.md) lines now render much faster with DirectX and also shown in vector format output.
- Added support for paletted line with DataBreaking for DirectX9 engine.
- [DataCursor](/docs/inDetail/data-cursors.md) will work better with [multi-colored lines](/docs/inDetail/advanced-line-coloring.md).
- DataCursor's ***ResultTable*** will support titles with multiple lines.
- Improved rendering of thick semitransparent lines and new [RemoveOverlapBetweenLineSegments](/docs/beginners%20guide/chart-render-options.md) property.
- [DigitalLineSeries](/docs/inDetail/DigitalLineSeries.md) will support LineSeriesCursor and DataCursor.
- Improved XAxis' labels rendering with ***ScaleBreak***.
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-12-6-1/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 12.5.1
- Added support for 24-bit and 32-bit WAV audio files for [SignalReader and AudioOutput components](/docs/inDetail/signal-tools.md).
- Provided more detailed information about mouse-events over [LegendBox](/docs/inDetail/legend-box-properties.md)
- Added public method GetTitleText() for series-base class.
- [PrintPreview](/docs/inDetail/export-printing.md) dialog to be revised/improved.
- Added [AutoPadding](/docs/inDetail/auto-padding.md) property for ViewXY.
- Added support for [LegendBox](/docs/inDetail/legend-box-properties.md) titles with multiple lines.
- Added [LegendBox](/docs/inDetail/legend-box-properties.md) property, ***VerticalTitlesGap***, which controls minimum gap between LegendBox's titles.
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-12-5-1/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 12.4.1
- More [customization options for Data Cursor (e.g. Result Table rendering)](/docs/inDetail/data-cursors.md).
- [Improved Annotation's arrow style](/docs/inDetail/annotation-XY.md).
- [Added Annotation (readonly) Size property](/docs/inDetail/annotation-XY.md).
- [Improved styling of the LegendBox checkboxes](/docs/inDetail/legend-box-properties.md).
- [Added additional option for customizing Palette labels](/docs/inDetail/IntensityGridSeries.md).
- [Added logarithmic and equidistant Palette steps drawing](/docs/inDetail/IntensityGridSeries.md).
- Added ***LegendBoxOrderIndex*** to various chart series to changes their order in LegendBox.
- Reversed axis support is added to ***ImageLayer***.
- Added ***Pan*** property for [ZoomBar user-control](/docs/inDetail/zoom-bar.md).
- Added lightweight version [ZoomBar](/docs/inDetail/zoom-bar.md), ***LiteZoomBar*** - less interactive but consume less memory.
- Added axis property ***AutoDivSpacingForNumbersInTime*** to set additional control for tick interval.
- Added [CustomMessage](/docs/inDetail/custom-message.md) property on each View to draw text box in left-top corner.
- Series rendering order (per type) in ViewXY now can be controlled with [ZIndex](/docs/inDetail/z-index.md).
- Added Width property for all Views' border.
- Improved [TradingChart](/docs//inDetail/trading-chart.md) and added more features.
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-12-4-1/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 12.3.1
- Improved line-drawing precision to 14-15 digits on ViewXY
- [HERE map](https://lightningchart.com/net-charts/docs/inDetail/geographic-maps/#Tile-maps) rendering services upgraded to use higher quality images as default
- Improved auto-margins calculations
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-12-3-1/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 12.2.1
- LightningChart changes the target framework: .NET Framework 4.8 and .NET 8.0
- [HERE map](https://lightningchart.com/net-charts/docs/inDetail/geographic-maps/#Tile-maps) rendering services upgrade
- Improved MeshModel performance
- Improved XAxis tick interval calculations
- Added VolumeModel XAML serialization support
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-12-2-1/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 12.1.1
- Added [*Hexagon* shape](/docs/inDetail/points-style.md) for Points (series.PointStyle.Shape property) and Markers (Symbol.Shape property)
- Greatly improved interaction with 3D surface object and FreeformPointLineSeries
- ValueRangePalette can have more than 20 steps without performance penalty
- Made 3D-rotation more intuitive
- Improved in zooming behavior then XY block-series (line) have a lot of points
- Improved VolumeModel binding
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-12-1-1/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 12.0.1
- Added [ImageLayer in ViewXY](/docs/inDetail/image-layer.md) is a very large image layer
- Added [IntensityGridSeriesPolar](/docs/inDetail/intensity-grid-polar.md) or Heatmap in ViewPolar
- Added [TransparencyRenderMode](/docs/inDetail/transparency-render-mode.md) for all 3D series
- Improved [DataCursor](/docs/inDetail/data-cursors.md) configuration options
- Made LightningChart control compatible with [XAML serializer](/docs/inDetail/xaml-serializer.md)
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-12-0/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
API changes discussed at length in [Migration guide](/docs/migration%20guides/to-version-12.0.1.md)
:::
### Version 11.0.1
- New .NET target framework (LightningChart .NET now is targeting .NET Framework 4.8 and .NET 6.0)
- Improved [Interactive Examples App](/docs/getting%20started/RunningDemo.md) (now user can also extract example code as .NET 6.0 projects)
- [Improved DPI awareness](/docs/migration%20guides/to-version-11.0.1.md)
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-11-0-1/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
API changes discussed at length in [Migration guide](/docs/migration%20guides/to-version-11.0.1.md)
:::
### Version 10.5.1
- [DataCursor](/docs/inDetail/data-cursors.md) for all 3D, Polar, and Smith series
- [3D TransparencyRenderMode](/docs/inDetail/transparency-render-mode.md) feature
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-10-5-1/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 10.4.1
- [DataCursor](/docs/inDetail/data-cursors.md) for XY series
- New built-in user/custom controls ([ZoomBar](/docs/inDetail/zoom-bar.md), ***ViolinPlot***)
- Force axis labels at both ends (***EndPointLabelsVisible*** property)
- New [Signal Processing Component](/docs/inDetail/signal-tools.md): Digital Filters
- Improvements to chart export when SVG format is used
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-10-4-1/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 10.3.2
- New features added to the [TradingChart](/docs/inDetail/trading-chart.md) control
- Additional features for the [LineSeriesCursor](/docs/inDetail/LineSeriesCursor.md)
- Improved rendering speed for the 3D/2D Spectrograms
- New Examples in [Interactive Examples App](/docs/getting%20started/RunningDemo.md)
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-10-3-2/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 10.3.1
- Several improved Line-Series types: [LiteLineSeries](/docs/inDetail/LiteLineSeries.md), [LiteFreeformLineSeries](/docs/inDetail/LiteFreeformLineSeries.md), [DigitalLineSeries](/docs/inDetail/DigitalLineSeries.md)
- New color-themes
- Improved [StockSeries](/docs/inDetail/StockSeries.md) & [TradingChart](/docs/inDetail/trading-chart.md)
- [MeshModel](/docs/inDetail/MeshModel.md) now has a ***ShadeMode*** property to control whether lighting affects their colors or not
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-10-3/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 10.2.1
- Compatibility with .NET 6.0
- UWP Charts Compatibility with Microsoft Store
- Improved performance and stability of [***SampleDataBlockSeries***](/docs/inDetail/SampleDataBlockSeries.md)
- Better support for DPI awareness and per-monitor awareness
- New built-in user/custom controls (***HalfDonut***)
- A new feature that allows canceling rectangle zooming in ViewXY, ViewPolar, and ViewSmith by pressing Esc-key
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-10-2-1/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 10.1.1
- Innovative Improvements: [***SampleDataBlockSeries***](/docs/inDetail/SampleDataBlockSeries.md) is a new & super-fast line series. [See the full performance results here](https://lightningchart.com/net-charts/demos/sampledatablockseries/).
- [TradingChart](/docs/inDetail/trading-chart.md) improvements
- Walls in 3D view can now be set fully transparent
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-10-1-1/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 10.0.1
- LightningChart® .NET library for developing UWP applications
- LightningChart Trader for WinForms
- Made rendering much faster for the multiple 2D series
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/uwp-charts-v-10/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
API changes discussed at length in [Migration guide](/docs/migration%20guides/to-version-10.0.1.md)
:::
### Version 9.1.1
- The release concentrates mainly on making Interactive Examples App more user friendly
- Made rendering much faster for multiple SeriesEventMarkers, LineCollection and PointLineSeries3D. If count of those object reach thousands, LightningChart is able to rendered them 2 to 10 times faster.
:::info
More about this release could be found [in News](https://lightningchart.com/news/lightningchart-net-version-9-1-1-release/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
### Version 9.0.1
- LightningChart® Trader library is an easy-to-use charting component library for building applications for trading and finance
- New Interactive Examples App: improved browsing and extraction of examples as standalone Visual Studio projects
- Custom coloring for pattern line
- Closed line for 3D point line (***ClosedLine*** property)
- ***Wireframe*** improvement for 3D-surfaces
- New XY zooming options (***RectangleZoomMode*** property)
:::info
More about this release could be found [in News](https://lightningchart.com/news/releases/lightningchart-net-v-9-0/), while detailed change log could be found in [LightningChart’s customer Portal](https://portal.lightningchart.com/user/login).
:::
---
## -> v10.0.1 and above migration
Backwards compatibility breaks
NameSpaces and Filenames have been changed due to branding and clarity (better reflect the data binding in WPF we offer). The Chart control is now LightningChart (instead of LightningChartUltimate). In addition, to make Chart control UWP compatible we renamed or dropped 'Mouse' word from names of Properties, EventArgs, Enum etc. The complete list of name changes can be found in detailed logs below.
### API changes
#### Removed obsolete methods and properties
* ***ChartError*** event is replaced by ***ChartMessage***.
* ChartTools.ErrorTypeToString(errorType) method was removed. Replace with enums ToString extension method instead, e.g. errorType.ToString().
* DoubleClickAction3D enum member FitRect is replaced with member ZoomToDataAndLabelsArea.
* ***ErrorType*** enum is replaced by ***MessageSeverity*** & ***MessageType*** enums instead.
* ***GraphBorderColor*** property is replaced by views ***Border.Color*** property.
* ***GraphBordersOverSeries*** property is replaced by views ***Border.RenderBehindSeries*** property.
* ***OrthographicCamera*** property is replaced by ***Projection*** property of enumeration type ***ProjectionType***.
* ***RectangleZoomAboutOrigin*** is removed and instead ***RectangleZoomMode*** should be used.
* ***RectangleZoomDirection*** property is replaced by ***RectangleZoomMode***.
* ***RightToLeftZoomActionRound*** enum members FitView & DefaultView are replaced with members ***ZoomToData*** & DefaultSettings respectively.
* ***ZoomToDefault()*** method is replaced by ***ZoomToFit*** method with ZoomAreaRound.DefaultSettings.
#### NameSpace and filename changes due to branding and clarity
Arction's DLLs filenames and namespaces have been changed as there are brand name changes to LightningChart® .NET. In addition, we wanted to clarify what data binding in WPF we offer. The Chart control is now called **LightningChart** (instead of *LightningChartUltimate*).
##### The updated/new filenames are
- Arction.WinForms.Charting.LightningChartUltimate.dll => Arction.WinForms.Charting.LightningChart.dll
- Arction.WinForms.TradingCharts.dll (new)
- Arction.Wpf.Charting.LightningChartUltimate.dll => Arction.Wpf.Charting.LightningChart.dll (non-bindable edition)
- Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll => Arction.Wpf.ChartingMVVM.LightningChart.dll (previously SemibindableCharting)
- Arction.Uwp.ChartingMVVM.LightningChart.dll (new)
##### Namespace root changes
- WPF (bindable): Arction.Wpf.SemibindableCharting => Arction.Wpf.ChartingMVVM
#### Property/Event name changes
To make Chart control UWP compatible we renamed or dropped 'Mouse' word from names of Properties, EventArgs, Enum etc. Here is the detailed list of Property/Event name changes:
##### AnnotationBase
- RotateByMouse -> AllowRotate
- AnchorAdjustByMouse -> AllowAnchorAdjust
- AnchorAdjustedByMouse (event) -> AnchorAdjustedByUser
- ResizeByMouse -> AllowResize
- TargetMoveByMouse -> AllowTargetMove
- TargetChangedByMouse -> TargetChangedByUser
- LocationRelativeOffsetChangedByMouse -> LocationRelativeOffsetChangedByUser
##### AnnotationXY or AnnotationRound or Annotation3DBase
- ResizedByMouse -> ResizedByUser
##### Axis3DBase
- MouseScaling -> AllowScaling
- MouseScrolling -> AllowScrolling
- MouseDragSnapToDiv -> DragSnapToDiv
##### AxisPolarBase
- MouseScrolling -> AllowScrolling
- MouseDragSnapToDiv -> DragSnapToDiv
##### AxisRoundBase
- MouseScaling -> AllowScaling
##### AxisX
- MouseScaling -> AllowScaling
##### AxisXYBase
- MouseScaling -> AllowScaling
- MouseScrolling -> AllowScrolling
- MouseDragSnapToDiv -> DragSnapToDiv
##### Map
- MouseHighlight -> Highlight
- MouseInteraction -> AllowUserInteraction
- MouseOverMapItemLayer -> UserInteractiveDeviceOverMapItemLayer
- MouseClickOnMapItemEventArgs -> ButtonClickOnMapItemEventArgs
##### SurfaceSeries3DBase
- TraceMouseCell -> AllowCellTrace
##### Band
- MoveByMouse -> AllowMoveByUser
- MouseResize -> AllowResizeByUser
##### ConstantLine
- MoveByMouse -> AllowMoveByUser
- BandResizedByMouseEventArgs -> BandResizedByUserEventArgs
##### IntensitySeriesBase
- TraceMouseCell -> TraceCell
##### SeriesBaseXY
- MouseInteraction -> AllowUserInteraction
##### View3D
- SeriesTitleMouseMovedEventArgs -> SeriesTitleUserInteractiveDeviceMovedEventArgs
##### MeshModel
- TrackMouseTriangle -> TrackTriangle
##### ZoomPanOptions3D
- LeftMouseButtonAction -> DevicePrimaryButtonAction
- MiddleMouseButtonAction -> DeviceTertiaryButtonButtonAction
- RightMouseButtonAction -> DeviceSecondaryButtonAction
##### ZoomPanOptions3DBase
- LeftDoubleClickAction -> DevicePrimaryButtonDoubleClickAction
- MouseWheelZoomFactor -> WheelZoomFactor
- MouseWheelZoomEnabled -> AllowWheelZoom
##### View3DPie
- SeriesTitleMouseMovedEventArgs -> SeriesTitleDeviceMovedEventArgs
##### PieSlice
- BlinkOnMouseOver -> BlinkOnOver
##### ZoomPanOptionsPie3D
- LeftMouseButtonAction -> DevicePrimaryButtonAction
- MiddleMouseButtonAction -> DeviceTertiaryButtonAction
- RightMouseButtonAction -> DeviceSecondaryButtonAction
##### ZoomPanOptionsPolar
- AxisMouseWheelAction -> AxisWheelAction
- MouseWheelRotateAction -> WheelRotateAction
##### ViewRound
- SeriesTitleMouseMovedEventArgs -> SeriesTitleDeviceMovedEventArgs
##### ZoomPanOptionsRound
- MouseWheelZooming -> WheelZooming
##### ViewXY.LineSeriesCursor
- MouseGrabPadding -> GrabPadding
##### ViewXY.ZoomPanOptions
- MouseWheelZooming -> WheelZooming
- AxisMouseWheelAction -> AxisWheelAction
##### Views
- SeriesTitleMouseActionEventArgs -> SeriesTitleUserActionEventArgs
##### LegendBoxBase
- AllowMouseResize -> AllowResize
##### ZoomPanOptionsBase
- LeftMouseButtonAction -> DevicePrimaryButtonAction
- MiddleMouseButtonAction -> DeviceTertiaryButtonAction
- RightMouseButtonAction -> DeviceSecondaryButtonAction
- MousePanThreshold -> PanThreshold
##### ChartOptions
- AllowInternalMouseCursorChange -> AllowInternalCursorChange
- MouseInteraction -> AllowUserInteraction
##### Enums
- MouseWheelZooming -> WheelZooming
- MouseOverHighlight -> Highlight
- HighlightStateSource.MouseHover -> Hover
- MouseEventType -> UserInteractiveDeviceEventType
- MouseWheelDecrement -> WheelDecrement (ScrollBarScrollType)
- MouseWheelIncrement -> WheelIncrement (ScrollBarScrollType)
- MouseButtonAction -> UserInteractiveDeviceButtonAction
- MouseButtonAction3D -> UserInteractiveDeviceButtonAction3D
- MouseButtonAction3DPie -> UserInteractiveDeviceButtonAction3DPie
- AxisMouseWheelAction -> AxisWheelAction
##### HighlightingItemBase
- MouseHighlight -> Highlight
##### MouseItemBase -> UserInteractiveObject:
- MouseInteraction -> AllowUserInteraction
- IsMouseOver -> IsPositionOver
##### MouseMoveItem -> DraggableObject
- MoveByMouse -> AllowDragging
- MovedByMouse -> DraggedByUser
##### ScrollBarBase
- MouseWheelChange -> WheelChange
##### StockSeries
- GetItemOnMouseLocation -> GetItemOnUserInteractiveDeviceLocation
##### ViewXY or View3D
- IsMouseOverGraphArea -> IsPositionOverGraphArea
##### PointLineSeries3D
- LastMouseHitTestIndex -> LastHitTestIndex
##### Chart
- GetActiveMouseOverObject() -> GetActiveUserInteractiveDeviceOverObject()
### Major behavioral changes
#### Horizontal Bar labels stay visible when zooming out
- Horizontal bar labels now behave similarly to vertical bar labels when the bar width is less than one pixels (e.g. because of zooming out). Previously they were hidden, now they stay visible.
---
## v10.x -> v11.0.1 migration
LightningChart® .NET version 11.0 brings several assembly and namespace related changes, which can cause various backwards compatibility breaks requiring user attention. The purpose of this guide is to help updating to LightningChart version 11.0 from previous versions. The full list of new features, improvements and error fixes can be found in the changelog.
Installing LightningChart® .NET SDK 11 will not automatically remove the previous LightningChart versions such as versions 10.5 and 9.1. The older versions can still be used for example from Visual Studio toolbox. If user wishes to remove the old LightningChart, this can be done by running the installer of the old version.
Installing the version package, NuGet for example, automatically takes care of everything (references etc.). In other words, the existing projects still work assuming there are no backwards compatibility breaks. Due to the assembly and namespace changes, it is strongly recommended to read through the list of changes and make the necessary modifications.
### Assembly changes
We have changed the names of the assembly (.dll) files to reflect the company name change we did a while ago (Arction Ltd. -\> LightningChart Ltd.). Therefore, we have replaced Arction with LightningChart in the assembly names.
LightningChart version 11.0 also introduces .NET6 versions of all the assemblies, excluding UWP and LightningChart Trader. For this, we have changed the names to indicate whether the assembly is for .NET Framework 4.x or for .NET6. The following table shows all the new assembly names.
| **Old assembly name** | **Assemblies for .NET Framework** | **Assemblies for .NET6** |
| --- | --- | --- |
| Arction.Wpf. Charting.LightningChart.dll | LightningChart.WPF. Charting.NET4.dll | LightningChart.WPF. Charting.NET6.dll |
| Arction.Wpf. ChartingMVVM.LightningChart.dll | LightningChart.WPF. ChartingMVVM.NET4.dll | LightningChart.WPF. ChartingMVVM.NET6.dll |
| Arction.WinForms. Charting.LightningChart.dll | LightningChart.WinForms. Charting.NET4.dll | LightningChart.WinForms. Charting.NET6.dll |
| Arction.Uwp. ChartingMVVM.LightningChart.dll | LightningChart.UWP. ChartingMVVM.dll | - |
| UwpAttributes.dll | LightningChart.UWP. Attributes.dll | - |
| Arction.Wpf. TradingCharts.dll | LightningChart.WPF. Trading.NET4.dll | - |
| Arction.WinForms. TradingCharts.dll | LightningChart.WinForms. Trading.NET4.dll | - |
| Arction.Wpf. SignalProcessing.SignalTools.dll | LightningChart.WPF. SignalTools.NET4.dll | LightningChart.WPF. SignalTools.NET6.dll |
| Arction.WinForms. SignalProcessing.SignalTools.dll | LightningChart.WinForms. SignalTools.NET4.dll | LightningChart.WinForms. SignalTools.NET6.dll|
| Arction.Uwp. SignalProcessing.SignalTools.dll | LightningChart.UWP. SignalTools.dll | - |
| Arction.MathCore.dll | LightningChart.MathCore.dll | LightningChart.MathCore.dll |
| Arction.DirectX.dll | LightningChart.DirectX.dll | LightningChart.DirectX.dll |
| Arction.DirectXFiles.dll | LightningChart. DirectXFilesNET.dll | LightningChart. DirectXFilesNET.dll |
| Arction.DirectXInit.dll | LightningChart. DirectXInitNET.dll | LightningChart. DirectXInitNET.dll |
We have also changed the assemblies needed to be added into a project. From LightningChart version 11.0 onwards, the following assemblies should be found in the project.
**WinForms:**
- LightningChart.WinForms.Charting.NET4.dll **(in .NET Framework projects)**
- LightningChart.WinForms.Charting.NET6.dll **(in .NET6+ projects)**
- LightningChart.DirectX.dll
- LightningChart.DirectXInitNET.dll
- LightningChart.DirectXFilesNET.dll
If using SignalTools
- LightningChart.WinForms.SignalTools.NET4.dll **(in .NET Framework projects)**
- LightningChart.WinForms.SignalTools.NET6.dll **(in .NET6+ projects)**
- LightningChart.MathCore.dll
**WPF:**
- LightningChart.WPF.Charting.NET4.dll **(for Non-bindable WPF chart, .NET Framework)**
- LightningChart.WPF.Charting.NET6.dll **(for Non-bindable WPF chart, .NET6+)**
- LightningChart.WPF.ChartingMVVM.NET4.dll **(for Bindable WPF chart, .NET Framework)**
- LightningChart.WPF.ChartingMVVM.NET6.dll **(for Bindable WPF chart, .NET6+)**
- LightningChart.DirectX.dll
- LightningChart.DirectXInitNET.dll
- LightningChart.DirectXFilesNET.dll
If using SignalTools
- LightningChart.WPF.SignalTools.NET4.dll **(in .NET Framework projects)**
- LightningChart.WPF.SignalTools.NET6.dll **(in .NET6+ projects)**
- LightningChart.MathCore.dll
**UWP:**
- LightningChart.UWP.ChartingMVVM.dll
- LightningChart.UWP.Attributes.dll
- SharpDX.D3DCompiler.dll
- SharpDX.Direct2D1.dll
- SharpDX.Direct3D11.dll
- SharpDX.dll
- SharpDX.DXGI.dll
- SharpDX.Mathematics.dll
If using SignalTools
- LightningChart.UWP.SignalTools.dll
### Namespace changes
LightningChart version 11.0 also brings changes to namespaces used in code. When updating from a previous LightningChart version, it is required to change the project to use the new namespaces. For example:
Old way: _using Arction.Wpf.Charting;_
New way: _using LightningChartLib.WPF.Charting;_
Refer to the following table to find out the new namespace roots.
| **Old namespace root** | **New namespace root** | **XML namespace** |
| --- | --- | --- |
| Arction.Wpf.Charting | LightningChartLib.WPF.Charting | xmlns:lcunb= "http://schemas.lightningchart.com/charting/"|
| Arction.Wpf.ChartingMVVM | LightningChartLib.WPF.ChartingMVVM | xmlns:lcusb= "http://schemas.lightningchart.com/chartingMVVM/|
| Arction.WinForms. Charting | LightningChartLib.WinForms.Charting | - |
| Arction.Uwp.ChartingMVVM | LightningChartLib.UWP.ChartingMVVM | xmlns:lcu= "using:LightningChartLib.UWP.chartingMVVM" |
### .NET Framework change
The target framework version for LightningChart's library update to .NET Framework 4.8. Any user's .NET Framework project, which uses LightningChart's library should set target framework at least .NET Framework 4.8. Any newer version (like .NET Framework 4.8.1 or .NET 7.0) is fine as well. .NET 6.0 LightningChart control/project requires Visual Studio 2022 or above.
### Improved DPI awareness handling in charting application
In previous version (like 10.5.1) when enable dpiAware (in application manifest) this leads to text's font shrinkage in the chart. Now Fonts remain same size as defined and chart image is sharp & clear.
In addition, when dpiAware=True, LightningChart WinForms edition start to recognize difference between pixel (PX) and DPI units. That is, PX not equal DPI, if Windows-scale factor > 100%. Due to this change user should be more careful when using methods for axis-value to/from coordinate conversion. Methods like Axis.ValueToCoord() or Axis.ValueToCoord() could have input/output either as PX or DPI coordinates (depending on which flag is used). Therefore, user should carefully check, which units is required in the calculation of his/her.
In addition, per monitor DPI awareness is handled better (for WPF and WinForms) by LightningChart (in regards of text rendering), especially in .NET 6.0 targeting build of library. (see more about [DPI handling](/docs/inDetail/dpi-handling.md))
### Demo application improvements
We continue improving Interactive Examples application, the essential tool to browse different features of LightningChart and extract example code projects. Examples could be now extracted not only as .NET Framework project (as before), but also as .NET 6.0 projects. Example could be extracted to 7 project types: .NET Framework 4.8 or .NET 6.0 for WinForms, WPF and MVVM (bindable), and UWP. Though not every example is converted yet to all 7 types. In addition, we polished examples, cleared their code, fixed some errors.
### Improved ZoomBar chart, custom control
Made ZoomBar chart look more modern - selected area/band is transparent, while areas not visible in Main-chart are dimmed. Previous vertical band covered whole zoomed XAxis range and it was possible to drag it with mouse-cursor. Now it is possible to drag only rectangular box, which indicates X- & Y-axis range in main-chart. There are multiple zoom-boxes, if main-chart has multiple vertical segments.
---
## v11.0 -> v12.0.1 migration
Although it may be insignificant, but LightningChart® .NET version 12.0 brings some API changes, which can cause various backwards compatibility breaks and requires user's attention. The purpose of this guide is to help updating to LightningChart version 12.0 from previous versions. The full list of new features, improvements and error fixes can be found in the changelog.
#### DataCursor properties reorganized
Some of DataCursor properties at ViewPolar & ViewSmith has been renamed:
- renamed "Configure" -> "Configuration";
- word '*Dynamic*' replaced with '*UseSeries*'. E.g. ***AngleLabelDynamicColor*** -> ***AngleLabelUseSeriesColor***;
- for clarify renamed: '...*BorderColor*' properties to '...*LabelBorderColor*'. E.g. ***AngleBorderColor*** -> ***AngleLabelBorderColor***;
- From DataCursor base class (all Views) properties removed (replaced with more specific properties in ***DataCursor.Configuration***):
***LabelUseSeriesColor*** and ***LabelFillColor***.
#### LightningChart .NET now supports XAML serialization
Changes may effect how user can interact with all List properties in WinForm or non-bindable WPF edition of LightningChart. There are around 60 such properties in library (e.g. ***XAxes***, ***SampleDataBlockSeries***, ***SeriesEventMarkers***, ***CustomTicks*** etc.). In most cases (e.g. adding to or removing from the list) user don't need to change anything in the application's code. However, if user wants to address such property as (a whole) collection, then instead of creating type ```List```, one should create ```TypeNameList``` class object.
For example,
```csharp
// instead of
List ticks = new List();
// should be
CustomAxisTickList ticks = new CustomAxisTickList();
```
In addition, namespace change for ThemeBasics:
LightningChart.ThemeBasics -> ThemeBasics
#### ViewPolar
Due to IntensityGridSeriesPolar series addition, changes class inheritance in some Polar series. AreaSeriesPolar and PointLineSeries polar do not include AllowDragging property anymore. Also, it had no implementation before, so it had no use anyway.
---
## Roadmap
As of autumn 2026, following features/improvements are planned for LightningChart .NET library:
- Allow bar series 3D to be freely positioned in XZ plane.
- Alternate 3D coordinate systems (XYZ vs ZXY or right-handed vs left-handed).
- Positioning Axis 3D more freely (currently only on the edges of the 3D space).
- Create option for 3D-world, where either YAxis is upwards (as now) or ZAxis is upwards.
- Add option for completely hiding YAxis segments.
- Built-in Toolbar for data review/exploration (with buttons like Zoom, Pan, Cursor, Range of Interest etc.).
- Add option for user to control z-order of series rendering in ViewXY (between distinct types).
:::warning[NOTE !]
This is a rough roadmap for the next year or two. This is neither a complete list nor ordered by scheduled date. Priorities may change upon new requests from user or when users make library customization orders.
:::
For a brief list of features introduced in previous releases of LightningChart .NET check [Milestones page](/docs/migration%20guides/milestones.md).
---
## Annotation Table
[Annotation](https://lightningchart.com/net-charts/docs/beginners%20guide/other-objects-in-view/#Annotations) is very versatile object of LightningChart. ***Annotations*** can be used for many purpose and interaction, but this tutorial demonstrates how to create multi color table with them.

*ExampleAnnotationTable [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to implement a tables with LightningChart .NET library check following link: [Tables in WPF](https://lightningchart.com/blog/tables-in-wpf/).
:::
---
## AreaSeries (Tutorials)
[AreaSeries](/docs/beginners%20guide/ViewXY-series/xy_chart.md#AreaSeries) is special case of more general [HighLowSeries](/docs/beginners%20guide/ViewXY-series/xy_chart.md#HighLowSeries).
***AreaSeries*** is used when user want to create a mountain chart or area chart. The base level, fill under the curve and line style are modified by ***BaseValue***, ***Fill*** and ***LineStyle*** properties respectively.
Following example demonstrates basic area chart

*ExampleAreaXY [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to create dynamic SurfaceMeshSeries3D application with LightningChart .NET library check [following link](https://lightningchart.com/blog/wpf/area-chart/).
:::
---
## Audio Input Spectrogram chart
Have you ever wondered how to capture and visualize audio signal from sound devices? LightningChart offers quick and easy solution for this task.
LightningChart's **AudioInput** component is used to input waveform data from a sound device, such as mic-in or line-in. **SpectrumCalculator** component is used to calculate time frequency spectrum. The real-time waveform data is plotted in waveform graphs, while spectrum as '[heatmap](/docs/beginners%20guide/ViewXY-series/xy_chart.md#IntensityGridSeries-also-called-Heatmap)'.

*Audio signal capturing application [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For Step-by-step tutorial how to create your own Audio Input Spectrogram application with LightningChart .NET library check [following link](https://lightningchart.com/blog/audio-input-spectrogram-chart/).
:::
---
## Audio Output Signal Reader
Have you ever wondered how to visualize audio signal and hear it at the same time. LightningChart offers quick and easy solution for this task.
LightningChart's **SignalReader** component is used to read data from a file, to generate a playback. The data is forwarded to **AudioOutput** component for audible sound through speakers. The chart displays the waveform with a indicator of current playback position.

*Audio signal reader and playback application.*
:::info
For Step-by-step tutorial how to create your own Audio Output Signal Reader application with LightningChart .NET library check [following link](https://lightningchart.com/blog/audio-output-signal-reader/).
:::
---
## Box and Whisker chart
The box plot, also known as a whisker diagram, is a type of graph used to analyze detailed data. It features a rectangular shape that represents data grouped into segments, with lines extending from the box ends, often called whiskers. This type of graph is commonly used in fields like medicine, science, and education.
To create this type of plot, one should use [PolygonSeries](https://lightningchart.com/net-charts/docs/beginners%20guide/ViewXY-series/xy_chart/#PolygonSeries) and [LineCollection](https://lightningchart.com/net-charts/docs/beginners%20guide/ViewXY-series/xy_chart/#LineCollection).

*ExampleBoxWhiskerPlot [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to implement a WPF Box Plot Chart with LightningChart .NET library check following links: [WPF Box Plot Chart](https://lightningchart.com/blog/wpf-box-plot-chart/).
:::
---
## A Bubble Chart - how to create application
A bubble chart (or bubble plot) is an extension of the scatter plot. This type of chart displays three or four dimensions of data. Each dot in a bubble chart corresponds with a single data point, and the variables' values for each point are indicated by horizontal position (x-axis), vertical position (y-axis), bubble size and bubble color (optional). Size and color of bubble can encode any categorical or quantitative variable / factor.
In following example random data is generated to demonstrate concept of Bubble Chart. X-axis is titled as 'Age', y-axis is titled as 'Body Length', size of Bubble encodes 'Weight' and color of bubble encode 'Group' identity.

*ExampleBubbles [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For Step-by-step tutorial how to create bubble chart application with LightningChart .NET library check [following link](https://lightningchart.com/blog/wpf-bubble-chart/).
:::
---
## Creating a Campbell Diagram Chart
A Campbell diagram (named after Wilfred Campbell) is a type of graph used in modeling turbulence and rotational dynamics. This diagram shows how the rate at which turbulence kinetic energy is dissipated and the scale of turbulence within a flow are related.
It is especially useful for studying boundary layers or turbulent shear flows, helping to understand the turbulent characteristics of such a flow. This graph also represents the response spectrum of a system as a function of its oscillation regime. These diagrams are commonly used to understand the dynamic behavior of rotating machines.
This tutorial follow modify *ExampleCampbellDiagramXY* [from Demo](/docs/getting%20started/RunningDemo.md). There [ChartEventMarkers](https://lightningchart.com/net-charts/docs/beginners%20guide/other-objects-in-view/#EventMarkers) are used to create different size bubbles.

*Campbell Diagram*
:::info
Check following link for step-by-step tutorial how to create a Campbell Diagram in C# with LightningChart .NET: [Creating a Campbell Diagram Chart](https://lightningchart.com/blog/campbell-diagram-in-c-sharp/).
:::
---
## Digital Signal Processing Filters Application
Digital signal filters are programmatic filters made to filter out unwanted frequencies from the acquired signal data.
Finite Impulse Response (FIR) filters are amplitude-stable, constant-phase-shift filters, and cause a constant lag in the data. The higher the factor count (taps), the longer the delay.
Infinite Impulse Response (IIR) filters are minimal-lag filters, but introduce phase shift depending on the input frequency, and are unstable if designed poorly.
In following example, different signals feed from SignalGenerator control in real-time. Several waveforms are demonstrated, where signals with various amplitudes and frequencies are mixed. The waveform data is filtered with SignalTools' FIRFilter and IIRFilter, and shown as filtered waveform and its spectrum.

*ExampleSignalFilters [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to create real-time application with signal generator and digital filters (IIR & FIR) with LightningChart .NET library check [following link](https://lightningchart.com/blog/digital-signal-processing-filters-app/).
:::
---
## EEG Visualization showcase
Electroencephalography (EEG) is a method to record an electrogram of the spontaneous electrical activity of the brain. First human EEG was recorded 100 years ago (in 1924) by german physiologist and psychiatrist Hans Berger. Method remains popular and relevant despite little change during the year. An EEG can find changes in brain activity that might be useful in diagnosing numerous brain disorders.
Modern EEG recording consist of high-density electrodes (250 or more) and high sampling rate (1000 or more samples per second). Typically those signals analyzed and even more data is created. Showing all the data in realtime could be challenging, but LightningChart will help you to resolve those issues.
This tutorial discuss showcase example of EEG monitoring application. There you will find realtime EEG data scrolling, with power spectral density estimate. In addition, the distribution of spectral density in real time on brain surface is shown.

*ExampleEEGDataVisualizationShowcase [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For Step-by-step tutorial how to create EEG Visualization application with LightningChart .NET library check [following link](https://lightningchart.com/blog/eeg-chart/).
:::
---
## Fast Line Chart
A ‘fast line chart’ is an ambiguous term that could mean a great number of things. If a software developer is programming with C#, the first thing that comes to mind is the .NET Chart class with FastLine type series.
However, it is more likely that under the term ‘fast line chart’ a user would like to stress the word ‘fast’. As we will see in following article, the name does not imply that Microsoft .NET Chart FastLine will provide the best performance – at least not nowadays. Currently, there are faster line charts and we will discuss the fastest of all: LightningChart .NET control.

*FastLine type series in .NET Chart control*

*LightningChart with millions of points in data streaming application.*
:::info
For step-by-step tutorial how to create fastest line chart with LightningChart .NET library check [following link](https://lightningchart.com/blog/fast-line-charts/).
:::
---
## SurfaceMeshSeries3D warped to a globe
[SurfaceMeshSeries3D](https://lightningchart.com/net-charts/docs/beginners%20guide/View3D-series/3d_chart/#SurfaceMeshSeries3D) is similar to [SurfaceGridSeries3D](https://lightningchart.com/net-charts/docs/beginners%20guide/View3D-series/3d_chart/#SurfaceGridSeries3D), but with one important difference. ***SurfaceMeshSeries3D's*** nodes can be positioned freely in 3D space (surface does not have to be rectangular). ***SurfaceMeshSeries3D*** allows warping the surface virtually to any shape, and following example shows how to render 3D Earth Globe.
In particular, three steps should be noted. First, 2D image of Earth is set Fill for ***SurfaceMeshSeries3D***. Second, surface nodes coordinates set in a way to form a sphere. Third, pseudo elevation data is added on top of sphere to represent mountain height.

*ExampleGlobeSurface3D [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to create a WPF 3D Sphere model of the Earth using LightningChart .NET library check following links: [WPF 3D Sphere](https://lightningchart.com/blog/wpf-3d-sphere/).
:::
---
## A heatmap chart - how to create advance analysis
A heat map (or heatmap) is a 2-dimensional data visualization technique, where amplitude/magnitude of value is color coded. Color coding is defined by palette of colors, which typically uses range from 'cold' (aka blue) to 'hot' (aka red) colors.
There are two main type of heat maps: spatial, and grid.
A grid heatmap is 2-dimensional table, where rows and columns is formed from 2 categorical variables (also called qualitative variable). The values in the cross-table is the one to be converted to color for easy reading table at once.
A spatial heatmap is also could be represented as 2-dimensional table, but rows and columns is formed from 2 quantitative variables. Often it was applied for geographical maps (hence the name 'spatial maps'). Typical example is temperature measurement at each points of geographical map.
Nowadays heatmap have a wide range of usage in all kind of industries/areas: business, science, financial, sport etc. For example, temporal measurement of signal spectrum could represented as Time vs Frequency heatmap. One can find demonstration of such usage in another tutorial, [Audio Input Spectrogram chart](audio-input-spectrogram.md).
Following tutorial is closer to 'classical' spatial heatmap, where geographical image is used. However, basic idea could be applied in many different areas - if result of measurement is image and it should be converted to heatmap.

*ExampleHeatMapXY [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For Step-by-step tutorial how to create your own Heatmap application with LightningChart .NET library check [following link](https://lightningchart.com/blog/wpf-2d-heatmap/).
:::
---
## High Speed DAQ Chart
Data acquisition (DAQ) is the measurement, recording, analyzing, and presentation of physical world events. DAQ devices through various sensors and transducers (e.g. temperature, pressure, flow, level, strain, acceleration, vibration, humidity, and more) could measure voltage, current, power etc.
Nowadays DAQ devices are used in a wide range of settings from hospital bad (e.g. EEG) to material testings (e.g. vibration analysis). Such devices are capable of recording 100s of channels and sampling rate reaching MHz. Such amount of data obviously could create data visualization challenges. LightningChart can help to resolve those challenges as it is especially good visualizing massive amount of data in real-time.
Following example demonstrates how to simulate (generation of) a massive amount of data (LightningChart's SignalGenerator allows generation of various signal shapes), how to setup chart and how achieve best real-time performance.

*ExampleHiSpeedXY [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For Step-by-step tutorial how to create Data Acquisition System Application with LightningChart .NET library check [following link](https://lightningchart.com/blog/data-acquisition-system-application/).
:::
---
## Creating an Industrial Monitoring System
An industrial monitoring system is software designed to review and control operations within an industrial environment. These types of systems use sensors, controllers and other support systems to obtain parameters that help monitor and prevent equipment failures from a remote-control panel.
Industrial monitoring systems have constant communication with temperature, pressure, humidity, vibration sensors, etc. These systems can have various functions in relation to data processing, for example, data analysis, alerts and notifications, integration with systems that offer other analysis tools, and the generation of reports that help in decision making.
This tutorial is using ViewXY [PointLineSeries](https://lightningchart.com/net-charts/docs/beginners%20guide/ViewXY-series/xy_chart/#PointLineSeries) and [DataCursor](/docs/inDetail/data-cursors.md).

*Industrial Monitoring System*
:::info
Check following link for step-by-step tutorial how to create an industrial monitoring system in C# using LightningChart charting components: [Creating an Industrial Monitoring System](https://lightningchart.com/blog/wpf/industrial-monitoring-system/).
:::
---
## 3D LiDAR Chart
Once in a while user may need to visualize tens of millions samples as point-cloud. For example, LiDAR (or Light Detection and Ranging) device could generate such type of data. Certainly it is challenging, but LightningChart control is able to create interactive chart with 100 million points (and more, if user have powerful computer).
The core feature of *'LiDAR Chart'* is ***PointsCompactColored*** property (SeriesPointCompactColored3D array) of [PointLineSeries3D](/docs/beginners%20guide/View3D-series/3D_chart.md#PointLineSeries3D). ***PointsCompactColored*** property enables low memory consumption, important when having a lot of data points, but still allows coloring the points with individual colors.
***SeriesPointCompactColoured3D*** structure consists of the following fields:
- **float X**: X axis value
- **float Y**: Y axis value
- **float Z**: Z axis value
- **int Color**: Color of the point

*The topographic data from London. All together renders 55 million data points*
:::info
For Step-by-step tutorial how to create 3D LiDAR Chart with LightningChart .NET library check [following link](https://lightningchart.com/blog/lidar-chart/).
:::
---
## Dynamic heatmap and geographic map
[IntensityGridSeries](/docs/inDetail/IntensityGridSeries.md) allows visualizing data as 2D grid (heatmap). In ***IntensityGridSeries***, nodes are equally spaced in X dimension and in Y dimension. In addition to X and Y each **IntensityPoint** has *Value*, *Color* and *Tag* (object type) fields. This allows ***IntensityGridSeries*** to visualize 3-dimensional data (X-Y + measurement). ***IntensityGridSeries*** also has different styles for ***Fill***, ***Wireframe*** and ***ContourLine***.
As any other ViewXY series, ***IntensityGridSeries*** can be used with [geographic maps](/docs/inDetail/geographic-maps.md).
How ***IntensityGridSeries*** and ***Maps*** could be used to visualize dynamic geographical data (e.g. rain cloud change over time) demonstrated in following example

*ExampleMapStencil [from Demo](/docs/getting%20started/RunningDemo.md)*

*ExampleMapEnvironmentalData [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to create dynamic IntensityGridSeries with Vector-map application with LightningChart .NET library check following links: [Weather Data Visualizations](https://lightningchart.com/blog/weather-data-visualization/), [Environmental Maps](https://lightningchart.com/blog/environmental-map/) and [2D Maps](https://lightningchart.com/blog/wpf-2d-maps/).
:::
---
## MeshModel custom coloring in real-time
[MeshModel](/docs/beginners%20guide/View3D-series/3D_chart.md#MeshModels) is digital 3D model of object in LightningChart. MeshModel composed of triangle mesh.
By default, the model renders with the colors of the OBJ model, or color set for particular vertex during construction on MeshModel programmatically. However, it is possible to apply custom coloring for model’s faces or edges (wireframe). Not only that color of MeshModel could be changes, but it could be done in real-time. Therefore, it is suitable for simulated or machine testing environment, where 3D model is combined with real-time observations / measurements.
In following example, hypothetical temperature is measured at certain points of the plane and temperature-value reading is converted to color of pixel/3D-model.

*ExampleMeshModelRealtimeColoring [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to create MeshModel custom coloring in real-time with LightningChart .NET library check [following link](https://lightningchart.com/blog/3d-mesh-model-real-time-coloring/).
:::
---
## Marine Engine Dashboard Implementation
The main objective of this dashboard is to generate a template to experiment with different types of charts relevant to the naval industry. In this example, we create the marine engine condition monitoring application. We will use line, radial, bar, pie and area charts.
This tutorial is using [PointLineSeries](https://lightningchart.com/net-charts/docs/beginners%20guide/ViewXY-series/xy_chart/#PointLineSeries), [AreaSeries](https://lightningchart.com/net-charts/docs/beginners%20guide/ViewXY-series/xy_chart/#AreaSeries), [BarSeries](https://lightningchart.com/net-charts/docs/beginners%20guide/ViewXY-series/xy_chart/#BarSeries), [ViewPie3D](/docs/beginners%20guide/ViewPie3D-series/pie3D_chart.md), [ViewPolar](/docs/beginners%20guide/ViewPolar-series/polar_chart.md) as gauge.

*Marine Engine Dashboard*
:::info
Check following link for step-by-step tutorial how to create a Marine engine condition monitoring application project using WPF chart controls: [Marine Engine Dashboard Implementation](https://lightningchart.com/blog/wpf/marine-engine-condition-monitoring/).
:::
---
## Oscilloscope Chart
In main article, we will create an oscilloscope using LightningChart .NET. This project will have several user controls that allow modifying the values and the behavior of the waves within the application. We will use the WPF framework to create the user interface, add controls, and display the chart.

*ExampleOscilloscopeXY [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
Check following link for step-by-step tutorial how to create an oscilloscope chart application in WPF using LightningChart .NET library: [A Guide to Creating a Oscilloscope Chart](https://lightningchart.com/blog/wpf/oscilloscope-chart/).
:::
---
## Persistent series rendering intensity layers
[PersistentSeriesRenderingIntensityLayer](/docs/beginners%20guide/ViewXY-series/xy_chart.md#Persistent-series-rendering-intensity-layers) could facilitate analysis of the repetitive signal. ***PersistentSeriesRenderingIntensityLayer*** can help to visualize common features of the signal measured multiple time as well as outliers.
In following example the hotness (increased hit count) is identified for certain signal points.

*ExamplePersistentIntensitySignal [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to create dynamic application with Persistent series rendering intensity layers of LightningChart .NET library check [following link](https://lightningchart.com/blog/signal-persistent-intensity-chart/).
:::
---
## Polar Radar Charts
Polar radar charts are used for visualizing direction and distance data in aeronautics and navigation. In navigation, polar charts may reflect information about a ship’s or aircraft's position, course, and speed.
The goal of following example is to build Polar chart presenting a scanning radar (which is updated in real-time).

*ExamplePolarRadar [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to create advanced polar chart application with LightningChart .NET library check [following link](https://lightningchart.com/blog/wpf-polar-radar-chart/).
:::
---
## Polygon 3D and geographic map's data
[Polygon3D](https://lightningchart.com/net-charts/docs/beginners%20guide/View3D-series/3d_chart/#Polygon3D) objects allow presenting a 2D polygon stretched to given Y range. There are many ways how such object can be used, but in this example data from [geographic maps](/docs/inDetail/geographic-maps.md) is converted to ***Polygon3D***.
In particular, country's border information is converted ***Polygon3D's*** depth and with coordinates, while country's population size is converted to height of ***Polygon3D***.
How ***Polygon3D*** and ***Maps*** can be used to visualize geographical data demonstrated in following example

*ExamplePopulationPolygons3D [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
Check following link for step-by-step tutorial how to create static Polygon3D (with Vector-map) application with LightningChart .NET library: [World Population 3D Maps](https://lightningchart.com/blog/wpf-world-population-3d-map/).
:::
---
## Visualizing Population Growth Data
Please check the main article, if you interested in discussion about population and the factors that influence its growth. The programming exercise for that article is to modify *ExampleBarsNegativeValues* [from Demo](/docs/getting%20started/RunningDemo.md) to use different type of data, growth-rate.
This tutorial is using 3D [BarSeries](https://lightningchart.com/net-charts/docs/beginners%20guide/ViewXY-series/xy_chart/#BarSeries).

*Visualizing Population Growth*
:::info
Check following link for step-by-step tutorial for building a WPF charting application for visualizing population growth data with LightningChart .NET: [Visualizing Population Growth Data](https://lightningchart.com/blog/visualizing-population-growth-data-in-wpf/).
:::
---
## Creating Reservoir Visualizations for Oil and Gas Apps
Reservoir visualizations help geologists and geophysicists understand the subsurface structure, including the location and extent of rock formations that contain oil or gas. In relation to reservoir modeling, three-dimensional (3D) models are created to simulate how a reservoir behaves under different production conditions.
Reservoir visualizations in the oil and gas industry use data from various sources, such as: geological data, geophysical data, drilling and well data, fluid data, production data, simulation data.
This tutorial is focusing primarily on 3D Chart [View3D](/docs/beginners%20guide/View3D-series/3D_chart.md). It is based on [Demo](/docs/getting%20started/RunningDemo.md) examples *ExampleValueBased3DContouring*, *ExampleSpectrum3D*, *ExampleLidar* and *ExampleCrossSectionSurface3D*.

*Reservoir Visualizations*
:::info
Check following link for step-by-step tutorial how to create a Reservoir Visualizations using LightningChart .NET library: [Creating Reservoir Visualizations for Oil and Gas Apps](https://lightningchart.com/blog/reservoir-visualizations-in-c-sharp/).
:::
---
## Scatter Chart
Scatter charts are a great way to explore the relationship between two different variables or data series. Similar to line or bar charts, they are displayed on a two-dimensional plane using X and Y axes. The key difference is that each axis in a scatter chart has its own independent variable. Each data point on the chart represents a pair of values, showing where these two variables intersect on the Cartesian plane. To make sure everything is accurately placed, it’s important to create a uniform scale for both axes. Scatter charts are versatile and can be the basis for other types of charts, like the popular bubble chart.
As for typical scatter plot, x-values are not in progressive order, and point-shape is required, one should use [FreeformPointLineSeries](https://lightningchart.com/net-charts/docs/beginners%20guide/ViewXY-series/xy_chart/#FreeformPointLineSeries).

*ExampleScatterLotsOfDots [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to implement a WPF Scatter Chart with LightningChart .NET library check following links: [WPF Scatter Chart](https://lightningchart.com/blog/wpf-scatter-chart/).
:::
---
## A Smith Chart - How to Create Application
The Smith chart is a diagram designed for the study and resolution of problems with transmission lines. This diagram is aimed at electrical and electronic engineers specializing in radio frequency. These types of diagrams are common in most radio frequency circuit analysis software.
:::info
For more information about Smith chart please check [our blog](https://lightningchart.com/blog/smith-chart/).
:::

:::info
To see how interactive example of a Smith chart application is created see [step-by-step guide](https://lightningchart.com/blog/creating-smith-chart-application/).
:::
---
## Solar Energy Dashboard
In this tutorial we will create a solar energy monitoring dashboard using 3D charts. We will use the X-Y-Z chart with the series of points and lines, but we will use different configurations to be able to create a scatter chart and a Line chart. Finally, we will add a 3D world map to represent the population of each country by year, with polygons of different heights and colors, with green being the lowest value, and red being the highest.
To feed our energy monitoring system dashboard, we will work with a dataset with estimated information from the year 1900 to the year 2022, grouped by countries of the world. This information corresponds to primary energy consumption, per capita, and population.
This tutorial is using [PointLineSeries3D](https://lightningchart.com/net-charts/docs/beginners%20guide/View3D-series/3d_chart/#PointLineSeries3D), [Polygon3D](https://lightningchart.com/net-charts/docs/beginners%20guide/View3D-series/3d_chart/#Polygon3D), data from [geographic maps](/docs/inDetail/geographic-maps.md), [Annotation](https://lightningchart.com/net-charts/docs/beginners%20guide/other-objects-in-view/#Annotations) as tooltip.

*Solar Energy Dashboard*
:::info
Check following link for step-by-step tutorial how to create a solar energy monitoring system dashboard in C# with LightningChart .NET charting components: [MSolar Energy Monitoring System Dashboard](https://lightningchart.com/blog/wpf/energy-monitoring-system-dashboard/).
:::
---
## A Strip Chart - How to Create Application
Before computers exist or were taking their first steps, a **Strip chart** was a way to visualize an analog electrical signal.
Voltage was moved by a needle or pen, and the trace was plotted on scrolling graph paper. The device was called a **Strip chart recorder**.
The typical applications were for example:
- Seismography, earthquakes, and movement of tectonic plates activity monitoring
- Polygraphy tests, physiological measurements such as lie detector
- Electroencephalography (EEG), brain electric activity monitoring
- Any electrical signal change plotting, typically over time

***An analog Electroardiogram (ECG) strip chart.***
Nowadays, electrical signals are converted into digital format by using a data acquisition device, including an analog-to-digital (A/D) converter, which can be processed and stored by computers or portable data devices.
Strip chart applications are not typically plotted on paper anymore but are shown as [waveform charts](https://lightningchart.com/net-charts/gallery/#set4-1).

:::info
You can find how to build such application (with LightningChart) and more information about **Strip chart** in following [blog](https://lightningchart.com/blog/strip-chart-application/).
:::
---
## Surface grid 3D
[SurfaceGridSeries3D](/docs/beginners%20guide/View3D-series/3D_chart.md#SurfaceGridSeries3D) allows visualizing data as a 3D surface. In ***SurfaceGridSeries3D***, nodes are equally spaced in X dimension, and in Z dimension as well. In addition to X, Y and Z, each **SurfacePoint** has *Value*, *Color* and *Tag* (object type) fields. This allows ***SurfaceMeshSeries3D*** to visualize 4-dimensional data (space + measurement). ***SurfaceMeshSeries3D*** also has different styles for ***Fill***, ***Wireframe*** and ***ContourLine***.
How ***SurfaceMeshSeries3D*** could be used as 3D Surface as well as projective plain (with *ContourLineType3D.PalettedLineByValue* or *SurfaceFillStyle.PalettedByValue*) demonstrated in following example

*ExampleSurfaceFlatContourProjection [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial, how to create application with various SurfaceGridSeries3D layouts with LightningChart .NET library, check [following link](https://lightningchart.com/blog/xyz-axis-graph/).
:::
---
## Surface mesh 3D
[SurfaceMeshSeries3D](/docs/beginners%20guide/View3D-series/3D_chart.md#SurfaceMeshSeries3D) is divers series to visualize 3D surface. X,Y and Z values can be defined for each mesh point, allowing uneven node spacing. In addition to X, Y and Z, each **SurfacePoint** has *Value*, *Color* and *Tag* (object type) fields. This allows ***SurfaceMeshSeries3D*** to visualize 4-dimensional data (space + measurement). ***SurfaceMeshSeries3D*** also has different styles for ***Fill***, ***Wireframe*** and ***ContourLine***.
All those styling capabilities and surface geometry change in real-time demonstrated in following example

*ExampleSurfaceMesh3D [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to create dynamic SurfaceMeshSeries3D application with LightningChart .NET library check [following link](https://lightningchart.com/blog/3d-surface-plot/).
:::
---
## Temperature Monitoring Application
Real-time temperature monitoring applications are an essential tool for engineers and developers in industrial sectors. Temperature monitoring applications use temperature sensors, thermal sensors, and telemetry to record and transmit real-time data from different machinery for processing.
***LiteLineSeries*** will be used in this tutorial. [LiteLineSeries](https://lightningchart.com/net-charts/docs/beginners%20guide/ViewXY-series/xy_chart/#LiteLineSeries) is optimized for much faster performance (relatively ***PointLineSeries***) when x-values in progressive order but at fixed interval.

*ExampleTemperatureGraph [from Demo](/docs/getting%20started/RunningDemo.md)*
:::info
For step-by-step tutorial how to create a real-time temperature monitoring application with LightningChart .NET library check following links: [WPF Temperature Monitoring Application](https://lightningchart.com/blog/temperature-monitoring-application/).
:::
---
## Creating a 3D Terrain Modelling Application
Main article describe the usage of LightningChart .NET and C# to create a 3D terrain modeling application. This application will be capable of reading any JPG or PNG image and generating data points for each pixel, positioning them on a 3D plane.
Each point will have a unique value on the Y-axis, introducing verticality and relief to otherwise flat images. The height of each point will be determined by the intensity of the pixel’s color, with darker colors assigned lower Y-axis values.
This tutorial is using 3D [PointLineSeries3D](https://lightningchart.com/net-charts/docs/beginners%20guide/View3D-series/3d_chart/#PointLineSeries3D).

*3D Terrain Modelling*
:::info
Check following link for step-by-step tutorial how to create a 3D terrain modelling data application project using WPF chart controls: [Creating a 3D Terrain Modelling Application](https://lightningchart.com/blog/wpf/3d-terrain-modelling-application/).
:::
---
## Volumetric Rendering Application with LightningChart .NET
LightningChart .NET volumetric rendering feature described [elsewhere](https://lightningchart.com/blog/volume-rendering/).
Following tutorial will help to understand theory behind **Volumetric Rendering** and how in practice create application to visualize volumetric data: https://lightningchart.com/blog/volumetric-data-visualization/

*An example of volumetric data*

*Example of medical application of Maximal Intensity ray function. The dataset is provided by Department of Radiology at The University of Iowa.*
---
## Water Level Measurement Data Application
Various properties of water can be measured, which creates diverse type of data. In turn, those require different type of charts. The base programming of each project was generated with the help of the interactive examples tool of LC .NET.
This tutorial is based on [Demo](/docs/getting%20started/RunningDemo.md) examples *ExampleSpeedometerPolar*, *ExampleHeatMapContoursWithLabels*, *ExampleBars3D* and *ExampleZoomBar*.

*Water Measurement*
:::info
Check following link for step-by-step tutorial how to create a water level measurement data visualization application using LightningChart .NET library: [Water Level Measurement Data Application](https://lightningchart.com/blog/wpf/water-level-measurement-application/).
:::
---
## Creating a waveform plot
A waveform chart is a type of graph that visually represents an audio signal or wave. It is used to show the variation over time of a continuous signal, usually an audio waveform (such as a sound recording). This type of graph shows how the amplitude of the signal changes over time, allowing you to visually see fluctuations in the intensity of the wave.
Waveform charts are widely used in audio editing, music production, and signal analysis software, as they provide a clear way to visualize the structure and changes in audio signals. They are also used in other contexts, such as visualizing data from other types of continuous signals.
This tutorial is using 3D [SampleDataSeries](https://lightningchart.com/net-charts/docs/beginners%20guide/ViewXY-series/xy_chart/#SampleDataSeries).

*Waveform chart*
:::tip
If x-Axis is the same for all segments/signals, then it is better (more efficient) to use single LightningChart instance with *Segmented* / *Stacked* [YAxesLayout](https://lightningchart.com/net-charts/docs/inDetail/axis-layout-options/#Graph-segments-and-Y-axes-placement-in-them).
:::
:::info
Check following link for step-by-step tutorial for creating a waveform plot from temperature sensor data in C# using a collection of 5 different sensors and LightningChart .NET: [Creating a waveform plot...](https://lightningchart.com/blog/waveform-plot-from-sensor-data/).
:::
---
## Wind Analysis Data Visualization
Main article will cover some theories on wind analysis. In addition, it will show how to create a simple chart to measure wind speed and direction using a polar chart.
This tutorial is using Polar [AreaSeries](https://lightningchart.com/net-charts/docs/beginners%20guide/ViewPolar-series/polar_chart/#AreaSeries).

*Wind Analysis*
:::info
Check following link for step-by-step tutorial how to create a wind analysis application to measure wind speed and direction using polar charts: [Wind Analysis Data Visualization](https://lightningchart.com/blog/wpf/wind-analysis-data-visualization-app/).
:::
---
## User's Manuals
### English
[User's Manual Version 12.6 (English)](pathname:///LightningChartUsersManual_en.pdf)
### Other languages
[User's Manual Version 12.1 (Chinese, note older version)](pathname:///LightningChartUsersManual_zn.pdf)
[User's Manual Version 10.1 (Japanese, note older version)](pathname:///LightningChartUsersManual_jp.pdf)
[User's Manual Version 10.1 (Korean, note older version)](pathname:///LightningChartUsersManual_ko.pdf)