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

autoColorFilter

autoColorFilter: (rs: IRenderableSeries) => boolean

A filter function to apply during {@link ScichartSurface.resolveAutoColors} to determine which series it applies to. Note that if this is set, you will need to call resolveAutoColors yourself whn the things this filter depends on change

Type declaration

Protected backgroundProperty

backgroundProperty: string

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 cleanupLockToken

cleanupLockToken: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

Protected createSuspended

createSuspended: boolean

Protected currentWebGlRenderContextProperty

currentWebGlRenderContextProperty: WebGlRenderContext2D

Protected deletables

deletables: IDeletable[] = []

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

domCanvasWebGL

domCanvasWebGL: HTMLCanvasElement

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

domChartRoot

domChartRoot: HTMLDivElement

domDivContainer

domDivContainer: HTMLDivElement

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

genericAnimationsRun

genericAnimationsRun: EventHandler<any> = new EventHandler<any>()

An event handler which notifies its subscribers when animations stage in render process has finished.

hasInvalidState

hasInvalidState: boolean = false

Protected heightAspect

heightAspect: number

Protected idProperty

idProperty: string = generateGuid()

Protected isDeletedProperty

isDeletedProperty: boolean = false

Protected isInitializedProperty

isInitializedProperty: boolean = false

Readonly isSubSurface

isSubSurface: boolean = false

isWebGLContextActive

isWebGLContextActive: boolean = true

layoutMeasured

layoutMeasured: EventHandler<any> = new EventHandler<any>()

An event handler which notifies its subscribers when a layout stage in render process has finished.

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

offset

offset: Thickness | undefined

An offset of the surface position. INTERNAL USE.

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))

Readonly painted

painted: EventHandler<any> = new EventHandler<any>()

An event handler which notifies its subscribers when a chart was visually painted a display canvas.

remarks

Not applicable to sub-charts

preRender

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

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

preRenderAll

preRenderAll: EventHandler<WebGlRenderContext2D> = new EventHandler<any>()

An event handler which notifies its subscribers when a render operation starts ignoring the surface order. 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

redrawRequested

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

An event handler which notifies its subscribers when a chart was requested to redraw initially.

Readonly renderError

renderError: EventHandler<any> = new EventHandler<any>()

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 ISciChartSurface

description

A ISciChartSurface 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.

renderedToDestination

renderedToDestination: EventHandler<any> = new EventHandler<any>()

An event handler which notifies its subscribers when a chart was rendered to a display canvas.

remarks

Not applicable to sub-charts

renderedToWebGl

renderedToWebGl: EventHandler<any> = new EventHandler<any>()

An event handler which notifies its subscribers when a chart was rendered to WebgL Canvas.

remarks

Not applicable to sub-charts

Readonly resized

resized: EventHandler<Size> = new EventHandler<Size>()

Protected resolvedSurfaceRenderOrder

resolvedSurfaceRenderOrder: number = 0

sciChartRenderer

sciChartRenderer: SciChartRenderer

stepBetweenLayers

stepBetweenLayers: number = 10

Protected surfaceRenderOrderProperty

surfaceRenderOrderProperty: number = undefined

Readonly suspender

suspender: UpdateSuspender = new UpdateSuspender()

Protected themeProviderProperty

themeProviderProperty: IThemeProvider = SciChartSurfaceBase.DEFAULT_THEME

Protected titleProperty

titleProperty: string | string[]

Protected titleStyleProperty

titleStyleProperty: Readonly<Required<TChartTitleStyle>> = {fontSize: 60,fontFamily: getDefaultFontName(),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

Protected visibilityObserver

visibilityObserver: VisibilityObserver

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 ISciChartSurface

description

A ISciChartSurface 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 ISciChartSurface

description

A ISciChartSurface 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

    remarks

    Allowable values are colors e.g. 'Red', '#FF00FF', 'rgba(255,0,0,1)'. Also, main surface background supports gradients 'linear-gradient(45deg, rgb(255,0,0,1), rgb(0,0,255,1))', or background images e.g. 'url('https://somewebsite.com/someimage.png')'. Sub-charts, however, support only basic formats.

    Returns string

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

    remarks

    Allowable values are colors e.g. 'Red', '#FF00FF', 'rgba(255,0,0,1)'. Also, main surface background supports gradients 'linear-gradient(45deg, rgb(255,0,0,1), rgb(0,0,255,1))', or background images e.g. 'url('https://somewebsite.com/someimage.png')'. Sub-charts, however, support only basic formats.

    Parameters

    • background: string

      The HTML color code

    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[]
  • Gets Chart Modifier Groups, is used for sharing events between chart modifiers

    Returns string[]

chartTitleRenderer

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

    inheritdoc

    Returns IChartTitleRenderer

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

    Parameters

    Returns void

chartViewRect

  • get chartViewRect(): Rect

clipRect

  • get clipRect(): Rect

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

freezeWhenOutOfView

  • get freezeWhenOutOfView(): boolean
  • set freezeWhenOutOfView(freezeWhenOutOfView: boolean): void
  • When true, charts that are out of the viewport will be frozen (pausing rendering). Data updates can resume Once the chart is in view again, rendering will resume. This can be useful for performance optimization.

    Returns boolean

  • When true, charts that are out of the viewport will be frozen (pausing rendering). Data updates can resume Once the chart is in view again, rendering will resume. This can be useful for performance optimization.

    Parameters

    • freezeWhenOutOfView: 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

isInvalidated

  • get isInvalidated(): boolean

isPolar

  • get isPolar(): 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

  • Used internally - gets or sets the LayoutManager

    Returns LayoutManager

  • Used internally - gets or sets the LayoutManager

    Parameters

    Returns void

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

subChartCounter

  • get subChartCounter(): number
  • Gets the sub-chart counter value

    inheritdoc

    Returns number

subCharts

  • The list of subCharts on this surface. See {@link addSubChart}

    Returns ReadonlyArray<ISciChartSubSurface>

surfaceType

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

viewRect

  • get viewRect(): Rect

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

addSubChartInternal

Protected applyOptions

Protected applySciChartBackground

  • inheritdoc

    Parameters

    Returns 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

delete

  • delete(clearHtml?: boolean): void
  • Deletes native (WebAssembly) memory used by this type, after which it cannot be used.

    Parameters

    • Default value clearHtml: boolean = true

    Returns void

Protected detachChartModifier

doDrawingLoop

  • Parameters

    Returns void

drawBorder

  • Used internally - draws SciChartSurface borders

    Parameters

    Returns 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 clipping modes

    Returns Point

getDefaultXAxis

getDefaultYAxis

getLicenseContext

  • getLicenseContext(): { SCRTCredentials: { ApplyLicenseResponse: (response: string) => number; Dump: () => string; GetAllowDebugging: () => boolean; GetDeveloperCount: () => number; GetEncryptedOrderId: () => string; GetLicenseChallenge: () => string; GetLicenseDaysRemaining: () => number; GetLicenseErrors: () => string; GetLicenseType: () => SCRTLicenseType; GetOrderId: () => string; GetProductCode: () => string; HasFeature: (feature: string) => SCRTLicenseType; RequiresValidation: () => boolean; ResetRuntimeLicense: () => void; SetRuntimeLicenseKeyW: (licenseKey: string) => void }; SCRTLicenseType: { LICENSE_TYPE_COMMUNITY: SCRTLicenseType; LICENSE_TYPE_FULL: SCRTLicenseType; LICENSE_TYPE_FULL_EXPIRED: SCRTLicenseType; LICENSE_TYPE_INVALID_DEVELOPER_LICENSE: SCRTLicenseType; LICENSE_TYPE_INVALID_LICENSE: SCRTLicenseType; LICENSE_TYPE_NO_LICENSE: SCRTLicenseType; LICENSE_TYPE_REQUIRES_VALIDATION: SCRTLicenseType; LICENSE_TYPE_SUBSCRIPTION_EXPIRED: SCRTLicenseType; LICENSE_TYPE_TRIAL: SCRTLicenseType; LICENSE_TYPE_TRIAL_EXPIRED: SCRTLicenseType } }
  • Returns { SCRTCredentials: { ApplyLicenseResponse: (response: string) => number; Dump: () => string; GetAllowDebugging: () => boolean; GetDeveloperCount: () => number; GetEncryptedOrderId: () => string; GetLicenseChallenge: () => string; GetLicenseDaysRemaining: () => number; GetLicenseErrors: () => string; GetLicenseType: () => SCRTLicenseType; GetOrderId: () => string; GetProductCode: () => string; HasFeature: (feature: string) => SCRTLicenseType; RequiresValidation: () => boolean; ResetRuntimeLicense: () => void; SetRuntimeLicenseKeyW: (licenseKey: string) => void }; SCRTLicenseType: { LICENSE_TYPE_COMMUNITY: SCRTLicenseType; LICENSE_TYPE_FULL: SCRTLicenseType; LICENSE_TYPE_FULL_EXPIRED: SCRTLicenseType; LICENSE_TYPE_INVALID_DEVELOPER_LICENSE: SCRTLicenseType; LICENSE_TYPE_INVALID_LICENSE: SCRTLicenseType; LICENSE_TYPE_NO_LICENSE: SCRTLicenseType; LICENSE_TYPE_REQUIRES_VALIDATION: SCRTLicenseType; LICENSE_TYPE_SUBSCRIPTION_EXPIRED: SCRTLicenseType; LICENSE_TYPE_TRIAL: SCRTLicenseType; LICENSE_TYPE_TRIAL_EXPIRED: SCRTLicenseType } }

    • SCRTCredentials: { ApplyLicenseResponse: (response: string) => number; Dump: () => string; GetAllowDebugging: () => boolean; GetDeveloperCount: () => number; GetEncryptedOrderId: () => string; GetLicenseChallenge: () => string; GetLicenseDaysRemaining: () => number; GetLicenseErrors: () => string; GetLicenseType: () => SCRTLicenseType; GetOrderId: () => string; GetProductCode: () => string; HasFeature: (feature: string) => SCRTLicenseType; RequiresValidation: () => boolean; ResetRuntimeLicense: () => void; SetRuntimeLicenseKeyW: (licenseKey: string) => void }
      • ApplyLicenseResponse: (response: string) => number
          • (response: string): number
          • Parameters

            • response: string

            Returns number

      • Dump: () => string
          • (): string
          • Returns string

      • GetAllowDebugging: () => boolean
          • (): boolean
          • Returns boolean

      • GetDeveloperCount: () => number
          • (): number
          • Returns number

      • GetEncryptedOrderId: () => string
          • (): string
          • Returns string

      • GetLicenseChallenge: () => string
          • (): string
          • Returns string

      • GetLicenseDaysRemaining: () => number
          • (): number
          • Returns number

      • GetLicenseErrors: () => string
          • (): string
          • Returns string

      • GetLicenseType: () => SCRTLicenseType
          • (): SCRTLicenseType
          • Returns SCRTLicenseType

      • GetOrderId: () => string
          • (): string
          • Returns string

      • GetProductCode: () => string
          • (): string
          • Returns string

      • HasFeature: (feature: string) => SCRTLicenseType
          • (feature: string): SCRTLicenseType
          • Parameters

            • feature: string

            Returns SCRTLicenseType

      • RequiresValidation: () => boolean
          • (): boolean
          • Returns boolean

      • ResetRuntimeLicense: () => void
          • (): void
          • Returns void

      • SetRuntimeLicenseKeyW: (licenseKey: string) => void
          • (licenseKey: string): void
          • Parameters

            • licenseKey: string

            Returns void

    • SCRTLicenseType: { LICENSE_TYPE_COMMUNITY: SCRTLicenseType; LICENSE_TYPE_FULL: SCRTLicenseType; LICENSE_TYPE_FULL_EXPIRED: SCRTLicenseType; LICENSE_TYPE_INVALID_DEVELOPER_LICENSE: SCRTLicenseType; LICENSE_TYPE_INVALID_LICENSE: SCRTLicenseType; LICENSE_TYPE_NO_LICENSE: SCRTLicenseType; LICENSE_TYPE_REQUIRES_VALIDATION: SCRTLicenseType; LICENSE_TYPE_SUBSCRIPTION_EXPIRED: SCRTLicenseType; LICENSE_TYPE_TRIAL: SCRTLicenseType; LICENSE_TYPE_TRIAL_EXPIRED: SCRTLicenseType }
      • LICENSE_TYPE_COMMUNITY: SCRTLicenseType
      • LICENSE_TYPE_FULL: SCRTLicenseType
      • LICENSE_TYPE_FULL_EXPIRED: SCRTLicenseType
      • LICENSE_TYPE_INVALID_DEVELOPER_LICENSE: SCRTLicenseType
      • LICENSE_TYPE_INVALID_LICENSE: SCRTLicenseType
      • LICENSE_TYPE_NO_LICENSE: SCRTLicenseType
      • LICENSE_TYPE_REQUIRES_VALIDATION: SCRTLicenseType
      • LICENSE_TYPE_SUBSCRIPTION_EXPIRED: SCRTLicenseType
      • LICENSE_TYPE_TRIAL: SCRTLicenseType
      • LICENSE_TYPE_TRIAL_EXPIRED: SCRTLicenseType

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<{ type: ESciChartSurfaceType } & ISciChart2DDefinition>

    JSON-like object ISciChart2DDefinition

Protected getOptions

Protected getOtherSurfaces

getSeriesViewRectPadding

  • getSeriesViewRectPadding(scaled?: boolean): Thickness

getSurfaceRenderOrder

  • getSurfaceRenderOrder(): number
  • Gets or sets the drawing order for surfaces and their subsurfaces. This allows for a parent surface to draw over a subsurface. This does not affect the drawing order of separate surfaces - use z-index on the container div to control that.

    Returns number

getWasmId

  • getWasmId(): string
  • Returns wasm Id

    Returns string

getXAxisById

  • getXAxisById(axisId: string): AxisBase2D | undefined

getYAxisById

invalidateElement

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

    Parameters

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

    Returns void

nextStateRender

  • nextStateRender(options?: { invalidateOnResume?: boolean; resumeBefore?: boolean; suspendAfter?: boolean }): Promise<void>
  • 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<void>

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

onResize

  • onResize(width: number, height: number): void

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 {@link addSubChart}

    Parameters

    Returns void

resolveAutoColors

  • resolveAutoColors(): void
  • Calls resolveAutoColors on each series to resolve colors marked as auto based on the seriesColorPalette To configure which series this applies to, set a filter funtion on {@link ScichartSurface.autoColorFilter}

    Returns void

Protected resolveSurfaceOrders

resumeUpdates

  • resumeUpdates(options?: { force?: boolean; invalidateOnResume?: boolean }): void
  • inheritdoc

    Parameters

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

    Returns void

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

setSurfaceRenderOrder

  • setSurfaceRenderOrder(value: number): void
  • Gets or sets the drawing order for surfaces and their subsurfaces. This allows for a parent surface to draw over a subsurface. This does not affect the drawing order of separate surfaces - use z-index on the container div to control that.

    Parameters

    • value: number

    Returns void

setSvgClipPathDefinitions

  • setSvgClipPathDefinitions(svgElement: SVGSVGElement, seriesViewRect: Rect, surfaceViewRect: Rect): void
  • Adds or updates clipPath definitions on an SVG canvas

    Parameters

    • svgElement: SVGSVGElement
    • seriesViewRect: Rect
    • surfaceViewRect: Rect

    Returns void

setZoomState

  • Sets zoomStateProperty

    Parameters

    Returns void

suspendUpdates

  • suspendUpdates(): void

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 { type: ESciChartSurfaceType } & ISciChart2DDefinition

updateBackground

  • Used internally, updates background after switching between different SciChartSurfaces

    remarks

    INTERNAL USE. Check the SciChartSurface.background property for setting a background.

    Parameters

    Returns void

updateStackedCollectionAccumulatedVectors

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

    Returns void

updateWatermark

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

validateAndLink

  • validateAndLink(): string[]
  • Validates SciChartSurface and links RenderableSeries to axes

    Returns string[]

    List of errors if there are any

zoomExtents

  • zoomExtents(animationDurationMs?: number, easingFunction?: TEasingFn, onCompleted?: () => void, xAxisSelectorFn?: (t: IIncludable) => boolean, yAxisSelectorFn?: (t: IIncludable) => boolean): 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

    • Default value xAxisSelectorFn: (t: IIncludable) => boolean = () => true
    • Default value yAxisSelectorFn: (t: IIncludable) => boolean = () => true

    Returns void

zoomExtentsX

  • zoomExtentsX(animationDurationMs?: number, easingFunction?: TEasingFn, axisSelectorFn?: (t: IIncludable) => boolean): 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

    • Default value axisSelectorFn: (t: IIncludable) => boolean = () => true

    Returns void

zoomExtentsY

  • zoomExtentsY(animationDurationMs?: number, easingFunction?: TEasingFn, axisSelectorFn?: (t: IIncludable) => boolean): void
  • inheritdoc

    Parameters

    • Default value animationDurationMs: number = 0
    • Default value easingFunction: TEasingFn = easing.outExpo
    • Default value axisSelectorFn: (t: IIncludable) => boolean = () => true

    Returns void

Static UseCommunityLicense

  • UseCommunityLicense(): void

Static configure

  • Allows setting of web URL for Wasm files, in the case you are loading SciChart outside of npm/webpack environment. Note the version number of wasm Url 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({
     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 {@link addSubChart} to create many charts on one surface.

    Parameters

    Returns Promise<TWebAssemblyChart>

Static disposeSharedWasmContext

  • disposeSharedWasmContext(): void

Static isSubSurface

  • Parameters

    Returns surface is ISciChartSubSurface

Static loadWasmFromCDN

  • loadWasmFromCDN(): void
  • Tell SciChart to load the Wasm 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 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 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 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