@@ -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
}
@@ -2504,6 +2512,71 @@ export interface LegendOptions<TType extends ChartType> {
2504
2512
*/
2505
2513
text : string ;
2506
2514
} ;
2515
+
2516
+ navigation : {
2517
+ /**
2518
+ * Show/hide legend navigation.
2519
+ *
2520
+ * If `auto` is used, the navigation will be shown only if the legend overflows.
2521
+ * @default false
2522
+ */
2523
+ display : 'auto' | boolean ;
2524
+ /**
2525
+ * Color of the navigation page count label.
2526
+ * @see Defaults.color
2527
+ */
2528
+ color : Color ;
2529
+ /**
2530
+ * Color of active navigation arrows.
2531
+ * @see Defaults.color
2532
+ */
2533
+ activeColor : Color ;
2534
+ /**
2535
+ * Color of inactive navigation arrows.
2536
+ *
2537
+ * Defaults to 40% opacity of the active color.
2538
+ */
2539
+ inactiveColor : Color ;
2540
+ /**
2541
+ * Size of navigation arrows.
2542
+ * @default 12
2543
+ */
2544
+ arrowSize : number ;
2545
+ /**
2546
+ * Maximum number of columns, in vertical legends, for navigation to be activated.
2547
+ * @default 1
2548
+ */
2549
+ maxCols : number ;
2550
+ /**
2551
+ * Maximum number of rows, in horizontal legends, for navigation to be activated.
2552
+ * @default 3
2553
+ */
2554
+ maxRows : number ;
2555
+ /**
2556
+ * Navigation buttons padding.
2557
+ * @default
2558
+ * { x: 10, y: 10, top: 0 }
2559
+ */
2560
+ padding : number | ChartArea ;
2561
+ /**
2562
+ * Alignment of navigation buttons.
2563
+ * @default 'start'
2564
+ */
2565
+ align : 'start' | 'center' | 'end' ;
2566
+ /**
2567
+ * Align legends horizontally and vertically.
2568
+ *
2569
+ * Fixes the width/height of all legends according to the widest/tallest legend, to form a grid and keep legends aligned when changing pages.
2570
+ * @default true
2571
+ */
2572
+ grid : boolean | { x ?: boolean ; y ?: boolean ; } ,
2573
+ /**
2574
+ * Font style of the navigation page count label.
2575
+ * @default
2576
+ * { weight: 'bold', size: 14 }
2577
+ */
2578
+ font : ScriptableAndScriptableOptions < Partial < FontSpec > , ScriptableChartContext > ;
2579
+ }
2507
2580
}
2508
2581
2509
2582
export declare const SubTitle : Plugin ;
@@ -3728,7 +3801,7 @@ export type ChartType = keyof ChartTypeRegistry;
3728
3801
3729
3802
export type ScaleOptionsByType < TScale extends ScaleType = ScaleType > =
3730
3803
{ [ key in ScaleType ] : { type : key } & ScaleTypeRegistry [ key ] [ 'options' ] } [ TScale ]
3731
- ;
3804
+ ;
3732
3805
3733
3806
// Convenience alias for creating and manipulating scale options in user code
3734
3807
export type ScaleOptions < TScale extends ScaleType = ScaleType > = DeepPartial < ScaleOptionsByType < TScale > > ;
0 commit comments