@@ -928,6 +928,12 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject>
928
928
extends ExtendedPlugin < TType , O > {
929
929
id : string ;
930
930
931
+ /**
932
+ * The events option defines the browser events that the plugin should listen.
933
+ * @default ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove']
934
+ */
935
+ events ?: ( keyof HTMLElementEventMap ) [ ]
936
+
931
937
/**
932
938
* @desc Called when plugin is installed for this chart instance. This hook is also invoked for disabled plugins (options === false).
933
939
* @param {Chart } chart - The chart instance.
@@ -2474,7 +2480,11 @@ export type DecimationOptions = LttbDecimationOptions | MinMaxDecimationOptions;
2474
2480
2475
2481
export declare const Filler : Plugin ;
2476
2482
export interface FillerOptions {
2483
+ < < << << < HEAD
2477
2484
drawTime : "beforeDatasetDraw" | "beforeDatasetsDraw" ;
2485
+ === === =
2486
+ drawTime : 'beforeDraw' | 'beforeDatasetDraw' | 'beforeDatasetsDraw' ;
2487
+ >>> >>> > master
2478
2488
propagate : boolean ;
2479
2489
}
2480
2490
@@ -2706,6 +2716,10 @@ export interface LegendOptions<TType extends ChartType> {
2706
2716
* @default 10
2707
2717
*/
2708
2718
padding : number ;
2719
+ /**
2720
+ * If usePointStyle is true, the width of the point style used for the legend.
2721
+ */
2722
+ pointStyleWidth : number ;
2709
2723
/**
2710
2724
* Generates legend items for each thing in the legend. Default implementation returns the text + styling for the color box. See Legend Item for details.
2711
2725
*/
@@ -3256,13 +3270,13 @@ export interface TooltipItem<TType extends ChartType> {
3256
3270
}
3257
3271
3258
3272
export interface PluginOptionsByType < TType extends ChartType > {
3259
- colors : ColorsPluginOptions ;
3260
- decimation : DecimationOptions ;
3261
- filler : FillerOptions ;
3262
- legend : LegendOptions < TType > ;
3263
- subtitle : TitleOptions ;
3264
- title : TitleOptions ;
3265
- tooltip : TooltipOptions < TType > ;
3273
+ colors : ColorsPluginOptions | false ;
3274
+ decimation : DecimationOptions | false ;
3275
+ filler : FillerOptions | false ;
3276
+ legend : LegendOptions < TType > | false ;
3277
+ subtitle : TitleOptions | false ;
3278
+ title : TitleOptions | false ;
3279
+ tooltip : TooltipOptions < TType > | false ;
3266
3280
}
3267
3281
export interface PluginChartOptions < TType extends ChartType > {
3268
3282
plugins : PluginOptionsByType < TType > ;
@@ -3314,7 +3328,7 @@ export interface GridLineOptions {
3314
3328
/**
3315
3329
* @default []
3316
3330
*/
3317
- tickBorderDash : number [ ] ;
3331
+ tickBorderDash : Scriptable < number [ ] , ScriptableScaleContext > ;
3318
3332
/**
3319
3333
* @default 0
3320
3334
*/
@@ -3683,7 +3697,66 @@ export declare const LogarithmicScale: ChartComponent & {
3683
3697
) : LogarithmicScale < O > ;
3684
3698
} ;
3685
3699
3700
+ < < < << << HEAD
3686
3701
export type TimeScaleOptions = Omit < CartesianScaleOptions , "min" | "max" > & {
3702
+ === === =
3703
+ export type TimeScaleTimeOptions = {
3704
+ /**
3705
+ * Custom parser for dates.
3706
+ */
3707
+ parser : string | ( ( v : unknown ) => number ) ;
3708
+ /**
3709
+ * If defined, dates will be rounded to the start of this unit. See Time Units below for the allowed units.
3710
+ */
3711
+ round : false | TimeUnit ;
3712
+ /**
3713
+ * If boolean and true and the unit is set to 'week', then the first day of the week will be Monday. Otherwise, it will be Sunday.
3714
+ * If `number`, the index of the first day of the week (0 - Sunday, 6 - Saturday).
3715
+ * @default false
3716
+ */
3717
+ isoWeekday : boolean | number ;
3718
+ /**
3719
+ * Sets how different time units are displayed.
3720
+ */
3721
+ displayFormats : {
3722
+ [ key : string ] : string ;
3723
+ } ;
3724
+ /**
3725
+ * The format string to use for the tooltip.
3726
+ */
3727
+ tooltipFormat : string ;
3728
+ /**
3729
+ * If defined, will force the unit to be a certain type. See Time Units section below for details.
3730
+ * @default false
3731
+ */
3732
+ unit : false | TimeUnit ;
3733
+ /**
3734
+ * The minimum display format to be used for a time unit.
3735
+ * @default 'millisecond'
3736
+ */
3737
+ minUnit : TimeUnit ;
3738
+ } ;
3739
+
3740
+ export type TimeScaleTickOptions = {
3741
+ /**
3742
+ * Ticks generation input values:
3743
+ * - 'auto': generates "optimal" ticks based on scale size and time options.
3744
+ * - 'data': generates ticks from data (including labels from data `{t|x|y}` objects).
3745
+ * - 'labels': generates ticks from user given `data.labels` values ONLY.
3746
+ * @see https://github.com./chartjs/Chart.js/pull/4507
3747
+ * @since 2.7.0
3748
+ * @default 'auto'
3749
+ */
3750
+ source : 'labels' | 'auto' | 'data' ;
3751
+ /**
3752
+ * The number of units between grid lines.
3753
+ * @default 1
3754
+ */
3755
+ stepSize : number ;
3756
+ } ;
3757
+
3758
+ export type TimeScaleOptions = Omit < CartesianScaleOptions , 'min' | 'max' > & {
3759
+ > >>> >>> master
3687
3760
min : string | number ;
3688
3761
max : string | number ;
3689
3762
suggestedMin : string | number ;
@@ -3711,43 +3784,9 @@ export type TimeScaleOptions = Omit<CartesianScaleOptions, "min" | "max"> & {
3711
3784
date : unknown ;
3712
3785
} ;
3713
3786
3714
- time : {
3715
- /**
3716
- * Custom parser for dates.
3717
- */
3718
- parser : string | ( ( v : unknown ) => number ) ;
3719
- /**
3720
- * If defined, dates will be rounded to the start of this unit. See Time Units below for the allowed units.
3721
- */
3722
- round : false | TimeUnit ;
3723
- /**
3724
- * If boolean and true and the unit is set to 'week', then the first day of the week will be Monday. Otherwise, it will be Sunday.
3725
- * If `number`, the index of the first day of the week (0 - Sunday, 6 - Saturday).
3726
- * @default false
3727
- */
3728
- isoWeekday : boolean | number ;
3729
- /**
3730
- * Sets how different time units are displayed.
3731
- */
3732
- displayFormats : {
3733
- [ key : string ] : string ;
3734
- } ;
3735
- /**
3736
- * The format string to use for the tooltip.
3737
- */
3738
- tooltipFormat : string ;
3739
- /**
3740
- * If defined, will force the unit to be a certain type. See Time Units section below for details.
3741
- * @default false
3742
- */
3743
- unit : false | TimeUnit ;
3744
- /**
3745
- * The minimum display format to be used for a time unit.
3746
- * @default 'millisecond'
3747
- */
3748
- minUnit : TimeUnit ;
3749
- } ;
3787
+ time : TimeScaleTimeOptions ;
3750
3788
3789
+ < < << << < HEAD
3751
3790
ticks : {
3752
3791
/**
3753
3792
* Ticks generation input values:
@@ -3765,6 +3804,9 @@ export type TimeScaleOptions = Omit<CartesianScaleOptions, "min" | "max"> & {
3765
3804
*/
3766
3805
stepSize : number ;
3767
3806
} ;
3807
+ === === =
3808
+ ticks : TimeScaleTickOptions ;
3809
+ >>> >>> > master
3768
3810
} ;
3769
3811
3770
3812
export interface TimeScale < O extends TimeScaleOptions = TimeScaleOptions >
0 commit comments