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.
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.
Sharing 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.
Export and printing
There are many ways to export and print chart.
XAML serialization
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.
Creating UWP project
Universal Windows Platform (UWP) 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.
Setting background fill
Chart Background
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.
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.
CustomMessage
From version 12.4 each View has CustomMessage property to draw text box in the top-left corner.
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:
DPI handling
DPI (Dots Per Inch) is related to monitor resolution and size. High DPI value means smaller pixels and crisper image.
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.
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.
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.
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.