Pixel location of UiElements origin. To get position use getPosition(relativePosition).
Coordinate system = position scale (UIElement.scale)
Readonly
renderingReadonly
scalePermanently destroy the component.
To fully allow Garbage-Collection to free the resources used by the component, make sure to remove any references to the component and its children in application code.
let chart = ...ChartXY()
let axisX = chart.getDefaultAxisX()
// Dispose Chart, and remove all references so that they can be garbage-collected.
chart.dispose()
chart = undefined
axisX = undefined
Object itself for fluent interface
Get auto dispose behavior for this UI element.
Auto dispose mode.
Get dragging mode of object. Defines how the object can be dragged by mouse.
Object itself
Get theme effect enabled on component or disabled.
A theme can specify an Effect to add extra visual oomph to chart applications, like Glow effects around data or other components.
Whether this effect is drawn above a particular component can be configured using the setEffect
method.
// Example, disable theme effect from a particular component.
Component.setEffect(false)
For the most part, theme effects are enabled by default on most components.
Theme effect is configured with effect property.
Boolean that describes whether drawing the theme effect is enabled around the component or not.
Get mouse style.
Interface for defining how mouse should look when hovering over UI object
Returns the position of this UiElement at given location relative to elements size.
Object itself for fluent itself
Relative position vector (-1 to 1 which specifies position of origin, 0 is center of the object)
Parameter to disregard parts of object when calculating the asked position. Defaults to Margin, which includes everything. Should only ever be necessary for other UiElements
Returns the size of the UiElements in pixels including any Margins or Paddings
Object size in pixels
Parameter to disregard parts of object when calculating the position. Defaults to Margin, which includes everything. Should only ever be necessary for sub-classes
Subscribe onDispose
event.
This event is triggered whenever the ChartComponent is disposed.
// Example usage
figure.onDispose(() => {
console.log('figure was disposed')
})
figure.dispose()
Token of subscription
Event handler function
Subscribe to highlight object event. This is called whenever an object is highlighted.
Token that can be used to unsubscribe from the event.
Function that is called when event is triggered.
Subscribe to Mouse Click event
Token-object that is a reference ID to the listener created.
Function that will be called when mouse clicks the bounds of UiObject.
Subscribe to Mouse Double Click event
Subscribe to Mouse Down event
Subscribe to Mouse Drag event
Subscribe to Mouse Drag Start event
Subscribe to Mouse Drag Stop event
Subscribe to Mouse Enter event
Token-object that is a reference ID to the listener created.
Function that will be called when mouse enters the bounds of UiObject.
Subscribe to Mouse Leave event
Token-object that is a reference ID to the listener created.
Function that will be called when mouse leaves the bounds of UiObject.
Subscribe to Mouse Move event
Token of subscription
Event handler function
Subscribe to Mouse Up event
Subscribe to Mouse Wheel event
Token of subscription
Event handler function
Subscribe to Touch End event
Token of subscription
Event handler function
Subscribe to Touch Move event
Token of subscription
Event handler function
Subscribe to Touch Start event
Token of subscription
Event handler function
Register new event listener to visibleStateChanged
event.
Event listener for visibleStateChanged
Set auto dispose behavior for this UI element.
Can be used to set a condition, where the UI element is automatically disposed, removing it from view.
// Example, remove UI element when it is larger than 20% of viewport.
UIElement.setAutoDispose({
type: 'max-width',
maxWidth: 0.20,
})
Object itself for fluent interface.
Auto dispose mode.
Set dragging mode of object. Defines how the object can be dragged by mouse.
See UIDraggingModescollection for options.
Object itself
DraggingMode or undefined to disable dragging
Set theme effect enabled on component or disabled.
A theme can specify an Effect to add extra visual oomph to chart applications, like Glow effects around data or other components.
Whether this effect is drawn above a particular component can be configured using the setEffect
method.
// Example, disable theme effect from a particular component.
Component.setEffect(false)
For the most part, theme effects are enabled by default on most components.
Theme effect is configured with effect property.
Object itself.
Theme effect enabled
Set fill style object
Object itself for fluent interface
Set state of component highlighting.
// Example usage
component.setHighlight(true)
component.setHighlight(0.5)
Object itself
Boolean or number between 0 and 1, where 1 is fully highlighted.
Set margin around object in pixels.
Object itself
Number with pixel margins for all sides or datastructure with individual pixel margins for each side. Any side can be omitted, only passed values will be overridden.
Set mouse interactions enabled or disabled
Object itself for fluent interface
Specifies state of mouse interactions
Set mouse style when hovering over UI object.
Object itself
Interface for defining how mouse should look when hovering over UI object
Sets the position origin of this UiElement. Affects how the "position" of UIElement is interpreted.
See UIOrigins for a collection of common arguments in an easy-to-read format.
Object itself
Sets the position of this UiElement relative to its origin.
NOTE: UIElements scale can't be changed apart from when it is created.
Object itself
Location on the UIElements scale, where its origin should be positioned
Set stroke style object
Object itself for fluent interface
Set stroke thickness in pixels
Icon itself for fluent interface
Set element visibility.
Object itself.
true
when element should be visible and false
when element should be hidden.
Empty background.
Indicates that the Background can't and shouldn't be styled as it won't be rendered.