Get font of Chart title.
FontSettings object
Set FillStyle of chart background.
// Example usage,
ChartXY.setBackgroundFillStyle(new SolidFill({ color: ColorRGBA( 80, 0, 0 ) }))
Related API:
Object itself
FillStyle
or function which mutates the active FillStyle
.
Set LineStyle of chart background border stroke.
// Example usage,
ChartXY.setBackgroundStrokeStyle(new SolidLine({
thickness: 2,
fillStyle: new SolidFill({ color: ColorRGBA( 0, 255, 0 ) })
}))
Related API:
Object itself
LineStyle
or function which mutates the active LineStyle
.
Set padding around Chart in pixels.
// Example 1, specify complete padding (four sides).
ChartXY.setPadding({ left: 16, right: 16, top: 32, bottom: 8 })
// Example 2, specify only single padding.
ChartXY.setPadding({ right: 64 })
Object itself for fluent interface
Number with pixel margins for all sides or datastructure with individual pixel paddings for each side. Any side can be omitted, only passed values will be overridden.
Set text displayed by charts built-in title component.
// Example, set title.
ChartXY.setTitle('Realtime traffic visualization')
**NOTE: To hide title, AND remove padding around it, ** use setTitleFillStyle(emptyFill)
Object itself for fluent interface.
Chart title as a string.
Set fill style of Chart Title.
Example usage:
// Create a new style
setTitleFillStyle(new SolidFill({ color: ColorHEX('#F00') }))
// Change transparency
setTitleFillStyle((solidFill) => solidFill.setA(80))
// Set hidden
setTitleFillStyle(emptyFill)
Chart itself
Either a FillStyle object or a function, which will be used to create a new FillStyle based on current value.
Set font of Chart Title.
Example usage:
// Create a new FontSettings
setTitleFont(new FontSettings({ size: 24, style: 'italic' }))
// Change existing settings
setTitleFont((fontSettings) => fontSettings.setWeight('bold'))
Chart itself
Either a FontSettings object or a function, which will be used to create a new FontSettings based on current value.
Specifies Margins after chart title. This can be used to account for extra space around the title as well as tweak its position.
This does not have an effect if title is hidden (empty FillStyle or text content ''
).
// Example 1, specify complete margin for Title (four sides).
ChartXY.setTitleMargin({ left: 16, right: 16, top: 32, bottom: 8 })
// Example 2, specify only single margin for Title.
ChartXY.setTitleMargin({ right: 64 })
// Example 3, specify margins for all sides with same value for Title.
ChartXY.setTitleMargin(40)
// Example 4, reset to default margins.
ChartXY.setTitleMargin({})
Chart itself for fluent interface
Gap after the chart title in pixels.
Interface that defines end user API for a 'Chart'.