Chartjs.Types
- Package
- purescript-chartjs
- Repository
- philippedev101/purescript-chartjs
PureScript types, enums, and default constructors for Chart.js configuration.
#ChartType Source
data ChartTypeSupported Chart.js chart types. The 8 named constructors cover all
built-in types; CustomType is an escape hatch for chart types
registered at runtime via Chart.register(MyController), where
MyController is a controller class (not a plugin) that defines a
new id such as "financial", "candlestick", or a custom
doughnut variant. The wrapped string in CustomType must match the
controller's id field so Chart.js can look it up at draw time.
Pairs naturally with roadmap item #25's registration FFI bindings,
but useful standalone for any consumer who has registered a
controller via raw JS.
Constructors
Instances
#chartTypeToString Source
chartTypeToString :: ChartType -> StringConvert to the Chart.js string representation. CustomType passes
the wrapped string through unchanged — Chart.js looks up the
corresponding registered controller at runtime.
#positionToString Source
positionToString :: Position -> StringConvert to the Chart.js string representation.
#textAlignToString Source
textAlignToString :: TextAlign -> StringConvert to the Chart.js string representation.
#axisToString Source
axisToString :: Axis -> StringConvert to the Chart.js string representation.
#PointStyle Source
data PointStylePoint marker styles. PSFalse disables the marker. PSImage wraps an
HTMLImageElement or HTMLCanvasElement for image-based point styles —
the referenced element's natural width / height determine the drawn
size at render time (the pointRadius field does not apply).
Image point styles cannot be JSON-serialized and go through the overlay
mechanism in Chartjs.Colors / Chartjs.Callbacks — you must create the
chart via createChartWithCallbacks (or anything that builds overlays)
for a PSImage dataset pointStyle to render. Ensure the wrapped image
has finished loading before the chart is created; Chart.js reads
width/height at draw time and draws nothing if they are zero.
Note: PSImage is currently supported only on Dataset.pointStyle.
Setting it on options-level fields (legend, element defaults) silently
produces a null in the JSON config with no overlay replacement.
Constructors
PSCirclePSCrossPSCrossRotPSDashPSLinePSRectPSRectRoundedPSRectRotPSStarPSTrianglePSFalsePSImage Foreign
Instances
#pointStyleToString Source
pointStyleToString :: PointStyle -> StringConvert to the Chart.js string representation. Returns "" for
PSImage, which has no string form — use pointStyleToJson and the
overlay path for serialization.
#BorderSkipped Source
data BorderSkippedWhich border to skip on bar elements. BSFalse draws all borders.
Constructors
Instances
#borderSkippedToString Source
borderSkippedToString :: BorderSkipped -> StringConvert to the Chart.js string representation.
#BorderAlign Source
#borderAlignToString Source
borderAlignToString :: BorderAlign -> StringConvert to the Chart.js string representation.
#capStyleToString Source
capStyleToString :: CapStyle -> StringConvert to the Chart.js string representation.
#joinStyleToString Source
joinStyleToString :: JoinStyle -> StringConvert to the Chart.js string representation.
#CubicInterpolationMode Source
#cubicInterpolationModeToString Source
cubicInterpolationModeToString :: CubicInterpolationMode -> StringConvert to the Chart.js string representation.
#InteractionMode Source
#interactionModeToString Source
interactionModeToString :: InteractionMode -> StringConvert to the Chart.js string representation.
#scaleTypeToString Source
scaleTypeToString :: ScaleType -> StringConvert to the Chart.js string representation.
#timeUnitToString Source
timeUnitToString :: TimeUnit -> StringConvert to the Chart.js string representation.
#Easing Source
data EasingAnimation easing functions.
Constructors
EaseLinearEaseInQuadEaseOutQuadEaseInOutQuadEaseInCubicEaseOutCubicEaseInOutCubicEaseInQuartEaseOutQuartEaseInOutQuartEaseInQuintEaseOutQuintEaseInOutQuintEaseInSineEaseOutSineEaseInOutSineEaseInExpoEaseOutExpoEaseInOutExpoEaseInCircEaseOutCircEaseInOutCircEaseInElasticEaseOutElasticEaseInOutElasticEaseInBackEaseOutBackEaseInOutBackEaseInBounceEaseOutBounceEaseInOutBounce
Instances
#easingToString Source
easingToString :: Easing -> StringConvert to the Chart.js string representation.
#DecimationAlgorithm Source
#decimationAlgorithmToString Source
decimationAlgorithmToString :: DecimationAlgorithm -> StringConvert to the Chart.js string representation.
#DrawTime Source
#drawTimeToString Source
drawTimeToString :: DrawTime -> StringConvert to the Chart.js string representation.
#AnimationSetting Source
#ScaleDisplay Source
#ScaleMinMax Source
data ScaleMinMaxScale min / max / suggestedMin / suggestedMax value. Numeric
for linear/logarithmic/radial scales, string for category scales
(matches a label) and time scales (an ISO date or any string the
configured time adapter parses). Chart.js's CategoryScaleOptions
and TimeScaleOptions both type these as string | number; the
base CoreScaleOptions types them as unknown (fully untyped).
Constructors
Instances
#ScriptableContext Source
type ScriptableContext = { active :: Boolean, chart :: Foreign, dataIndex :: Int, dataset :: Foreign, datasetIndex :: Int, mode :: String, parsed :: Foreign, raw :: Foreign, type :: String }Context passed by Chart.js to scriptable option functions at
resolution time. Mirrors Chart.js's ScriptableContext<TType>
interface. chart, dataset, parsed, and raw are left as
Foreign because their shape varies by chart type and parsing
config — consumers inspect them via Foreign operations.
#ScriptableTooltipContext Source
type ScriptableTooltipContext = { chart :: Foreign, tooltip :: Foreign, tooltipItems :: Array Foreign }Context passed by Chart.js to scriptable tooltip option functions.
Mirrors Chart.js's ScriptableTooltipContext<TType>. Different
from dataset-level ScriptableContext — has tooltip and
tooltipItems instead of dataIndex, dataset, etc. Both
tooltip and tooltipItems are left as Foreign because their
shape is complex (the full TooltipModel / TooltipItem types).
#ScriptableScaleContext Source
type ScriptableScaleContext = { chart :: Foreign, index :: Int, scale :: Foreign, tick :: Foreign }Context passed by Chart.js to scriptable scale/tick/grid option
functions. Mirrors Chart.js's ScriptableScaleContext. Different
from dataset-level ScriptableContext — has scale and tick
fields instead of dataset, parsed, etc. chart and scale
are left as Foreign because their shape is complex; tick is
also Foreign (wraps { value :: Number, label? :: String |
String[], major? :: Boolean }) — consumers inspect via Foreign
operations. Note: the Scriptable / ScriptableIndexable ADTs
are parameterised on ScriptableContext in the type, but at
runtime Chart.js passes this context shape for scale options.
#ScriptableScalePointLabelContext Source
type ScriptableScalePointLabelContext = { chart :: Foreign, index :: Int, label :: Foreign, scale :: Foreign }Context passed by Chart.js to scriptable point-label option
functions on radial scales. Mirrors Chart.js's
ScriptableScalePointLabelContext. Has label (the point label
string) instead of tick.
#Scriptable Source
data Scriptable aA value that Chart.js accepts as either a static value or a
function computed from the resolution context. Chart.js calls
Scriptable functions once per affected element at draw time
to pick the concrete value. Use SVal for static values and
SFn (or the scriptableFn smart constructor) for dynamic ones.
SFn-wrapped functions travel through the overlay path: they
cannot be JSON-serialized, so the chart must be created via
createChartWithCallbacks or createChartAuto for the dynamic
form to take effect. SVal-only configurations serialize as
plain JSON and work with the base createChart path.
Constructors
SVal aSFn (ScriptableContext -> a)
Instances
(Eq a) => Eq (Scriptable a)(Show a) => Show (Scriptable a)
#ScriptableIndexable Source
data ScriptableIndexable aChart.js's ScriptableAndArray<T, TContext> — a value that can be
a single value, a per-item array, or a scriptable function. Note
that Chart.js does not allow function entries inside the
array form, so this is a flat ADT rather than
Indexable (Scriptable a).
Like Scriptable, the SIFn form cannot be JSON-serialized and
travels through the overlay path — the chart must be created via
createChartAuto (or createChartWithCallbacks) for an SIFn
value to take effect. SIVal / SIArray serialize as plain JSON
and work with the base createChart path.
Constructors
SIVal aSIArray (Array a)SIFn (ScriptableContext -> a)
Instances
(Eq a) => Eq (ScriptableIndexable a)(Show a) => Show (ScriptableIndexable a)
#scriptableValue Source
scriptableValue :: forall a. a -> Maybe (Scriptable a)Wrap a static value as a Scriptable field value (Just (SVal a)).
Mirrors the single / perItem convention — returns Maybe so the
result can be dropped directly into a Maybe (Scriptable a) record
field without a manual Just. For pattern matching use the raw
SVal constructor instead.
#scriptableFn Source
scriptableFn :: forall a. (ScriptableContext -> a) -> Maybe (Scriptable a)Wrap a ScriptableContext -> a function as a Scriptable field value
(Just (SFn f)). Returns Maybe for record-literal ergonomics.
#siValue Source
siValue :: forall a. a -> Maybe (ScriptableIndexable a)ScriptableIndexable field value wrapping a single static value
(Just (SIVal a)). Returns Maybe for record-literal ergonomics.
#siArray Source
siArray :: forall a. Array a -> Maybe (ScriptableIndexable a)ScriptableIndexable field value wrapping a per-item array
(Just (SIArray xs)). Returns Maybe for record-literal ergonomics.
#siFn Source
siFn :: forall a. (ScriptableContext -> a) -> Maybe (ScriptableIndexable a)ScriptableIndexable field value wrapping a ScriptableContext -> a
function (Just (SIFn f)). Returns Maybe for record-literal ergonomics.
#SpanGaps Source
#Clip Source
data Clipclip accepts number, per-side object, or false.
Constructors
ClipUniform NumberClipPerSide { bottom :: Number, left :: Number, right :: Number, top :: Number }ClipDisabled
Instances
#Stacked Source
data Stackedstacked accepts boolean or "single" (stacks positive+negative together).
Constructors
Instances
#BarThickness Source
#IsoWeekday Source
#BarBorderWidth Source
data BarBorderWidthBar chart borderWidth as uniform number or per-side object.
Constructors
BarBorderWidthUniform NumberBarBorderWidthPerSide { bottom :: Maybe Number, left :: Maybe Number, right :: Maybe Number, top :: Maybe Number }
Instances
#BarBorderRadius Source
data BarBorderRadiusBar chart borderRadius as uniform number or per-corner object.
Constructors
BarBorderRadiusUniform NumberBarBorderRadiusPerCorner { bottomLeft :: Number, bottomRight :: Number, topLeft :: Number, topRight :: Number }
Instances
#ArcBorderRadius Source
data ArcBorderRadiusArc borderRadius as uniform number or per-corner object.
Constructors
ArcBorderRadiusUniform NumberArcBorderRadiusPerCorner { innerEnd :: Number, innerStart :: Number, outerEnd :: Number, outerStart :: Number }
Instances
#InflateAmount Source
data InflateAmountBar inflate amount: a pixel count or 'auto' (0.33px when bars
are tightly packed, 0 otherwise). Chart.js default is 'auto'.
Constructors
Instances
#PointLabelDisplay Source
data PointLabelDisplayPoint label display mode: boolean or 'auto' (show labels only
when associated data is visible). Chart.js default is true.
Constructors
Instances
#Color Source
data ColorA color value that Chart.js accepts: CSS string, gradient, or pattern.
Constructors
Instances
#CanvasGradient Source
data CanvasGradientOpaque type for a CanvasGradient object (from canvas 2D context).
#CanvasPattern Source
data CanvasPatternOpaque type for a CanvasPattern object (from canvas 2D context).
#psImage Source
psImage :: HTMLImageElement -> PointStyleConvenience constructor for PSImage from a typed HTMLImageElement.
Equivalent to PSImage (unsafeToForeign img). For HTMLCanvasElement
or other CanvasImageSource values, use PSImage directly with
unsafeToForeign.
The referenced image must be fully loaded before the chart is created —
Chart.js reads width/height at draw time and draws nothing if they
are zero. Route the config through createChartWithCallbacks so the
overlay merge can substitute the live reference into the config.
#FontWeight Source
data FontWeightCSS font-weight value. Mirrors Chart.js's FontSpec.weight which
accepts specific keyword strings or a numeric weight (100–900).
Constructors
Instances
#LineHeight Source
data LineHeightCSS line-height value. Mirrors Chart.js's FontSpec.lineHeight which
accepts a unitless number or any CSS string (e.g. "1.5em", "150%").
Constructors
Instances
#DatasetCommonRow Source
type DatasetCommonRow :: Row Type -> Row Typetype DatasetCommonRow r = (angle :: Maybe Number, animation :: Maybe AnimationSetting, animations :: Maybe AnimationsConfig, backgroundColor :: Maybe (ScriptableIndexable Color), barPercentage :: Maybe Number, barThickness :: Maybe BarThickness, base :: Maybe (ScriptableIndexable Number), borderAlign :: Maybe (ScriptableIndexable BorderAlign), borderCapStyle :: Maybe (Scriptable CapStyle), borderColor :: Maybe (ScriptableIndexable Color), borderDash :: Maybe (Scriptable (Array Number)), borderDashOffset :: Maybe (Scriptable Number), borderJoinStyle :: Maybe (ScriptableIndexable JoinStyle), borderRadius :: Maybe (ScriptableIndexable BarBorderRadius), borderSkipped :: Maybe (ScriptableIndexable BorderSkipped), borderWidth :: Maybe (ScriptableIndexable BarBorderWidth), categoryPercentage :: Maybe Number, chartType :: Maybe ChartType, circular :: Maybe (ScriptableIndexable Boolean), circumference :: Maybe Number, clip :: Maybe Clip, cubicInterpolationMode :: Maybe (Scriptable CubicInterpolationMode), datalabels :: Maybe Foreign, drawActiveElementsOnTop :: Maybe (ScriptableIndexable Boolean), fill :: Maybe (Scriptable Fill), grouped :: Maybe Boolean, hidden :: Maybe Boolean, hitRadius :: Maybe (ScriptableIndexable Number), hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderCapStyle :: Maybe (Scriptable CapStyle), hoverBorderColor :: Maybe (ScriptableIndexable Color), hoverBorderDash :: Maybe (Scriptable (Array Number)), hoverBorderDashOffset :: Maybe (Scriptable Number), hoverBorderJoinStyle :: Maybe (ScriptableIndexable JoinStyle), hoverBorderRadius :: Maybe (ScriptableIndexable BarBorderRadius), hoverBorderWidth :: Maybe (ScriptableIndexable Number), hoverOffset :: Maybe (ScriptableIndexable Number), hoverRadius :: Maybe (ScriptableIndexable Number), indexAxis :: Maybe Axis, inflateAmount :: Maybe (ScriptableIndexable InflateAmount), maxBarThickness :: Maybe Number, minBarLength :: Maybe Number, offset :: Maybe (ScriptableIndexable Number), order :: Maybe Int, parsing :: Maybe ParsingConfig, pointBackgroundColor :: Maybe (ScriptableIndexable Color), pointBorderColor :: Maybe (ScriptableIndexable Color), pointBorderWidth :: Maybe (ScriptableIndexable Number), pointHitRadius :: Maybe (ScriptableIndexable Number), pointHoverBackgroundColor :: Maybe (ScriptableIndexable Color), pointHoverBorderColor :: Maybe (ScriptableIndexable Color), pointHoverBorderWidth :: Maybe (ScriptableIndexable Number), pointHoverRadius :: Maybe (ScriptableIndexable Number), pointRadius :: Maybe (ScriptableIndexable Number), pointRotation :: Maybe (ScriptableIndexable Number), pointStyle :: Maybe (ScriptableIndexable PointStyle), radius :: Maybe (ScriptableIndexable Number), rotation :: Maybe (ScriptableIndexable Number), segment :: Maybe Foreign, showLine :: Maybe Boolean, skipNull :: Maybe Boolean, spacing :: Maybe Number, spanGaps :: Maybe SpanGaps, stack :: Maybe String, stepped :: Maybe Stepped, tension :: Maybe Number, transitions :: Maybe TransitionsConfig, weight :: Maybe Number, xAxisID :: Maybe String, yAxisID :: Maybe String | r)
Row of dataset configuration fields shared between instances (Dataset)
and per-type defaults (DatasetDefaults). Parameterised by r so the row
can be extended with identity fields (label/data) to form Dataset, or
closed (with ()) to form DatasetDefaults.
#Dataset Source
type Dataset = { data :: Array DataPoint, label :: String | DatasetCommonRow () }Unified dataset configuration covering all Chart.js chart types.
#DatasetDefaults Source
type DatasetDefaults = Record (DatasetCommonRow ())Dataset defaults — same shape as Dataset minus the identity fields
(label, data). Used as the value type of per-chart-type entries in
DatasetsDefaults (options.datasets.line, options.datasets.bar, ...).
#DatasetsDefaults Source
type DatasetsDefaults = { bar :: Maybe DatasetDefaults, bubble :: Maybe DatasetDefaults, doughnut :: Maybe DatasetDefaults, line :: Maybe DatasetDefaults, pie :: Maybe DatasetDefaults, polarArea :: Maybe DatasetDefaults, radar :: Maybe DatasetDefaults, scatter :: Maybe DatasetDefaults }Per-chart-type dataset defaults (options.datasets in Chart.js). Each
entry supplies default field values for datasets of that chart type.
#TicksConfig Source
type TicksConfig = { align :: Maybe TextAlign, autoSkip :: Maybe Boolean, autoSkipPadding :: Maybe Number, backdropColor :: Maybe (Scriptable Color), backdropPadding :: Maybe Padding, color :: Maybe (ScriptableIndexable Color), count :: Maybe Int, crossAlign :: Maybe String, display :: Maybe Boolean, font :: Maybe (Scriptable Font), format :: Maybe Foreign, includeBounds :: Maybe Boolean, labelOffset :: Maybe Number, major :: Maybe { enabled :: Maybe Boolean }, maxRotation :: Maybe Number, maxTicksLimit :: Maybe Int, minRotation :: Maybe Number, mirror :: Maybe Boolean, padding :: Maybe Number, precision :: Maybe Number, sampleSize :: Maybe Int, showLabelBackdrop :: Maybe (Scriptable Boolean), source :: Maybe String, stepSize :: Maybe Number, textStrokeColor :: Maybe (Scriptable Color), textStrokeWidth :: Maybe (Scriptable Number), z :: Maybe Number }Scale tick mark configuration.
#GridConfig Source
type GridConfig = { circular :: Maybe Boolean, color :: Maybe (ScriptableIndexable Color), display :: Maybe Boolean, drawOnChartArea :: Maybe Boolean, drawTicks :: Maybe Boolean, lineWidth :: Maybe (ScriptableIndexable Number), offset :: Maybe Boolean, tickBorderDash :: Maybe (Scriptable (Array Number)), tickBorderDashOffset :: Maybe (Scriptable Number), tickColor :: Maybe (ScriptableIndexable Color), tickLength :: Maybe Number, tickWidth :: Maybe Number, z :: Maybe Number }Scale grid line configuration.
#36: color, lineWidth, tickColor are now ScriptableIndexable;
tickBorderDash, tickBorderDashOffset are now Scriptable.
#AngleLinesConfig Source
type AngleLinesConfig = { borderDash :: Maybe (Scriptable (Array Number)), borderDashOffset :: Maybe (Scriptable Number), color :: Maybe (Scriptable Color), display :: Maybe Boolean, lineWidth :: Maybe (Scriptable Number) }Radial scale angle line configuration. #40: color, lineWidth, borderDash, borderDashOffset now Scriptable.
#PointLabelsConfig Source
type PointLabelsConfig = { backdropColor :: Maybe (Scriptable Color), backdropPadding :: Maybe Number, borderRadius :: Maybe (Scriptable Number), centerPointLabels :: Maybe Boolean, color :: Maybe (Scriptable Color), display :: Maybe PointLabelDisplay, font :: Maybe (Scriptable Font), padding :: Maybe Number }Radial scale point label configuration. #41: color, backdropColor, borderRadius now Scriptable; font Scriptable (#44). #45: display accepts PointLabelDisplay (boolean or 'auto').
#ScaleConfig Source
type ScaleConfig = { adapters :: Maybe { date :: Maybe Foreign }, alignToPixels :: Maybe Boolean, angleLines :: Maybe AngleLinesConfig, animate :: Maybe Boolean, axis :: Maybe String, backgroundColor :: Maybe Color, beginAtZero :: Maybe Boolean, border :: Maybe ScaleBorderConfig, bounds :: Maybe String, clip :: Maybe Boolean, display :: Maybe ScaleDisplay, grace :: Maybe String, grid :: Maybe GridConfig, max :: Maybe ScaleMinMax, min :: Maybe ScaleMinMax, offset :: Maybe Boolean, pointLabels :: Maybe PointLabelsConfig, position :: Maybe Position, reverse :: Maybe Boolean, stack :: Maybe String, stackWeight :: Maybe Number, stacked :: Maybe Stacked, startAngle :: Maybe Number, suggestedMax :: Maybe ScaleMinMax, suggestedMin :: Maybe ScaleMinMax, ticks :: Maybe TicksConfig, time :: Maybe TimeConfig, title :: Maybe ScaleTitleConfig, type :: Maybe ScaleType, weight :: Maybe Number }Full scale axis configuration.
#LegendLabelsConfig Source
type LegendLabelsConfig = { borderRadius :: Maybe Number, boxHeight :: Maybe Number, boxWidth :: Maybe Number, color :: Maybe Color, font :: Maybe (Scriptable Font), padding :: Maybe Number, pointStyle :: Maybe PointStyle, pointStyleWidth :: Maybe Number, textAlign :: Maybe TextAlign, useBorderRadius :: Maybe Boolean, usePointStyle :: Maybe Boolean }Legend label appearance configuration.
#LegendConfig Source
type LegendConfig = { align :: Maybe TextAlign, display :: Maybe Boolean, fullSize :: Maybe Boolean, labels :: Maybe LegendLabelsConfig, maxHeight :: Maybe Number, maxWidth :: Maybe Number, position :: Maybe Position, reverse :: Maybe Boolean, rtl :: Maybe Boolean, textDirection :: Maybe String, title :: Maybe LegendTitleConfig }Chart legend plugin configuration.
#TooltipConfig Source
type TooltipConfig = { backgroundColor :: Maybe (Scriptable Color), bodyAlign :: Maybe (Scriptable TextAlign), bodyColor :: Maybe (Scriptable Color), bodyFont :: Maybe (Scriptable Font), bodySpacing :: Maybe (Scriptable Number), borderColor :: Maybe (Scriptable Color), borderWidth :: Maybe (Scriptable Number), boxHeight :: Maybe (Scriptable Number), boxPadding :: Maybe Number, boxWidth :: Maybe (Scriptable Number), caretPadding :: Maybe (Scriptable Number), caretSize :: Maybe (Scriptable Number), cornerRadius :: Maybe (Scriptable Number), displayColors :: Maybe (Scriptable Boolean), enabled :: Maybe (Scriptable Boolean), footerAlign :: Maybe (Scriptable TextAlign), footerColor :: Maybe (Scriptable Color), footerFont :: Maybe (Scriptable Font), footerMarginTop :: Maybe (Scriptable Number), footerSpacing :: Maybe (Scriptable Number), intersect :: Maybe Boolean, mode :: Maybe InteractionMode, multiKeyBackground :: Maybe (Scriptable Color), padding :: Maybe (Scriptable Padding), position :: Maybe (Scriptable String), rtl :: Maybe (Scriptable Boolean), textDirection :: Maybe (Scriptable String), titleAlign :: Maybe (Scriptable TextAlign), titleColor :: Maybe (Scriptable Color), titleFont :: Maybe (Scriptable Font), titleMarginBottom :: Maybe (Scriptable Number), titleSpacing :: Maybe (Scriptable Number), usePointStyle :: Maybe (Scriptable Boolean), xAlign :: Maybe (Scriptable String), yAlign :: Maybe (Scriptable String) }Tooltip plugin configuration (#35: all fields except mode,
intersect, and boxPadding are Scriptable<T, ScriptableTooltipContext>
in Chart.js TS). Color fields widened from String to Color so
consumers can use gradients or patterns as tooltip colors.
#DecimationConfig Source
type DecimationConfig = { algorithm :: Maybe DecimationAlgorithm, enabled :: Maybe Boolean, samples :: Maybe Number, threshold :: Maybe Number }Data decimation plugin configuration.
#FillerConfig Source
type FillerConfig = { drawTime :: Maybe DrawTime, propagate :: Maybe Boolean }Filler plugin configuration for area fills.
#ColorsPluginOptions Source
type ColorsPluginOptions = { enabled :: Maybe Boolean, forceOverride :: Maybe Boolean }Built-in colors plugin options. When enabled (default true), the
plugin auto-assigns colors to datasets from a built-in palette. Set
forceOverride to true to override any user-set colors.
#PluginsConfig Source
type PluginsConfig = { colors :: Maybe ColorsPluginOptions, datalabels :: Maybe Foreign, decimation :: Maybe DecimationConfig, filler :: Maybe FillerConfig, legend :: Maybe LegendConfig, subtitle :: Maybe TitleConfig, title :: Maybe TitleConfig, tooltip :: Maybe TooltipConfig }Top-level plugin configuration.
#AnimationConfig Source
type AnimationConfig = { animateRotate :: Maybe Boolean, animateScale :: Maybe Boolean, delay :: Maybe Number, duration :: Maybe Number, easing :: Maybe Easing, from :: Maybe AnimationValue, loop :: Maybe Boolean, properties :: Maybe (Array String), to :: Maybe AnimationValue, type :: Maybe AnimationType }Animation timing and easing configuration (tier 1).
#AnimationType Source
#animationTypeToString Source
animationTypeToString :: AnimationType -> StringConvert to the Chart.js string representation.
#AnimationValue Source
#AnimationPropertySetting Source
data AnimationPropertySettingA per-property animation entry: enabled with config, or disabled (false).
Constructors
Instances
#AnimationPropertyConfig Source
type AnimationPropertyConfig = { delay :: Maybe Number, duration :: Maybe Number, easing :: Maybe Easing, from :: Maybe AnimationValue, loop :: Maybe Boolean, properties :: Maybe (Array String), to :: Maybe AnimationValue, type :: Maybe AnimationType }Per-property animation config (used in tier 2 options.animations).
#AnimationsConfig Source
type AnimationsConfig = Object AnimationPropertySettingPer-property animation configuration (tier 2). Keys are property names or group names (e.g., "colors", "numbers", "x", "tension").
#TransitionConfig Source
type TransitionConfig = { animation :: Maybe AnimationSetting, animations :: Maybe AnimationsConfig }Animation overrides for a specific update mode (tier 3). The
animation field is Maybe AnimationSetting (not AnimationConfig)
so consumers can pass Just AnimationDisabled to fully disable a
per-mode animation — the canonical Chart.js idiom for "instant
hover transitions" or "no-animation resize."
#TransitionsConfig Source
type TransitionsConfig = Object TransitionConfigPer-mode transition overrides (tier 3). Keys are mode names: "active", "hide", "show", "reset", "resize", or custom.
#defaultAnimationPropertyConfig Source
defaultAnimationPropertyConfig :: AnimationPropertyConfigAll optional fields set to Nothing.
#defaultTransitionConfig Source
defaultTransitionConfig :: TransitionConfigAll optional fields set to Nothing.
#InteractionConfig Source
type InteractionConfig = { axis :: Maybe String, includeInvisible :: Maybe Boolean, intersect :: Maybe Boolean, mode :: Maybe InteractionMode }Hover and tooltip interaction configuration.
#InteractionOptions Source
type InteractionOptions = { axis :: Maybe String, includeInvisible :: Maybe Boolean, intersect :: Maybe Boolean }Options passed to getElementsAtEventForMode. Matches Chart.js's
InteractionOptions interface — same fields as InteractionConfig
minus mode (which is passed as a separate argument to the method).
#InteractionItem Source
type InteractionItem = { datasetIndex :: Int, element :: Foreign, index :: Int }Single element returned from getElementsAtEventForMode. Matches
Chart.js's InteractionItem. element is the underlying Chart.js
element (point, bar, arc, etc.) — opaque, consumers inspect via
Foreign operations if needed.
#LayoutConfig Source
type LayoutConfig = { autoPadding :: Maybe Boolean, padding :: Maybe (Scriptable Padding) }Chart layout configuration. padding is Scriptable<Padding> in
Chart.js TS — a scriptable function can compute padding based on
the chart context at render time.
#PointElementConfig Source
type PointElementConfig = { backgroundColor :: Maybe (ScriptableIndexable Color), borderColor :: Maybe (ScriptableIndexable Color), borderWidth :: Maybe (ScriptableIndexable Number), drawActiveElementsOnTop :: Maybe (ScriptableIndexable Boolean), hitRadius :: Maybe (ScriptableIndexable Number), hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderColor :: Maybe (ScriptableIndexable Color), hoverBorderWidth :: Maybe (ScriptableIndexable Number), hoverRadius :: Maybe (ScriptableIndexable Number), pointStyle :: Maybe (ScriptableIndexable PointStyle), radius :: Maybe (ScriptableIndexable Number), rotation :: Maybe (ScriptableIndexable Number) }Default styling for point elements.
All fields ScriptableIndexable per Chart.js ScriptableAndArrayOptions.
#43: added hoverBackgroundColor, hoverBorderColor, drawActiveElementsOnTop.
#LineElementConfig Source
type LineElementConfig = { backgroundColor :: Maybe (ScriptableIndexable Color), borderCapStyle :: Maybe (ScriptableIndexable CapStyle), borderColor :: Maybe (ScriptableIndexable Color), borderDash :: Maybe (ScriptableIndexable (Array Number)), borderDashOffset :: Maybe (ScriptableIndexable Number), borderJoinStyle :: Maybe (ScriptableIndexable JoinStyle), borderWidth :: Maybe (ScriptableIndexable Number), capBezierPoints :: Maybe (ScriptableIndexable Boolean), cubicInterpolationMode :: Maybe (ScriptableIndexable CubicInterpolationMode), fill :: Maybe (ScriptableIndexable Fill), hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderCapStyle :: Maybe (ScriptableIndexable CapStyle), hoverBorderColor :: Maybe (ScriptableIndexable Color), hoverBorderDash :: Maybe (ScriptableIndexable (Array Number)), hoverBorderDashOffset :: Maybe (ScriptableIndexable Number), hoverBorderJoinStyle :: Maybe (ScriptableIndexable JoinStyle), hoverBorderWidth :: Maybe (ScriptableIndexable Number), segment :: Maybe Foreign, spanGaps :: Maybe (ScriptableIndexable SpanGaps), stepped :: Maybe (ScriptableIndexable Stepped), tension :: Maybe (ScriptableIndexable Number) }Default styling for line elements.
All fields ScriptableIndexable.
#43: added hover fields, spanGaps, segment.
#BarElementConfig Source
type BarElementConfig = { backgroundColor :: Maybe (ScriptableIndexable Color), base :: Maybe (ScriptableIndexable Number), borderColor :: Maybe (ScriptableIndexable Color), borderRadius :: Maybe (ScriptableIndexable BarBorderRadius), borderSkipped :: Maybe (ScriptableIndexable BorderSkipped), borderWidth :: Maybe (ScriptableIndexable BarBorderWidth), hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderColor :: Maybe (ScriptableIndexable Color), hoverBorderRadius :: Maybe (ScriptableIndexable BarBorderRadius), hoverBorderWidth :: Maybe (ScriptableIndexable Number), inflateAmount :: Maybe (ScriptableIndexable InflateAmount), pointStyle :: Maybe (ScriptableIndexable PointStyle) }Default styling for bar elements.
All fields ScriptableIndexable.
#43: added base, hover fields.
#ArcElementConfig Source
type ArcElementConfig = { angle :: Maybe (ScriptableIndexable Number), backgroundColor :: Maybe (ScriptableIndexable Color), borderAlign :: Maybe (ScriptableIndexable BorderAlign), borderColor :: Maybe (ScriptableIndexable Color), borderDash :: Maybe (ScriptableIndexable (Array Number)), borderDashOffset :: Maybe (ScriptableIndexable Number), borderJoinStyle :: Maybe (ScriptableIndexable JoinStyle), borderRadius :: Maybe (ScriptableIndexable ArcBorderRadius), borderWidth :: Maybe (ScriptableIndexable Number), circular :: Maybe (ScriptableIndexable Boolean), hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderColor :: Maybe (ScriptableIndexable Color), hoverBorderDash :: Maybe (ScriptableIndexable (Array Number)), hoverBorderDashOffset :: Maybe (ScriptableIndexable Number), hoverBorderWidth :: Maybe (ScriptableIndexable Number), hoverOffset :: Maybe (ScriptableIndexable Number), offset :: Maybe (ScriptableIndexable Number), selfJoin :: Maybe (ScriptableIndexable Boolean), spacing :: Maybe (ScriptableIndexable Number), spacingMode :: Maybe (ScriptableIndexable String) }Default styling for arc elements (pie, doughnut, polar area).
All fields ScriptableIndexable.
#43: added hover fields, spacingMode.
#ElementsConfig Source
type ElementsConfig = { arc :: Maybe ArcElementConfig, bar :: Maybe BarElementConfig, line :: Maybe LineElementConfig, point :: Maybe PointElementConfig }Default element styling overrides.
#ChartOptions Source
type ChartOptions = { animation :: Maybe AnimationSetting, animations :: Maybe AnimationsConfig, aspectRatio :: Maybe Number, backgroundColor :: Maybe (ScriptableIndexable Color), borderColor :: Maybe (ScriptableIndexable Color), circumference :: Maybe Number, clip :: Maybe Clip, color :: Maybe (Scriptable Color), cutout :: Maybe Cutout, datasets :: Maybe DatasetsDefaults, devicePixelRatio :: Maybe Number, elements :: Maybe ElementsConfig, events :: Maybe (Array String), font :: Maybe Font, hover :: Maybe InteractionConfig, hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderColor :: Maybe (ScriptableIndexable Color), indexAxis :: Maybe Axis, interaction :: Maybe InteractionConfig, layout :: Maybe LayoutConfig, locale :: Maybe String, maintainAspectRatio :: Maybe Boolean, normalized :: Maybe Boolean, offset :: Maybe (Indexable Number), parsing :: Maybe ParsingConfig, plugins :: Maybe PluginsConfig, radius :: Maybe Radius, resizeDelay :: Maybe Number, responsive :: Maybe Boolean, rotation :: Maybe Number, scales :: Maybe (Object ScaleConfig), showLine :: Maybe Boolean, spacing :: Maybe Number, spanGaps :: Maybe SpanGaps, startAngle :: Maybe Number, transitions :: Maybe TransitionsConfig }Top-level chart options.
#defaultDataset Source
defaultDataset :: DatasetDefault dataset with empty label and data. All optional fields set to Nothing.
#defaultDatasetDefaults Source
defaultDatasetDefaults :: DatasetDefaultsDefault DatasetDefaults with all optional fields set to Nothing. Use
as a starting point for per-chart-type defaults in DatasetsDefaults.
#defaultDatasetsDefaults Source
defaultDatasetsDefaults :: DatasetsDefaultsDefault DatasetsDefaults with every per-type entry set to Nothing.
#defaultFont Source
defaultFont :: FontAll optional fields set to Nothing.
#defaultScaleTitleConfig Source
defaultScaleTitleConfig :: ScaleTitleConfigAll optional fields set to Nothing.
#defaultTicksConfig Source
defaultTicksConfig :: TicksConfigAll optional fields set to Nothing.
#defaultGridConfig Source
defaultGridConfig :: GridConfigAll optional fields set to Nothing.
#defaultScaleBorderConfig Source
defaultScaleBorderConfig :: ScaleBorderConfigAll optional fields set to Nothing.
#defaultTimeConfig Source
defaultTimeConfig :: TimeConfigAll optional fields set to Nothing.
#defaultAngleLinesConfig Source
defaultAngleLinesConfig :: AngleLinesConfigAll optional fields set to Nothing.
#defaultPointLabelsConfig Source
defaultPointLabelsConfig :: PointLabelsConfigAll optional fields set to Nothing.
#defaultScaleConfig Source
defaultScaleConfig :: ScaleConfigAll optional fields set to Nothing.
#defaultTitleConfig Source
defaultTitleConfig :: TitleConfigAll optional fields set to Nothing.
#defaultLegendLabelsConfig Source
defaultLegendLabelsConfig :: LegendLabelsConfigAll optional fields set to Nothing.
#defaultLegendTitleConfig Source
defaultLegendTitleConfig :: LegendTitleConfigAll optional fields set to Nothing.
#defaultLegendConfig Source
defaultLegendConfig :: LegendConfigAll optional fields set to Nothing.
#defaultTooltipConfig Source
defaultTooltipConfig :: TooltipConfigAll optional fields set to Nothing.
#defaultDecimationConfig Source
defaultDecimationConfig :: DecimationConfigAll optional fields set to Nothing.
#defaultFillerConfig Source
defaultFillerConfig :: FillerConfigAll optional fields set to Nothing.
#defaultColorsPluginOptions Source
defaultColorsPluginOptions :: ColorsPluginOptionsAll optional fields set to Nothing.
#defaultPluginsConfig Source
defaultPluginsConfig :: PluginsConfigAll optional fields set to Nothing.
#defaultAnimationConfig Source
defaultAnimationConfig :: AnimationConfigAll optional fields set to Nothing.
#defaultInteractionConfig Source
defaultInteractionConfig :: InteractionConfigAll optional fields set to Nothing.
#defaultInteractionOptions Source
defaultInteractionOptions :: InteractionOptionsAll optional fields set to Nothing. Default options for
getElementsAtEventForMode — Chart.js will use its built-in defaults
for any field left Nothing.
#defaultLayoutConfig Source
defaultLayoutConfig :: LayoutConfigAll optional fields set to Nothing.
#defaultPointElementConfig Source
defaultPointElementConfig :: PointElementConfigAll optional fields set to Nothing.
#defaultLineElementConfig Source
defaultLineElementConfig :: LineElementConfigAll optional fields set to Nothing.
#defaultBarElementConfig Source
defaultBarElementConfig :: BarElementConfigAll optional fields set to Nothing.
#defaultArcElementConfig Source
defaultArcElementConfig :: ArcElementConfigAll optional fields set to Nothing.
#defaultElementsConfig Source
defaultElementsConfig :: ElementsConfigAll optional fields set to Nothing.
#defaultOptions Source
defaultOptions :: ChartOptionsAll optional fields set to Nothing.
#defaultConfig Source
defaultConfig :: ChartConfigDefault chart config with Bar type, empty labels, and empty datasets.
#defaultParsingConfig Source
defaultParsingConfig :: ParsingConfigAll optional fields set to Nothing.
#fromNumbers Source
fromNumbers :: Array Number -> Array DataPointConvert plain numbers to DataPoint values.