]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Types/ type suggestedMin and suggestedMax for time scale (#9986)
authorJacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com>
Tue, 14 Dec 2021 18:41:47 +0000 (19:41 +0100)
committerGitHub <noreply@github.com>
Tue, 14 Dec 2021 18:41:47 +0000 (13:41 -0500)
* type suggestedMin and suggestedMax for time scale

* implement feedback

docs/axes/cartesian/time.md
types/index.esm.d.ts

index c55ee9ed9f38ba454d8becab463b576d8da5f4d8..389de1d55f9a87b0b19b78aeb515239474232ece 100644 (file)
@@ -24,8 +24,10 @@ Namespace: `options.scales[scaleId]`
 
 | Name | Type | Default | Description
 | ---- | ---- | ------- | -----------
-| `min` | `string`\|`number` | | The minimum item to display. [more...](#min-max-configuration)
-| `max` | `string`\|`number` | | The maximum item to display. [more...](#min-max-configuration)
+| `min` | `number`\|`string` | | The minimum item to display. [more...](#min-max-configuration)
+| `max` | `number`\|`string` | | The maximum item to display. [more...](#min-max-configuration)
+| `suggestedMin` | `number`\|`string` | | The minimum item to display if there is no datapoint before it. [more...](../index.md#axis-range-settings)
+| `suggestedMax` | `number`\|`string` | | The maximum item to display if there is no datapoint behind it. [more...](../index.md#axis-range-settings)
 | `adapters.date` | `object` | `{}` | Options for adapter for external date library if that adapter needs or supports options
 | `bounds` | `string` | `'data'` | Determines the scale bounds. [more...](./index.md#scale-bounds)
 | `ticks.source` | `string` | `'auto'` | How ticks are generated. [more...](#ticks-source)
index 92aaa58cc6bfb5a292f628e68c2d858ad4f306cb..edf661e7eca0e3a6742ddc247391a325958118e5 100644 (file)
@@ -3176,6 +3176,9 @@ export const LogarithmicScale: ChartComponent & {
 export type TimeScaleOptions = CartesianScaleOptions & {
   min: string | number;
   max: string | number;
+
+  suggestedMin: string | number;
+  suggestedMax: string | number;
   /**
    * Scale boundary strategy (bypassed by min/max time options)
    * - `data`: make sure data are fully visible, ticks outside are removed