Options
All
  • Public
  • Public/Protected
  • All
Menu
summary

The SciChartSurface is the root 2D Chart control in SciChart's High Performance Real-time JavaScript Chart Library

description

To create a chart using SciChart, declare a SciChartSurface using SciChartSurface.create, add X and Y axes to the SciChartSurface.xAxes SciChartSurface.yAxes collection.

Next, add a series or chart type by adding a BaseRenderableSeries to the SciChartSurface.renderableSeries collection.

You can add annotations and markers using the SciChartSurface.annotations property, and you can add zoom and pan behaviours, tooltips and more by using the SciChartSurface.chartModifiers property.

To redraw a SciChartSurface at any time, call SciChartSurface.invalidateElement, however all properties are reactive and the chart will automatically redraw if data or properties change.

remarks

It is possible to have more than one SciChartSurface on screen at the same time. SciChartSurfaces scale to fit the parent DIV where they are hosted. Use CSS to position the DIV.

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

adornerLayer

adornerLayer: AdornerLayer

Protected animationList

animationList: IGenericAnimation[] = []

annotationOverlaySurfaceViewRect

annotationOverlaySurfaceViewRect: Rect

A ViewRect defining the bounds of the Annotation surface over the chart

annotationUnderlaySurfaceViewRect

annotationUnderlaySurfaceViewRect: Rect

A ViewRect defining the bounds of the Annotation surface under the chart

Readonly annotations

summary

Gets the collection of IAnnotation - annotations, markers or shapes drawn over the top of a SciChartSurface

description

A SciChartSurface can have zero to many Annotations.

The Annotations are drawn using our WebGL / WebAssembly rendering engine, but some use SVG for maximum configurability. See derived types of IAnnotation such as BoxAnnotation, LineAnnotation etc...

Use this collection to add and remove Annotations to the chart.

remarks

Adding an Annotation to the chart causes it to automatically redraw. Note that annotations do not pariticpate in autoranging, meaning a chart will zoom to fit data and chart series but not annotations

Protected backgroundProperty

backgroundProperty: string = SciChartSurfaceBase.DEFAULT_THEME.sciChartBackground

chartModifierSurfaceViewRect

chartModifierSurfaceViewRect: Rect

A ViewRect defining the bounds of the Chart Modifier Surface (an area for placing tooltips and overlays during mouse interaction)

Readonly chartModifiers

An ObservableArray of IChartModifierBase derived types. Chart Modifiers provide behavior such as zooming, panning, tooltips, legends and more in SciChart's High Performance Realtime JavaScript Charts. You can use our built in modifiers (see derived types of ChartModifierBase, or create your own for custom interaction behavior.

Protected chartTitleRendererProperty

chartTitleRendererProperty: IChartTitleRenderer

Protected createSuspended

createSuspended: boolean

Protected currentWebGlRenderContextProperty

currentWebGlRenderContextProperty: WebGlRenderContext2D

Protected destinations

destinations: TSciChartDestination[]

Protected disableAspect

disableAspect: boolean

domBackgroundSvgContainer

domBackgroundSvgContainer: SVGSVGElement

The {@link SVGSVGElement} placed on the background and could be used instead of domSvgContainer

domCanvas2D

domCanvas2D: HTMLCanvasElement

The {@link HTMLCanvasElement} which is the HTML5 canvas which SciChart draws overlays (cursors, tooltips) to

domCanvasWebGL

domCanvasWebGL: HTMLCanvasElement

The {@link HTMLCanvasElement} which is the WebGL canvas that SciChart draws to

domChartRoot

domChartRoot: HTMLDivElement

The {@link HTMLDivElement} which is the dom chart root

domDivContainer

domDivContainer: HTMLDivElement

The inner {@link HTMLDivElement} div element

domSeriesBackground

domSeriesBackground: HTMLDivElement

The inner {@link HTMLDivElement} div element placed on the background

domSvgAdornerLayer

domSvgAdornerLayer: SVGSVGElement

The {@link SVGSVGElement} which is the SVG adorner layer canvas, is used for annotation adorners

domSvgContainer

domSvgContainer: SVGSVGElement

The {@link SVGSVGElement} which is the SVG canvas which SciChart adds elements (tooltips, annotations) to

Protected heightAspect

heightAspect: number

Protected idProperty

idProperty: string = generateGuid()

Protected isDeletedProperty

isDeletedProperty: boolean = false

Protected isInitializedProperty

isInitializedProperty: boolean = false

Readonly isSubSurface

isSubSurface: boolean = false

layersOffset

layersOffset: number = 0

Protected loaderJson

loaderJson: any

Readonly modifierAnnotations

modifierAnnotations: ObservableArray<IAnnotation>
summary

Gets the collection of IAnnotation - modifier annotations, markers or shapes drawn over the top of a SciChartSurface

description

A SciChartSurface can have zero to many Annotations.

The Annotations are drawn using our WebGL / WebAssembly rendering engine, but some use SVG for maximum configurability. See derived types of IAnnotation such as BoxAnnotation, LineAnnotation etc...

Use this collection to add and remove Modifier Annotations to the chart.

remarks

Adding an Modifier Annotation to the chart causes it to automatically redraw. Note that annotations do not pariticpate in autoranging, meaning a chart will zoom to fit data and chart series but not annotations

mouseManager

mouseManager: MouseManager

The MouseManager subscribes to mouse events on the domChartRoot and routes them to components within SciChart

onCreatedName

onCreatedName: string

For serialization Only. The name of the onCreated function applied by the builder api

Protected paddingProperty

paddingProperty: Thickness = this.getPaddingProxy(Thickness.fromNumber(10))

preRender

preRender: EventHandler<WebGlRenderContext2D> = new EventHandler<WebGlRenderContext2D>()

An event handler which notifies its subscribers when a render operation starts. Use this to update elements of the chart for the current render. Any updates made here will not trigger a subsequent render.

Protected previousThemeProviderProperty

previousThemeProviderProperty: IThemeProvider = SciChartSurfaceBase.DEFAULT_THEME

Readonly propertyChanged

A propertyChanged EventHandler. See EventHandler for how to subscribe to and be notified when a property changes on the SciChartSurfaceBase

renderNativeAxisLabelsImmediately

renderNativeAxisLabelsImmediately: boolean = false

Normally, native labels are drawn all at once at the end of the render cycle to improve performance. In circumstances where you want to draw over the labels, eg with a subchart, set this true to have them drawn earlier.

renderSurface

renderSurface: RenderSurface

Readonly renderableSeries

summary

Gets the collection of IRenderableSeries - the chart types or series on this SciChartSurface

description

A SciChartSurface can have zero to many RenderableSeries.

The RenderableSeries are drawn as chart types, e.g. Line series, Scatter series. Each RenderableSeries must have a DataSeries.

Use this collection to add and remove series to the chart.

remarks

Adding a series to the chart causes it to automatically redraw. To zoom to fit the data after adding a series, either set AxisCore.autoRange or call SciChartSurface.zoomExtents

rendered

rendered: EventHandler<boolean> = new EventHandler<boolean>()

An event handler which notifies its subscribers when a render operation has finished. Use this to time render performance, or to update elements of the chart or your UI on redraw.

sciChartRenderer

sciChartRenderer: SciChartRenderer

stepBetweenLayers

stepBetweenLayers: number = 10

Protected suspender

suspender: UpdateSuspender

svgClippingMode

svgClippingMode: ESvgClippingMode = ESvgClippingMode.SeriesViewRect

Sets / Gets the clipping mode for SVG Annotations

Protected themeProviderProperty

themeProviderProperty: IThemeProvider = SciChartSurfaceBase.DEFAULT_THEME

Protected titleProperty

titleProperty: string | string[]

Protected titleStyleProperty

titleStyleProperty: Readonly<Required<TChartTitleStyle>> = {fontSize: 60,fontFamily: "Arial",color: SciChartSurfaceBase.DEFAULT_THEME.chartTitleColor,fontWeight: "normal",fontStyle: "normal",lineSpacing: 1.1,padding: Thickness.fromString("10 4 10 4"),multilineAlignment: EMultiLineAlignment.Center,rotation: undefined,alignment: ETextAlignment.Center,position: ETitlePosition.Top,placeWithinChart: false,useNativeText: SciChartDefaults.useNativeText} as const

Protected touchActionProperty

touchActionProperty: string

watermarkPosition

watermarkPosition: EWatermarkPosition = SciChartDefaults.watermarkPosition

The position of the watermark for trials and community licenses

watermarkRelativeToCanvas

watermarkRelativeToCanvas: boolean = false

Set true to position the watermark relative to the overall canvas, rather than the series area.

Readonly webAssemblyContext2D

webAssemblyContext2D: TSciChart

The SciChart 2D WebAssembly Context containing native methods and access to our WebGL2 Engine and WebAssembly numerical methods

Protected widthAspect

widthAspect: number

Readonly xAxes

summary

Gets the collection of AxisBase2D - the X Axis on a SciChartSurface

description

A SciChartSurface can have one to many XAxes.

Axis may be positioned on the left, right, top or bottom of the chart by using AxisBase2D.axisAlignment.

XAxis may be positioned on the top/bottom (default) or left/right in the case of a rotated or vertical chart.

Series and annotations may be linked to an axis via the AxisCore.id, BaseRenderableSeries.xAxisId and AnnotationBase.xAxisId property.

remarks

Adding an Axis to the chart causes it to automatically redraw. Note that Axis by default do not zoom to fit data. See the AxisBase2D.autoRange property for more information.

Readonly yAxes

summary

Gets the collection of AxisBase2D - the Y Axis on a SciChartSurface

description

A SciChartSurface can have one to many YAxes.

Axis may be positioned on the left, right, top or bottom of the chart by using AxisBase2D.axisAlignment.

YAxis may be positioned on the left/right (default) or bottom/top in the case of a rotated or vertical chart.

Series and annotations may be linked to an axis via the AxisCore.id, BaseRenderableSeries.yAxisId and AnnotationBase.yAxisId property.

remarks

Adding an Axis to the chart causes it to automatically redraw. Note that Axis by default do not zoom to fit data. See the AxisBase2D.autoRange property for more information.

Static AntiAliasWebGlBackbuffer

AntiAliasWebGlBackbuffer: boolean = false

Global property defining whether the WebGL render target is anti-aliased or not. This will affect all SciChartSurfaces (2D & 3D) in the application.

remarks

Defaults to FALSE for crisp gridlines and lines. Individual line series and text labels are chart parts are automatically anti-aliased

Static DEFAULT_THEME

DEFAULT_THEME: IThemeProvider = new SciChartJSDarkv2Theme()

Gets or sets the application-wide default theme. See IThemeProvider for details

Static autoDisposeWasmContext

autoDisposeWasmContext: boolean = false

Defines if the shared wasmContext (WebAssembly Context) should be deleted after all of the surfaces that use it are deleted.

Static domMasterCanvas

domMasterCanvas: HTMLCanvasElement

The master WebGL canvas

remarks

WARNING: Do not set this property, this is set internally by SciChart when initializing mutliple charts

Static invalidateOnTabVisible

invalidateOnTabVisible: boolean = true

Defines if charts should rerender when the tab becomes active.

remarks

Enabled by default. Purpose of this behavior is to deal with the issue of canvas data being cleared on an inactive tab .

Static wasmContextDisposeTimeout

wasmContextDisposeTimeout: number = 0

Defines a delay of the shared wasmContext auto-dispose if autoDisposeWasmContext is enabled.

Accessors

adjustedPadding

  • Gets the adjusted padding between the SciChartSurface and its inner elements, in order top, right, bottom, left Defines a resulting padding accordingly to DPI scaling.

    Returns Thickness

autoColorMode

  • Gets or sets the EAutoColorMode which determines when resolution of AUTO_COLOR should occur

    Returns EAutoColorMode

  • Gets or sets the EAutoColorMode which determines when resolution of AUTO_COLOR should occur

    Parameters

    Returns void

background

  • get background(): string
  • set background(background: string): void
  • Gets or sets the SciChartSurface Background as an HTML color code

    Returns string

  • Gets or sets the SciChartSurface Background as an HTML color code

    Parameters

    • background: string

    Returns void

bottomCanvasBorder

  • get bottomCanvasBorder(): number
  • Gets the SciChartSurface Canvas Bottom Border

    Returns number

bottomViewportBorder

  • get bottomViewportBorder(): number
  • Gets the SciChartSurface Viewport Bottom Border

    Returns number

canvasBorder

  • Gets or sets the SciChartSurface Canvas Border properties

    Returns TBorder

  • Gets or sets the SciChartSurface Canvas Border properties

    Parameters

    Returns void

chartModifierGroups

  • get chartModifierGroups(): string[]

chartTitleRenderer

  • Controls the rendering of {@link SiCharSurface.title}

    Returns IChartTitleRenderer

  • Controls the rendering of {@link SiCharSurface.title}

    Parameters

    Returns void

currentWebGlRenderContext

dataLabelLayoutManager

  • Gets or sets the {@link ISeriesTextLayoutManager} for performing text layout across multiple series

    Returns IDataLabelLayoutManager

  • Used internally - gets or sets the {@link ISeriesTextLayoutManager} for performing text layout across multiple series

    Parameters

    Returns void

debugRendering

  • get debugRendering(): boolean
  • set debugRendering(debugRendering: boolean): void
  • Gets or sets a property whether rendering should be debugged. This will draw rectangles around key boxes and areas on the chart. Used internally for development purposes

    Returns boolean

  • Gets or sets a property whether rendering should be debugged. This will draw rectangles around key boxes and areas on the chart. Used internally for development purposes

    Parameters

    • debugRendering: boolean

    Returns void

drawSeriesBehindAxis

  • get drawSeriesBehindAxis(): boolean
  • set drawSeriesBehindAxis(value: boolean): void
  • Gets or sets the boolean flag for switching behaviour of Axises rendering

    Returns boolean

  • Gets or sets the boolean flag for switching behaviour of Axises rendering

    Parameters

    • value: boolean

    Returns void

id

  • get id(): string
  • set id(value: string): void
  • Gets or sets the SciChartSurface Id

    Returns string

  • Gets or sets the SciChartSurface Id

    Parameters

    • value: string

    Returns void

isCopyCanvasSurface

  • get isCopyCanvasSurface(): HTMLCanvasElement

isDeleted

  • get isDeleted(): boolean
  • Used internally - gets isDeleted flag

    Returns boolean

isInitialized

  • get isInitialized(): boolean
  • Used internally - gets isInitialized flag

    Returns boolean

isInvalidated

  • get isInvalidated(): boolean

isRunningAnimation

  • get isRunningAnimation(): boolean
  • Returns true if an animation is running

    Returns boolean

isSuspended

  • get isSuspended(): boolean
  • Gets a value indicating whether updates for the target are currently suspended

    inheritdoc

    Returns boolean

layoutManager

leftCanvasBorder

  • get leftCanvasBorder(): number
  • Gets the SciChartSurface Canvas Left Border

    Returns number

leftViewportBorder

  • get leftViewportBorder(): number
  • Gets the SciChartSurface Viewport Left Border

    Returns number

otherSurfaces

padding

  • Gets or sets the Padding between the SciChartSurface and its inner elements, in order top, right, bottom, left

    Returns Thickness

  • Gets or sets the Padding between the SciChartSurface and its inner elements, in order top, right, bottom, left

    Parameters

    Returns void

previousThemeProvider

rightCanvasBorder

  • get rightCanvasBorder(): number
  • Gets the SciChartSurface Canvas Right Border

    Returns number

rightViewportBorder

  • get rightViewportBorder(): number
  • Gets the SciChartSurface Viewport Right Border

    Returns number

seriesViewRect

  • get seriesViewRect(): Rect

subCharts

  • The list of subCharts on this surface. See addSubChart

    Returns ReadonlyArray<SciChartSubSurface>

surfaceType

suspendableId

  • get suspendableId(): string
  • A unique ID for this suspendable instance. Consider using the generateGuid function to ensure this is unique

    inheritdoc

    Returns string

themeProvider

title

  • get title(): string | string[]
  • set title(value: string | string[]): void
  • Gets or sets the title for the SciChartSurface

    Returns string | string[]

  • Gets or sets the title for the SciChartSurface

    Parameters

    • value: string | string[]

    Returns void

titleStyle

  • get titleStyle(): ({ color?: string; fontFamily?: string; fontSize?: number; lineSpacing?: number; padding?: Thickness } & { useNativeText: true } & { multilineAlignment?: EMultiLineAlignment; rotation?: number } & { alignment?: ETextAlignment; placeWithinChart?: boolean; position?: ETitlePosition }) | ({ color?: string; fontFamily?: string; fontSize?: number; lineSpacing?: number; padding?: Thickness } & { fontStyle?: string; fontWeight?: string; useNativeText?: false } & { multilineAlignment?: EMultiLineAlignment; rotation?: number } & { alignment?: ETextAlignment; placeWithinChart?: boolean; position?: ETitlePosition })
  • set titleStyle(value: TChartTitleStyle): void
  • Gets or sets the title text style and placement for the SciChartSurface as TChartTitleStyle

    remarks

    if updating, should be set as an object (or partial object) of type TChartTitleStyle, instead of directly setting individual properties

    Returns ({ color?: string; fontFamily?: string; fontSize?: number; lineSpacing?: number; padding?: Thickness } & { useNativeText: true } & { multilineAlignment?: EMultiLineAlignment; rotation?: number } & { alignment?: ETextAlignment; placeWithinChart?: boolean; position?: ETitlePosition }) | ({ color?: string; fontFamily?: string; fontSize?: number; lineSpacing?: number; padding?: Thickness } & { fontStyle?: string; fontWeight?: string; useNativeText?: false } & { multilineAlignment?: EMultiLineAlignment; rotation?: number } & { alignment?: ETextAlignment; placeWithinChart?: boolean; position?: ETitlePosition })

  • Gets or sets the title text style and placement for the SciChartSurface as TChartTitleStyle

    remarks

    if updating, should be set as an object (or partial object) of type TChartTitleStyle, instead of directly setting individual properties

    Parameters

    Returns void

topCanvasBorder

  • get topCanvasBorder(): number
  • Gets the SciChartSurface Canvas Top Border

    Returns number

topViewportBorder

  • get topViewportBorder(): number
  • Gets the SciChartSurface Viewport Top Border

    Returns number

viewportBorder

  • get viewportBorder(): TBorder
  • set viewportBorder(value: TBorder): void
  • Gets or sets the SciChartSurface Viewport Border properties

    Returns TBorder

  • Gets or sets the SciChartSurface Viewport Border properties

    Parameters

    Returns void

zoomState

  • Gets zoomStateProperty

    Returns EZoomState

Methods

addAnimation

  • Add a GenericAnimation to the surface. Multiple animations will be run in parallel, so if you want to run one after another, use the onCompleted callback to add another animation after the first completes

    Parameters

    Returns void

addDeletable

addSubChart

  • Add another chart to an existing surface. This is a performance optimization if you need to have multiple charts all updating together, eg because they have synced axes. We suggest you use SciChartSurface.createSingle for the parent surface. The parent surface does not have to have any chart elements defined. The position property required in the options determines the placement and size of the subchart. Its values are interpreted differently depending on the coordinateMode Modifiers using modifierGroup will work across other subcharts on the surface, but not to any other surface.

    Parameters

    Returns SciChartSubSurface

Protected applyOptions

Protected applySciChartBackground

  • applySciChartBackground(background: string, alphaEnabled?: boolean): void

applyTheme

Protected attachChartModifier

Protected changeMasterCanvasViewportSize

  • changeMasterCanvasViewportSize(wasmContext: TSciChart | TSciChart3D, pixelWidth: number, pixelHeight: number): void

changeViewportSize

  • changeViewportSize(pixelWidth: number, pixelHeight: number): void

Protected changeWebGLCanvasViewportSize

  • changeWebGLCanvasViewportSize(wasmContext: TSciChart | TSciChart3D, pixelWidth: number, pixelHeight: number): void

Protected clearRootElement

  • clearRootElement(clearHtml: boolean): void

decrementSuspend

  • decrementSuspend(): void
  • Called by IUpdateSuspender each time a target suspender is resumed. When the final target suspender has been resumed, resumeUpdates is called

    Returns void

delete

  • delete(clearHtml?: boolean): void

Protected detachChartModifier

doDrawingLoop

  • Parameters

    Returns void

drawBorder

  • Used internally - draws SciChartSurface borders

    Parameters

    Returns void

Protected enableRenderListener

  • enableRenderListener(): void

getAnimations

  • Gets the generic animations currently on the surface. Do not manipulate this array directly. To add, use addAnimation. To remove, find an animation and call .cancel() on it.

    Returns ReadonlyArray<IGenericAnimation>

getCoordSvgTranslation

  • getCoordSvgTranslation(): Point
  • Gets SVG Canvas Translation, used to draw on SVG Canvas using different ESvgClippingMode

    Returns Point

getMainCanvas

  • getMainCanvas(): HTMLCanvasElement

getNextState

  • Triggers the rerendering of the surface and after the chart rerendering is completed, returns its serialized state retrieved with SciChartSurface.toJSON.

    Parameters

    • Default value excludeData: boolean = false

      if set true, data values will not be included in the json.

    Returns Promise<ISciChart2DDefinition>

    JSON-like object ISciChart2DDefinition

getSeriesViewRectPadding

  • getSeriesViewRectPadding(scaled?: boolean): Thickness

getXAxisById

  • Gets the XAxis which matches the axisId. Returns undefined if not axis found

    Parameters

    • axisId: string

      The AxisId to search for

    Returns AxisBase2D

getYAxisById

  • Gets the YAxis which matches the axisId. Returns undefined if not axis found

    Parameters

    • axisId: string

      The AxisId to search for

    Returns AxisBase2D

invalidateElement

  • invalidateElement(options?: { force?: boolean }): void
  • inheritdoc

    Parameters

    • Optional options: { force?: boolean }
      • Optional force?: boolean

    Returns void

nextStateRender

  • nextStateRender(options?: { invalidateOnResume?: boolean; resumeBefore?: boolean; suspendAfter?: boolean }): Promise<unknown>
  • Creates a promise which resolves when the chart is updated to the next fully rendered state

    remarks

    If the surface is initialized with createSingle the promise resolves after the main render function is executed. Otherwise, if it is initialized with create - the promise resolves after image data is copied to the 2D canvas.

    Parameters

    • Optional options: { invalidateOnResume?: boolean; resumeBefore?: boolean; suspendAfter?: boolean }
      • Optional invalidateOnResume?: boolean
      • Optional resumeBefore?: boolean
      • Optional suspendAfter?: boolean

    Returns Promise<unknown>

Protected notifyPropertyChanged

  • notifyPropertyChanged(propertyName: string): void

onAnimate

  • onAnimate(timeElapsed: number): void
  • Is being called on each render, to run animations

    Parameters

    • timeElapsed: number

    Returns void

Protected onAttachSubSurface

  • Parameters

    Returns void

Protected onDetachSubSurface

  • Parameters

    Returns void

onDpiChanged

registerFont

  • registerFont(fontName: string, url: string): Promise<boolean>
  • Parameters

    • fontName: string

      Register a font to be used with native text.

    • url: string

    Returns Promise<boolean>

removeSubChart

  • Remove an existing subChart from a parent surface. See addSubChart

    Parameters

    Returns void

resolveAutoColors

  • resolveAutoColors(maxSeries?: number): void
  • Calls resolveAutoColors on each series to resolve colors marked as auto based on the seriesColorPalette

    Parameters

    • Optional maxSeries: number

    Returns void

resume

  • resume(): void
  • Returns void

resumeUpdates

Protected setClearAlphaParams

  • setClearAlphaParams(enabled: boolean, alpha: number): void
  • inheritdoc

    Parameters

    • enabled: boolean
    • alpha: number

    Returns void

setCoordSvgTranslation

  • setCoordSvgTranslation(x: number, y: number): void
  • Used internally - sets SVG Canvas Translation

    Parameters

    • x: number
    • y: number

    Returns void

setDestinations

setIsInitialized

  • setIsInitialized(): void

setSeriesViewRect

  • setSeriesViewRect(seriesViewRect: Rect): void

setZoomState

  • Sets zoomStateProperty

    Parameters

    Returns void

suspendUpdates

toJSON

  • Convert the object to a definition that can be serialized to JSON, or used directly with the builder api

    Parameters

    • Default value excludeData: boolean = false

      if set true, data values will not be included in the json.

    Returns ISciChart2DDefinition

updateBackground

  • updateBackground(): void
  • Used internally, updates background after switching between different SciChartSurfaces

    Returns void

updateStackedCollectionAccumulatedVectors

  • updateStackedCollectionAccumulatedVectors(): void
  • Update accumulated vectors for all stacked collections

    Returns void

updateWatermark

  • updateWatermark(left: number, bottom: number): void

zoomExtents

  • zoomExtents(animationDurationMs?: number, easingFunction?: TEasingFn, onCompleted?: () => void): void
  • summary

    Zooms the SciChartSurface in the X and Y direction to extents of all data (zoom to fit)

    description

    Parameters

    • Default value animationDurationMs: number = 0

      An optional animation duration. Default value is 0, which means 'no animation'

    • Default value easingFunction: TEasingFn = easing.outExpo

      An optional easing function for animations. See TEasingFn for a list of values

    • Default value onCompleted: () => void = () => {}

      the callback function

        • (): void
        • Returns void

    Returns void

zoomExtentsX

  • zoomExtentsX(animationDurationMs?: number, easingFunction?: TEasingFn): void
  • summary

    Zooms the SciChartSurface in the X direction to extents of all data (zoom to fit)

    description

    Parameters

    • Default value animationDurationMs: number = 0

      An optional animation duration. Default value is 0, which means 'no animation'

    • Default value easingFunction: TEasingFn = easing.outExpo

      An optional easing function for animations. See TEasingFn for a list of values

    Returns void

zoomExtentsY

  • zoomExtentsY(animationDurationMs?: number, easingFunction?: TEasingFn): void
  • summary

    Zooms the SciChartSurface in the Y direction to extents of all data (zoom to fit)

    description

    Parameters

    • Default value animationDurationMs: number = 0

      An optional animation duration. Default value is 0, which means 'no animation'

    • Default value easingFunction: TEasingFn = easing.outExpo

      An optional easing function for animations. See TEasingFn for a list of values

    Returns void

Static UseCommunityLicense

  • UseCommunityLicense(): void

Static configure

  • Allows setting of web URL for Wasm and Data files, in the case you are loading SciChart outside of npm/webpack environment. Note the version number of data/wasm Urls must match the version number of SciChart.js you are using. To use the default CDN, just call SciChart.SciChartSurface.useWasmFromCDN();

    example
    import { libraryVersion } from "scichart/Core/BuildStamp";
    
    SciChart.SciChartSurface.configure({
     dataUrl: `https://cdn.jsdelivr.net/npm/scichart@${libraryVersion}/_wasm/scichart2d.data`,
     wasmUrl: `https://cdn.jsdelivr.net/npm/scichart@${libraryVersion}/_wasm/scichart2d.wasm`
    });

    Parameters

    Returns void

Static create

Static createSingle

  • Performs a similar operation to SciChartSurface.create but uses a dedicated WebAssembly context for this chart, and draws directly to the target canvas This provides better performance for a single chart, but there is a limit (16) to how many you can have on one page. If you need large numbers of charts all updating at the same time, use this, together with addSubChart to create many charts on one surface.

    Parameters

    Returns Promise<TWebAssemblyChart>

Static disposeSharedWasmContext

  • disposeSharedWasmContext(): void

Static isSubSurface

  • Parameters

    Returns surface is SciChartSubSurface

Static loadWasmFromCDN

  • loadWasmFromCDN(): void
  • Tell SciChart to load the Wasm and Data files from CDN, rather than expecting them to be served by the host server.

    Returns void

Static loadWasmLocal

  • loadWasmLocal(): void
  • Tell SciChart to load the Wasm and Data files from the local server, rather than from CDN.

    Returns void

Static resolveOptions

Static setLicenseCallback

  • setLicenseCallback(callback: (queryString: string) => Promise<Response>): void
  • Sets function that will be called by the framework to validate a runtime license from the server, if you need to add additional handling, such as custom authentication. The request sent to the server must include the queryString section passed in, which does not come with a leading ?

    Parameters

    • callback: (queryString: string) => Promise<Response>
        • (queryString: string): Promise<Response>
        • Parameters

          • queryString: string

          Returns Promise<Response>

    Returns void

Static setRuntimeLicenseKey

  • setRuntimeLicenseKey(keyCode: string): void
  • Sets the runtime license key. Use for full licenses or trials only, not developer licenses.

    Parameters

    • keyCode: string

    Returns void

Static setServerLicenseEndpoint

  • setServerLicenseEndpoint(endpoint: string): void
  • Sets the endpoint for validating a runtime license key with the server. Must be a relative path.

    default

    api/license

    Parameters

    • endpoint: string

    Returns void

Static useWasmFromCDN

  • useWasmFromCDN(): void
  • Tell SciChart to load the Wasm and Data files from CDN, rather than expecting them to be served by the host server.

    deprecated

    the method name breaks eslint react-hooks/rules-of-hooks. To avoid this error in React, use loadWasmFromCDN instead.

    Returns void

Static useWasmLocal

  • useWasmLocal(): void
  • Tell SciChart to load the Wasm and Data files from the local server, rather than from CDN.

    deprecated

    the method name breaks eslint react-hooks/rules-of-hooks. To avoid this error in React, use loadWasmLocal instead.

    Returns void

Generated using TypeDoc