Class LightningChart
- Namespace
- LightningChartLib.WinForms.Charting
- Assembly
- LightningChart.WinForms.Charting.NET4.dll
LightningChart is an ultimate data visualization chart control for high-speed 2D and 3D purposes.
[ToolboxBitmap(typeof(LightningChart), "LightningChart")]
public sealed class LightningChart : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IContainerControl, IChartNode, IDisposable
- Inheritance
-
LightningChart
- Implements
- Inherited Members
- Extension Methods
Constructors
LightningChart()
Default constructor. Creates new LightningChart object.
public LightningChart()
Remarks
LightningChart is highly customizable and fast data visualization tool for just about any need.
Help on how to use LightningChart can be found on Users manual that has been installed with the SDK and on the XML documentation of the library itself.
Examples of how to get things done can be found from demo applications, that contain the source codes of the examples and show how to use LightningChart.
Arction forums at https://lightningchart.com/forum/ contain lots of information on how to use chart. Feel free to send us and other users questions that you cannot find answers to. On support cases you can approach us via e-mail through [email protected].
Note that Demo apps have property editor, that can be used to modify the charts on the fly, and thus try out different settings.
LightningChart(RenderingSettings)
Creates new LightningChart object.
Takes parameter that can be used in defining certain settings on creation time. Note that some of the settings are dangerous to use, and the constructor itself is intended for advanced use. In normal situation it's better to use the default parameterless constructor.
public LightningChart(RenderingSettings renderingSettings)
Parameters
renderingSettingsRenderingSettingsparam renderingSettings M:LightningChartLib.WinForms.Charting.LightningChart.#ctor(LightningChartLib.WinForms.Charting.RenderingSettings)
Remarks
LightningChart is highly customizable and fast data visualization tool for just about any need.
Help on how to use LightningChart can be found on Users manual that has been installed with the SDK and on the XML documentation of the library itself.
Examples of how to get things done can be found from demo applications, that contain the source codes of the examples and show how to use LightningChart.
Arction forums at https://lightningchart.com/forum/ contain lots of information on how to use chart. Feel free to send us and other users questions that you cannot find answers to. On support cases you can approach us via e-mail through [email protected].
Note that Demo apps have property editor, that can be used to modify the charts on the fly, and thus try out different settings.
Properties
ActiveView
The active view selection
public ActiveView ActiveView { get; set; }
Property Value
ActiveViewObject
Getter of the active view object as ViewBase.
public ViewBase ActiveViewObject { get; }
Property Value
BackColor
BackColor image. It has no meaning in this control. Use Background property
[Browsable(false)]
public override Color BackColor { get; }
Property Value
Background
Background fill
public Fill Background { get; set; }
Property Value
BackgroundImage
Background image. It has no meaning in this control
[Browsable(false)]
public override Image BackgroundImage { get; }
Property Value
BackgroundImageLayout
Hide BackgroundImageLayout from VS property editor, because it has no meaning
[Browsable(false)]
public override ImageLayout BackgroundImageLayout { get; set; }
Property Value
ChartManager
Chart manager
public ChartManager ChartManager { get; set; }
Property Value
ColorTheme
Gets or sets the color theme of this chart.
public ColorTheme ColorTheme { get; set; }
Property Value
CustomDynamicTheme
Sets or gets the Custom Dynamic Theme.
public ThemeBasics CustomDynamicTheme { get; set; }
Property Value
CustomMessageOptions
Custom message options.
public CustomMessageOptions CustomMessageOptions { get; set; }
Property Value
EffectAnimator
Effect animation controller
public Timer EffectAnimator { get; set; }
Property Value
FrameCount
Count of rendered frames with the current engine.
public ulong FrameCount { get; }
Property Value
- ulong
Number of so far rendered frames with the currently active rendering engine. 0 if no engine is active.
Remarks
The Value is zeroed on each engine change/reset operation.
GpuUpdateType
public static int GpuUpdateType { get; set; }
Property Value
HorizontalScrollBars
List of horizontal scroll bars.
public HorizontalScrollBarList HorizontalScrollBars { get; set; }
Property Value
Options
Generic chart options.
public ChartOptions Options { get; set; }
Property Value
OutputStream
Stream to write the rendered frame bitmaps to.
Defaults to null. Set the stream to this property and it will be written with ran data of the images on every frame. See remarks for the format.
This property is intended as the fastest way to capture continuous frames from the chart, especially on Headless mode.
public Stream OutputStream { get; set; }
Property Value
Remarks
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 engine 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 of the size of the chart, in pixels.
On the contrary to the other properties of the LightningChart, set stream is NOT disposed on chart's dispose.
On the contrary to the other properties, setting this property will not cause new frame to be rendered.
RenderOptions
Rendering options.
public RenderOptionsCommon RenderOptions { get; set; }
Property Value
Title
Title of the chart
public ChartTitle Title { get; set; }
Property Value
Version
Version info.
public string Version { get; }
Property Value
VerticalScrollBars
List of vertical scroll bars.
public VerticalScrollBarList VerticalScrollBars { get; set; }
Property Value
View3D
3D chart view
public View3D View3D { get; set; }
Property Value
ViewPie3D
3D pie chart view.
public ViewPie3D ViewPie3D { get; set; }
Property Value
ViewPolar
Polar chart view.
public ViewPolar ViewPolar { get; set; }
Property Value
ViewSmith
Smith chart view.
public ViewSmith ViewSmith { get; set; }
Property Value
ViewXY
XY graph view.
public ViewXY ViewXY { get; set; }
Property Value
Methods
BeginUpdate()
Begin update. Disables control repaints when a property is changed. Handy when updating status of many properties or updating series points.
public void BeginUpdate()
Remarks
Remember to call EndUpdate after you have changed the chart properties or series data.
CaptureToBitmap(BitmapAntialiasOptions)
Get chart as bitmap.
public Bitmap CaptureToBitmap(BitmapAntialiasOptions aaOptions = null)
Parameters
aaOptionsBitmapAntialiasOptionsparam aaOptions M:LightningChartLib.WinForms.Charting.LightningChart.CaptureToBitmap(LightningChartLib.WinForms.Charting.BitmapAntialiasOptions)
Returns
- Bitmap
returns M:LightningChartLib.WinForms.Charting.LightningChart.CaptureToBitmap(LightningChartLib.WinForms.Charting.BitmapAntialiasOptions)
CaptureToByteArray(out int, out int, out PixelFormat)
Get the last frame rendered by the chart as byte array containing just pixel data four bytes per pixel.
To get the image data with headers, like in bpm or png format, use SaveToStream method
public byte[] CaptureToByteArray(out int width, out int height, out PixelFormat format)
Parameters
widthintChart width in pixels
heightintChart height in pixels
formatPixelFormatparam format M:LightningChartLib.WinForms.Charting.LightningChart.CaptureToByteArray(System.Int32@,System.Int32@,LightningChartLib.WinForms.Charting.PixelFormat@)
Returns
- byte[]
chart's last rendered raw image as byte array. Each pixel is represented by 4 bytes in the order defined by the format parameter.
Remarks
Note that it is the last image rendered. If chart has yet not rendered any images with given engine, no proper image can be produced.
To get continuous stream output of the chart, use OutputStream property.
CloseGestureInfoHandle(IntPtr)
Close gesture info handle.
public static extern bool CloseGestureInfoHandle(IntPtr hGestureInfo)
Parameters
hGestureInfoIntPtrparam hGestureInfo M:LightningChartLib.WinForms.Charting.LightningChart.CloseGestureInfoHandle(System.IntPtr)
Returns
- bool
returns M:LightningChartLib.WinForms.Charting.LightningChart.CloseGestureInfoHandle(System.IntPtr)
CopyToClipboard()
Copy the chart to clipboard bitmap image.
public bool CopyToClipboard()
Returns
- bool
true if succeeded, false otherwise
CopyToClipboard(ClipboardImageFormat)
Copy the chart to clipboard image by given format.
public bool CopyToClipboard(ClipboardImageFormat imageFormat)
Parameters
imageFormatClipboardImageFormatClipboard image format.
Returns
- bool
true if succeeded, false otherwise
CopyToClipboard(ClipboardImageFormat, BitmapAntialiasOptions)
Copy the chart to clipboard image.
public bool CopyToClipboard(ClipboardImageFormat format, BitmapAntialiasOptions antialiasOptions)
Parameters
formatClipboardImageFormatClipboard image format.
antialiasOptionsBitmapAntialiasOptionsAntialias options.
Returns
- bool
true if succeeded, false otherwise
CopyToClipboard(ClipboardImageFormat, BitmapAntialiasOptions, int, int, bool)
Copy the chart to clipboard image.
public bool CopyToClipboard(ClipboardImageFormat format, BitmapAntialiasOptions antialiasOptions, int width, int height, bool AllowScreenCoordinateChanges = true)
Parameters
formatClipboardImageFormatClipboard image format.
antialiasOptionsBitmapAntialiasOptionsAntialias options.
widthintWidth of required output
heightintHeight of required output
AllowScreenCoordinateChangesboolAllows screen coordinates of certain elements to be scaled by factor of defined size and original size to keep then in place in relation to other chart elements in vector exports. If unsure, use value true. Should be set to false if annotation tables or such constructs are used. Affects only vector output (emf and svg).
Returns
- bool
true if succeeded, false otherwise
CopyToClipboard(ClipboardImageFormat, int, int, bool)
Copy the chart to clipboard image by given format.
public bool CopyToClipboard(ClipboardImageFormat imageFormat, int width, int height, bool AllowScreenCoordinateChanges = true)
Parameters
imageFormatClipboardImageFormatClipboard image format.
widthintWidth of required output
heightintHeight of required output
AllowScreenCoordinateChangesboolAllows screen coordinates of certain elements to be scaled by factor of defined size and original size to keep then in place in relation to other chart elements in vector exports. If unsure, use value true. Should be set to false if annotation tables or such constructs are used. Affects only vector output (emf and svg).
Returns
- bool
true if succeeded, false otherwise
CopyToClipboard(int, int)
Copy the chart to clipboard bitmap image.
public bool CopyToClipboard(int width, int height)
Parameters
Returns
- bool
true if succeeded, false otherwise
CopyToClipboardAsEmf()
Copy chart to clipboard as emf.
public void CopyToClipboardAsEmf()
Remarks
This is simply a helper method to call the CopyToClipboard method with proper image type.
Dispose(bool)
protected override void Dispose(bool disposing)
Parameters
disposingbool
EnableObjectTreeTimer(bool)
Enables/disables internal timer which keeps control of the object tree when the chart is being manipulated by property grid, like in Visual Studio forms designer.
public void EnableObjectTreeTimer(bool enable)
Parameters
enableboolTrue to enable, False to disable
Remarks
In specific heavy applications, when the chart is being from a background thread without Invoke, Set this Disabled to prevent crashes. Using the chart from background thread without Invoke is not recommended.
EndUpdate()
End update. Enables control repainting, and refreshes the control.
public void EndUpdate()
EngineInitResultsToString(List<EngineInitResult>)
Used to convert GetLastEngineInitResults to string to help reporting of it's contents.
public static string EngineInitResultsToString(List<EngineInitResult> results)
Parameters
resultsList<EngineInitResult>param results M:LightningChartLib.WinForms.Charting.LightningChart.EngineInitResultsToString(System.Collections.Generic.List{LightningChartLib.WinForms.Charting.EngineInitResult})
Returns
- string
EngineInitResults as a string.
FullRepaint()
Destroy all buffered draw data and repaint the chart This is slower than Refresh(), but thorough.
public void FullRepaint()
GetActiveUserInteractiveDeviceOverObject()
Get the chart object that is activated by mouse. Note that this information is not correct if we do not have proper device set.
public object GetActiveUserInteractiveDeviceOverObject()
Returns
- object
Last active object. If unavailable, returns null
GetBeginUpdateCount()
Get effectively used BeginUpdate/EndUpdate counter. Use for debugging, if seems that chart does not render.
The value must be 0 in order for the chart to render. If value is larger, some BeginUpdate call has not been closed by matching EndUpdate call.
This indicates total value. Use GetBeginUpdateCountPublic to see difference of public - user called - BeginUpdate / EndUpdate methods.
public int GetBeginUpdateCount()
Returns
- int
returns M:LightningChartLib.WinForms.Charting.LightningChart.GetBeginUpdateCount
GetBeginUpdateCountPublic()
Get public BeginUpdate/EndUpdate counter. Use for debugging, if seems that chart does not render. Must be zero after EndUpdate(), if one wants chart to render.
public int GetBeginUpdateCountPublic()
Returns
- int
returns M:LightningChartLib.WinForms.Charting.LightningChart.GetBeginUpdateCountPublic
GetLastEngineInitResults()
returns a list of EngineInitResult objects of which each defines a tried engine, if its initialization was successful or not and the reasons why its initialization failed.
This method is intended for debugging purposes.
The information applies to the last time the engine was tried to be initialized. The list is recreated each time engine initialization is tried and the old information is lost.
public List<EngineInitResult> GetLastEngineInitResults()
Returns
- List<EngineInitResult>
List describing lastly tried engines and result of the initialization
GetLastOutputStreamFormat()
Getter of the pixel format of the last written data to the OutputStream.
public PixelFormat GetLastOutputStreamFormat()
Returns
- PixelFormat
returns M:LightningChartLib.WinForms.Charting.LightningChart.GetLastOutputStreamFormat
GetLastOutputStreamSize()
Getter of the image size of the last image written to OutputStream as pixels (not DIP's).
public Size GetLastOutputStreamSize()
Returns
- Size
Size of the last image written to OutputStream.
GetParentWindow()
Get parent window handle (HWND). Needed when using the control from other systems than .NET.
public IntPtr GetParentWindow()
Returns
- IntPtr
Parent window handle.
GetRenderDeviceInfo()
Get render device information. Gives information about your graphics adapter. Tells if there is something that prevents the control to run at optimal performance.
public RenderDeviceInfo GetRenderDeviceInfo()
Returns
- RenderDeviceInfo
Information about your graphics adapter.
GetThemeAuroras()
Get Predefined theme Auroras
public ThemeBasics GetThemeAuroras()
Returns
- ThemeBasics
returns M:LightningChartLib.WinForms.Charting.LightningChart.GetThemeAuroras
GetThemeBrushedMetal()
Get Predefined theme Brushed metal
public ThemeBasics GetThemeBrushedMetal()
Returns
- ThemeBasics
returns M:LightningChartLib.WinForms.Charting.LightningChart.GetThemeBrushedMetal
GetThemeMagma()
Get predefined theme magma.
public ThemeBasics GetThemeMagma()
Returns
- ThemeBasics
returns M:LightningChartLib.WinForms.Charting.LightningChart.GetThemeMagma
GetThemePaper()
Get Predefined theme Paper
public ThemeBasics GetThemePaper()
Returns
- ThemeBasics
returns M:LightningChartLib.WinForms.Charting.LightningChart.GetThemePaper
GetThemeRedCarbon()
Get Predefined theme Red carbon
public ThemeBasics GetThemeRedCarbon()
Returns
- ThemeBasics
returns M:LightningChartLib.WinForms.Charting.LightningChart.GetThemeRedCarbon
GetThemeTurquoiseHexagon()
Get predefined theme TurgouiseHexagon.
public ThemeBasics GetThemeTurquoiseHexagon()
Returns
- ThemeBasics
returns M:LightningChartLib.WinForms.Charting.LightningChart.GetThemeTurquoiseHexagon
GetThemeWorldCyberSpace()
Get Predefined theme Wolrd cyber space
public ThemeBasics GetThemeWorldCyberSpace()
Returns
- ThemeBasics
returns M:LightningChartLib.WinForms.Charting.LightningChart.GetThemeWorldCyberSpace
GetTotalChartCount()
Gets total count of chart instances in application context.
public static int GetTotalChartCount()
Returns
- int
Total chart count
GetVersion(out string, out string)
Version and revision.
public void GetVersion(out string version, out string revision)
Parameters
versionstringGets the major and minor numbers of the assembly.
revisionstringArction internal revision number of the library. Notation of this value can change.
HighqualityFontConflictCheck()
Checks if high quality font and transparency background is used with DX11 and gives warning of this conflict combination.
public void HighqualityFontConflictCheck()
InitializeRenderingDevice(bool)
Tries to force the engine initialization in a synchronous fashion. Should have no use in WinForms.
This method allows user to force the rendering device initialization.
Note! Do not force during chart events callbacks, except at AfterRendering event! Causes chart to malfunction, if engine is changed during event handler.
public bool InitializeRenderingDevice(bool force = false)
Parameters
forceboolForces engine reinitialization, even if there should be no reason for it.
Returns
- bool
true if the call resulted in valid engine that is different from the previous one.
Remarks
The engine is re-initialized only if the current engine selection can not result in the currently active device. If it can, the engine is not re-initialized, unless forced.
The method call is synchronous, and the engine is created on call.
Invert(Color)
Opposite color
public static Color Invert(Color color)
Parameters
colorColorColor to convert.
Returns
- Color
The opposite color.
IsHardwareRenderingSupported()
Check if hardware rendering is supported.
public static bool IsHardwareRenderingSupported()
Returns
- bool
True if supports hardware rendering.
IsHardwareRenderingSupported(out DeviceTypeFlags)
Check if hardware rendering is supported.
public static bool IsHardwareRenderingSupported(out DeviceTypeFlags isHardwareAvailableByAdapterInfo)
Parameters
isHardwareAvailableByAdapterInfoDeviceTypeFlagsEnumeration of the devices that can be initialized to hardware mode.
Returns
- bool
True if supports hardware rendering.
Remarks
Note that resolving hardware support is slow and should be done only if really required.
IsPositionOver(int, int)
Finds out if the given coordinate is over the chart control with pixels.
public bool IsPositionOver(int x, int y)
Parameters
Returns
- bool
True if is over
IsUsingHardwareRendering()
Check if chart is using hardware rendering.
public bool IsUsingHardwareRendering()
Returns
- bool
True, if hardware rendering is used, false otherwise.
MeasureText(string, Font)
Measure text with given font in pixels.
public PointInt MeasureText(string text, Font font)
Parameters
Returns
- PointInt
Dimensions in a point structure [in pixels]. If unable to measure, returns (0,0).
OnKeyDown(KeyEventArgs)
protected override void OnKeyDown(KeyEventArgs eventArgs)
Parameters
eventArgsKeyEventArgs
OnKeyUp(KeyEventArgs)
protected override void OnKeyUp(KeyEventArgs eventArgs)
Parameters
eventArgsKeyEventArgs
OnLoad(EventArgs)
protected override void OnLoad(EventArgs eventArgs)
Parameters
eventArgsEventArgs
OnMouseClick(MouseEventArgs)
protected override void OnMouseClick(MouseEventArgs args)
Parameters
argsMouseEventArgs
OnMouseDoubleClick(MouseEventArgs)
protected override void OnMouseDoubleClick(MouseEventArgs eventArgs)
Parameters
eventArgsMouseEventArgs
OnMouseDown(MouseEventArgs)
protected override void OnMouseDown(MouseEventArgs eventArgs)
Parameters
eventArgsMouseEventArgs
OnMouseMove(MouseEventArgs)
protected override void OnMouseMove(MouseEventArgs eventArgs)
Parameters
eventArgsMouseEventArgs
OnMouseUp(MouseEventArgs)
protected override void OnMouseUp(MouseEventArgs eventArgs)
Parameters
eventArgsMouseEventArgs
OnMouseWheel(MouseEventArgs)
protected override void OnMouseWheel(MouseEventArgs eventArgs)
Parameters
eventArgsMouseEventArgs
OnPaint(PaintEventArgs)
protected override void OnPaint(PaintEventArgs eventArgs)
Parameters
eventArgsPaintEventArgs
OnParentChanged(EventArgs)
protected override void OnParentChanged(EventArgs e)
Parameters
OnPreviewKeyDown(PreviewKeyDownEventArgs)
protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs eventArgs)
Parameters
eventArgsPreviewKeyDownEventArgs
OnPrint(PaintEventArgs)
protected override void OnPrint(PaintEventArgs e)
Parameters
OnRaiseThemeChangedEvent(ColorThemeChangedEvent)
protected void OnRaiseThemeChangedEvent(LightningChart.ColorThemeChangedEvent e)
Parameters
OnResize(EventArgs)
protected override void OnResize(EventArgs eventArgs)
Parameters
eventArgsEventArgs
Print()
Print chart to default printer with default settings using raster output. No header nor footer. Print(ImageType, bool, bool, bool, string, string, bool, Padding)
public void Print()
Print(ImageType, bool, bool, bool, string, string, bool, Padding)
Print chart to default printer with given settings.
public void Print(ImageType type, bool backgroundFill, bool graphFill, bool doubleRasterResolution, string header, string footer, bool keepAspectRatio, Padding margins)
Parameters
typeImageTypeImage type: Raster or vector. Default is Raster.
backgroundFillboolEnable background fill. Default is false.
graphFillboolEnable graph fill. Default is false.
doubleRasterResolutionboolEnable double raster resolution. Default is false.
headerstringHeader text.
footerstringFooter text.
keepAspectRatioboolKeep aspect ratio. Default is true.
marginsPaddingMargins.
PrintPreview()
Print preview of chart.
public void PrintPreview()
PrintPreview(string, string, bool)
Print preview of chart.
public void PrintPreview(string header, string footer, bool autoCloseAfterPrint)
Parameters
headerstringHeader text.
footerstringFooter text.
autoCloseAfterPrintboolClose preview window after printed.
PrintPreview(string, ref string, ref string, ref Padding, VisibilityState, ref EnableState, bool)
Print preview of chart.
public void PrintPreview(string header, ref string printerName, ref string footer, ref Padding margin, VisibilityState visibilityState, ref EnableState enableState, bool showDialog = true)
Parameters
headerstringHeader text.
printerNamestringPrinter name
footerstringFooter text.
marginPaddingMargin.
visibilityStateVisibilityStateSpecific controls visibility state.
enableStateEnableStateEnable/disable state of some controls.
showDialogboolTrue to show preview dialog, otherwise to print immediately. Default is true.
PrintWithPageSetup(bool, bool)
Show page setup dialog and print if OK clicked and allowed.
public void PrintWithPageSetup(bool reset, bool print)
Parameters
PrintWithPrinterSelection()
Show printer selection dialog and print if allowed.
public void PrintWithPrinterSelection()
RTK(string)
Read Trader Key
public string RTK(string sProvider)
Parameters
sProviderstringWhat Provider wanted to be use.
Returns
- string
returns M:LightningChartLib.WinForms.Charting.LightningChart.RTK(System.String)
Refresh()
Refresh the control, does not free the buffered draw data, so it's faster than FullRepaint()
public override void Refresh()
ResetBeginUpdateCount()
Reset BeginUpdate/EndUpdate counter. Usually not required to call.
public void ResetBeginUpdateCount()
ResetPageSettings()
Reset page settings.
public void ResetPageSettings()
SaveToFile(string)
Save the chart into a image file with no extra anti-aliasing applied.
public bool SaveToFile(string fileName)
Parameters
fileNamestringTarget file name. You must include file extension (png, bmp, jpg, tif, gif, emf, svg).
Returns
- bool
True if the image was successfully written to file. Returns false on invalid file extension or on file write failure.
SaveToFile(string, BitmapAntialiasOptions)
Save the chart into a image file by using given anti-aliasing options.
public bool SaveToFile(string fileName, BitmapAntialiasOptions antialiasOptions)
Parameters
fileNamestringTarget file name. You must include file extension (png, bmp, jpg, tif, gif, emf, svg).
antialiasOptionsBitmapAntialiasOptionsparam antialiasOptions M:LightningChartLib.WinForms.Charting.LightningChart.SaveToFile(System.String,LightningChartLib.WinForms.Charting.BitmapAntialiasOptions)
Returns
- bool
True if the image was successfully written to file. Anti-aliasing options Returns false on invalid file extension, on file write failure and on other problems on image creation or saving.
SaveToFile(string, BitmapAntialiasOptions, int, int, bool)
Save the chart into a image file by using given anti-aliasing options.
public bool SaveToFile(string fileName, BitmapAntialiasOptions antialiasOptions, int width, int height, bool AllowScreenCoordinateChanges = true)
Parameters
fileNamestringTarget file name. You must include file extension (png, bmp, jpg, tif, gif, emf, svg).
antialiasOptionsBitmapAntialiasOptionsAnti-aliasing options
widthintWidth of required output in pixels
heightintHeight of required output in pixels
AllowScreenCoordinateChangesboolAllows screen coordinates of certain elements to be scaled by factor of defined size and original size to keep then in place in relation to other chart elements in vector exports. If unsure, use value true. Should be set to false if annotation tables or such constructs are used. Affects only vector output (emf and svg).
Returns
- bool
True if the image was successfully written to file. Returns false on invalid file extension, on file write failure and on other problems on image creation or saving.
SaveToFile(string, int, int, bool)
Save to file as given size.
public bool SaveToFile(string fileName, int width, int height, bool AllowScreenCoordinateChanges = true)
Parameters
fileNamestringTarget file name. You must include file extension (png, bmp, jpg, tif, gif, emf, svg).
widthintWidth of required output in pixels (Not in DIPs)
heightintHeight of required output in pixels (Not in DIPs)
AllowScreenCoordinateChangesboolAllows screen coordinates of certain elements to be scaled by factor of defined size and original size to keep then in place in relation to other chart elements in vector exports. If unsure, use value true. Should be set to false if annotation tables or such constructs are used. Affects only vector output (emf and svg).
Returns
- bool
True if the image was successfully written to file. Returns false on invalid file extension or on file write failure.
SaveToStream(Stream)
Save the chart into stream in bitmap format.
public bool SaveToStream(Stream stream)
Parameters
streamStreamStream to write to.
Returns
- bool
true if succeeded, false otherwise
SaveToStream(Stream, TargetImageFormat)
Save the chart into stream in given format and anti-aliasing options.
public bool SaveToStream(Stream stream, TargetImageFormat format)
Parameters
streamStreamStream to write to.
formatTargetImageFormatImage format.
Returns
- bool
true if succeeded, false otherwise
SaveToStream(Stream, TargetImageFormat, BitmapAntialiasOptions)
Save the chart into stream in given format and anti-aliasing options.
Note that the stream's position is at the end. In order to read it to some other variable, rewind it first using seek.
public bool SaveToStream(Stream stream, TargetImageFormat format, BitmapAntialiasOptions antialiasOptions)
Parameters
streamStreamStream to write to.
formatTargetImageFormatImage format.
antialiasOptionsBitmapAntialiasOptionsAnti-alias options.
Returns
- bool
True if succeeded, false otherwise.
SaveToStream(Stream, TargetImageFormat, BitmapAntialiasOptions, int, int, bool)
Save the chart into stream in given format and anti-aliasing options.
public bool SaveToStream(Stream stream, TargetImageFormat format, BitmapAntialiasOptions antialiasOptions, int width, int height, bool AllowScreenCoordinateChanges = true)
Parameters
streamStreamStream to write to.
formatTargetImageFormatImage format.
antialiasOptionsBitmapAntialiasOptionsAntialias options.
widthintWidth of required output
heightintHeight of required output
AllowScreenCoordinateChangesboolAllows screen coordinates of certain elements to be scaled by factor of defined size and original size to keep then in place in relation to other chart elements in vector exports. If unsure, use value true. Should be set to false if annotation tables or such constructs are used. Affects only vector output (emf and svg).
Returns
- bool
true if succeeded, false otherwise
SaveToStream(Stream, TargetImageFormat, int, int, bool)
Save the chart into stream in given format and anti-aliasing options.
public bool SaveToStream(Stream stream, TargetImageFormat format, int width, int height, bool AllowScreenCoordinateChanges = true)
Parameters
streamStreamStream to write to.
formatTargetImageFormatImage format.
widthintWidth of required output
heightintHeight of required output
AllowScreenCoordinateChangesboolAllows screen coordinates of certain elements to be scaled by factor of defined size and original size to keep then in place in relation to other chart elements in vector exports. If unsure, use value true. Should be set to false if annotation tables or such constructs are used. Affects only vector output (emf and svg).
Returns
- bool
true if succeeded, false otherwise
SaveToStream(Stream, int, int)
Save the chart into stream in given size.
public bool SaveToStream(Stream stream, int width, int height)
Parameters
streamStreamStream to write to.
widthintWidth of required output
heightintHeight of required output
Returns
- bool
true if succeeded, false otherwise
SetDeploymentKey(string)
Set Deployment Key
public static void SetDeploymentKey(string deploymentKey)
Parameters
deploymentKeystringparam deploymentKey M:LightningChartLib.WinForms.Charting.LightningChart.SetDeploymentKey(System.String)
SetParentWindow(IntPtr)
Set parent window handle (HWND). Needed when using the control from other systems than .NET.
Parent window handle.public void SetParentWindow(IntPtr hwnd)
Parameters
hwndIntPtrparam hwnd M:LightningChartLib.WinForms.Charting.LightningChart.SetParentWindow(System.IntPtr)
ShowPropertiesEditor()
Show properties editor window.
public void ShowPropertiesEditor()
ShowPropertiesEditor(int, int)
Show properties editor dialog in specific location.
public void ShowPropertiesEditor(int x, int y)
Parameters
ToString()
Convert class description to string
public override string ToString()
Returns
- string
string
TweakDisablePresent()
Disable DirectX present calls, but let the rendering routines run otherwise
public void TweakDisablePresent()
TweakEnablePresent()
Enable DirectX present calls again
public void TweakEnablePresent()
UpdateCustomTheme()
Update custom themes.
public void UpdateCustomTheme()
UpdatePixelAlignment()
Forces update of WPF pixel alignment.
Calling this should not be required normally.
public void UpdatePixelAlignment()
WndProc(ref Message)
protected override void WndProc(ref Message message)
Parameters
messageMessage
Events
AfterRendering
Occurs right after the chart has been rendered.
public event LightningChart.AfterRenderingEventHandler AfterRendering
Event Type
BeforeRendering
Occurs just before the chart is going to get rendered. This is the place where you can create custom graphics objects etc.
public event LightningChart.BeforeRenderingEventHandler BeforeRendering
Event Type
Captured
Occurs right after the chart has been captured. E.g. CopyToClipBoard or SaveToFile, when there is possibility that rendering may be delayed due e.g. image reading from web.
public event LightningChart.CaptureEventHandler Captured
Event Type
ChartMessage
Event that notifies if some error has occurred that does not require exception to be thrown, or some other event has happened worth notifying using system of.
See ChartMessageInfo struct contained in the message for detailed information.
public event LightningChart.ChartMessageHandler ChartMessage
Event Type
ChartSizeChanging
Raises when chart size is changing. If ResizeTimerUpdate is activated this event will be raised when timer is elapsed and before chart will be drawn new Size.
public event EventHandler ChartSizeChanging
Event Type
MultiTouchDown
Occurs when multi-touch is starting.
public event LightningChart.MultiTouchDownEventHandler MultiTouchDown
Event Type
MultiTouchMove
Occurs during multi-touch moving.
public event LightningChart.MultiTouchMoveEventHandler MultiTouchMove
Event Type
MultiTouchUp
Occurs when multi-touch ends.
public event LightningChart.MultiTouchUpEventHandler MultiTouchUp
Event Type
OnDPIChanged
Event for DPI change.
Subscribe to this event to receive information of changes on the DPI and to enable automatic LightningChart resizing / repositioning application window on DPI changes. See LightningChart.DPIChangedHandler for more information.
public event LightningChart.DPIChangedHandler OnDPIChanged
Event Type
PrintPreviewF1Pressed
Raise if "F1" was pressed in the print preview.
public event EventHandler PrintPreviewF1Pressed
Event Type
RenderingEngineChanged
RendererDevice has changed.
This event is called almost every time the engine changes. Please see remarks for the exceptions
public event LightningChart.RenderingEngineChangedHandler RenderingEngineChanged
Event Type
Remarks
The event is emitted if the rendering device changes, even if it's of the previous type. The event is also emitted the first time the type of the device changes to RendererDeviceType.None, meaning that the user has disabled rendering by setting the engine to none, or the initialization of the engine has failed for some reason. To detect these cases, please follow the ChartError events with type of ErrorType.RenderDeviceCreateFailed.
There as exceptions to cases when this is not called even if the engine changes. These are situations where the engine initialization fails in an unexpected critical way, that might indicate larger problem on chart. At these cases only ChartError event of type ErrorType.RenderDeviceCreateFailed is emitted.
ThemeColorChanged
Public event handler for ColorTheme event
public event EventHandler<LightningChart.ColorThemeChangedEvent> ThemeColorChanged
Event Type
TotalChartCountChanged
Occurs when the total chart instance count has changed.
public static event LightningChart.TotalChartCountChangedEventHandler TotalChartCountChanged