@@ -2339,10 +2339,18 @@ export interface LegendItem {
2339
2339
textAlign ?: TextAlign ;
2340
2340
}
2341
2341
2342
+ export interface LegendNavigation {
2343
+ active : boolean ;
2344
+ page : number ;
2345
+ totalPages : number ;
2346
+ legendItems ?: LegendItem [ ] ;
2347
+ }
2348
+
2342
2349
export interface LegendElement < TType extends ChartType > extends Element < AnyObject , LegendOptions < TType > > , LayoutItem {
2343
2350
chart : Chart < TType > ;
2344
2351
ctx : CanvasRenderingContext2D ;
2345
2352
legendItems ?: LegendItem [ ] ;
2353
+ navigation : LegendNavigation ;
2346
2354
options : LegendOptions < TType > ;
2347
2355
fit ( ) : void ;
2348
2356
}
@@ -2499,6 +2507,71 @@ export interface LegendOptions<TType extends ChartType> {
2499
2507
*/
2500
2508
text : string ;
2501
2509
} ;
2510
+
2511
+ navigation : {
2512
+ /**
2513
+ * Show/hide legend navigation.
2514
+ *
2515
+ * If `auto` is used, the navigation will be shown only if the legend overflows.
2516
+ * @default false
2517
+ */
2518
+ display : 'auto' | boolean ;
2519
+ /**
2520
+ * Color of the navigation page count label.
2521
+ * @see Defaults.color
2522
+ */
2523
+ color : Color ;
2524
+ /**
2525
+ * Color of active navigation arrows.
2526
+ * @see Defaults.color
2527
+ */
2528
+ activeColor : Color ;
2529
+ /**
2530
+ * Color of inactive navigation arrows.
2531
+ *
2532
+ * Defaults to 40% opacity of the active color.
2533
+ */
2534
+ inactiveColor : Color ;
2535
+ /**
2536
+ * Size of navigation arrows.
2537
+ * @default 12
2538
+ */
2539
+ arrowSize : number ;
2540
+ /**
2541
+ * Maximum number of columns, in vertical legends, for navigation to be activated.
2542
+ * @default 1
2543
+ */
2544
+ maxCols : number ;
2545
+ /**
2546
+ * Maximum number of rows, in horizontal legends, for navigation to be activated.
2547
+ * @default 3
2548
+ */
2549
+ maxRows : number ;
2550
+ /**
2551
+ * Navigation buttons padding.
2552
+ * @default
2553
+ * { x: 10, y: 10, top: 0 }
2554
+ */
2555
+ padding : number | ChartArea ;
2556
+ /**
2557
+ * Alignment of navigation buttons.
2558
+ * @default 'start'
2559
+ */
2560
+ align : 'start' | 'center' | 'end' ;
2561
+ /**
2562
+ * Align legends horizontally and vertically.
2563
+ *
2564
+ * Fixes the width/height of all legends according to the widest/tallest legend, to form a grid and keep legends aligned when changing pages.
2565
+ * @default true
2566
+ */
2567
+ grid : boolean | { x ?: boolean ; y ?: boolean ; } ,
2568
+ /**
2569
+ * Font style of the navigation page count label.
2570
+ * @default
2571
+ * { weight: 'bold', size: 14 }
2572
+ */
2573
+ font : ScriptableAndScriptableOptions < Partial < FontSpec > , ScriptableChartContext > ;
2574
+ }
2502
2575
}
2503
2576
2504
2577
export declare const SubTitle : Plugin ;
@@ -3725,7 +3798,7 @@ export type ChartType = keyof ChartTypeRegistry;
3725
3798
3726
3799
export type ScaleOptionsByType < TScale extends ScaleType = ScaleType > =
3727
3800
{ [ key in ScaleType ] : { type : key } & ScaleTypeRegistry [ key ] [ 'options' ] } [ TScale ]
3728
- ;
3801
+ ;
3729
3802
3730
3803
// Convenience alias for creating and manipulating scale options in user code
3731
3804
export type ScaleOptions < TScale extends ScaleType = ScaleType > = DeepPartial < ScaleOptionsByType < TScale > > ;
0 commit comments