Abstract
Readonly
axisAxis that CustomTick belongs to.
Readonly
axisReadonly
renderingPermanently 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 whether CustomTick
should allocate space on its Axis
.
By default, this is true
, which means that Axis
will always make sure it is big enough to fit the tick.
By setting to false
, this particular CustomTick
can be removed from this behaviour, which can be useful in applications
where some custom ticks are only enabled temporarily. Disabling this functionality can prevent the size of the Axis from changing in unwanted ways.
Boolean flag.
Get custom ticks TickMarker (label, tick, possible background).
TickMarker object
Unsubscribe from value change event.
This event is called whenever the position of the CustomTick is changed via CustomTick.setValue.
True if unsubscription was successful.
Token that was received when the subscription was created.
Subscribe onDispose
event.
This event is triggered whenever the Control (Dashboards and all chart types) is disposed.
// Example usage
Chart.onDispose(() => {
console.log('chert was disposed')
})
Chart.dispose()
Token of subscription
Handler function for event
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
Subscribe to value change event. This event is triggered when setValue is called.
Example usage:
// Set onValueChange event
CustomTick.onValueChange((num) => {
console.log(num)
})
// Set customTick value
CustomTick.setValue(20)
Token that can be used to unsubscribe from the event.
Function that is called when event is triggered.
Register new event listener to visibleStateChanged
event.
Event listener for visibleStateChanged
Set whether CustomTick
should allocate space on its Axis
.
By default, this is true
, which means that Axis
will always make sure it is big enough to fit the tick.
By setting to false
, this particular CustomTick
can be removed from this behaviour, which can be useful in applications
where some custom ticks are only enabled temporarily. Disabling this functionality can prevent the size of the Axis from changing in unwanted ways.
// Example syntax, disable custom tick space allocation.
CustomTick.setAllocatesAxisSpace(false)
Object itself for fluent interface.
Boolean flag.
Set length of grid stroke in percents
This for fluent interface
Grid line length as a % of viewport size
This for fluent interface
Grid stroke style
Configure custom ticks TickMarker (label, tick, possible background) via a callback function.
Example usage:
CustomTick.setMarker((tickMarker) => tickMarker
// Style TickMarker.
.setTextFillStyle(new SolidFill({ color: ColorRGBA( 255, 0, 0 ) }))
.setFont((font) => font.setStyle( 'italic' ))
)
See TickMarker for available customization API.
Styling specific TickMarkers:
When a custom tick is created, a tick marker builder can be specified. This specifies the shape, and general visual look of the custom tick, and can also expose a larger set of customization API for the tick marker. To use the specific API, it is required to cast the tick marker object to the correct type (TypeScript users only):
const customTick = Axis.addCustomTick(UIElementBuilders.PointableTextBox)
customTick.setMarker((tickMarker: UIPointableTextBox) => tickMarker
// ^ Above type cast is necessary to access full configuration API of UIPointableTextBox
// Style TickMarker background fill color.
.setBackground((background) => background
.setFillStyle(new SolidFill({ color: ColorRGBA(255, 0, 0, 100) }))
)
)
For reference,
UIElementBuilders.AxisTickMajor
will support API as described by UITickUIElementBuilders.PointableTextBox
will support API as described by UIPointableTextBoxSet marker visible or not.
Object itself
Marker visible?
Set mouse interactions enabled or disabled
Object itself for fluent interface
Specifies state of mouse interactions
Set text of CustomTicks' Marker with a formatting function.
Example usage:
// Marker shows formatted position of CustomTick on its Axis
CustomTick.setTextFormatter((position, customTick) => customTick.axis.formatValue(position))
// Marker shows 'Hello world'
CustomTick.setTextFormatter((position, customTick) => 'Hello world')
Object itself
A function of type: CustomTickTextFormatter, that defines text of CustomTicks' Marker.
Set pixel padding between tick line and label.
Set rotation of tick label.
Object itself
Rotation in degrees
Set tick length as pixels.
Object itself for fluent interface.
Tick length as pixels.
Sets the position of this custom tick on its Axis
This for fluid interface
Overrides text of CustomTicks Marker with formated value.
Value in the units of main scale
Set element visibility.
Object itself.
true
when element should be visible and false
when element should be hidden.
Class that represents a single Axis tick that can be managed by the user.
Custom ticks are created with addCustomTick.
Frequently used methods:
Styling CustomTicks:
Tick gridline can be styled with setGridStrokeStyle
TickMarker (label, tick, possible background) are styled via setMarker as a callback function, like this:
See TickMarker for available customization API.
Styling specific TickMarkers:
When a custom tick is created, a tick marker builder can be specified. This specifies the shape, and general visual look of the custom tick, and can also expose a larger set of customization API for the tick marker. To use the specific API, it is required to cast the tick marker object to the correct type (TypeScript users only):
For reference,
UIElementBuilders.AxisTickMajor
orUIElementBuilders.AxisTickMinor
will support API as described by UITickUIElementBuilders.PointableTextBox
will support API as described by UIPointableTextBox