+> & { linePathEffect?: DashPathEffectComponent };
export type FrameProps = FramePropsWithDefaults & {
xScale: Scale;
yScale: Scale;
diff --git a/website/docs/cartesian/cartesian-chart.md b/website/docs/cartesian/cartesian-chart.md
index a2d7919f..af5ab888 100644
--- a/website/docs/cartesian/cartesian-chart.md
+++ b/website/docs/cartesian/cartesian-chart.md
@@ -108,7 +108,7 @@ The `axisOptions` is an optional prop allows you to configure the axes and grid
| **`tickCount`** | number | \{
x: number;
y: number;
\}
| Defines the number of ticks to be rendered on both axes, or if provided an object, specific to x and y. If not provided, then the chart will attempt to choose a reasonable number of ticks based on the size of the chart.
Note: This is an approximation; the scale may return more or fewer values depending on the domain, padding, and axis labels. |
| **`tickValues`** | [number] | \{
x: [number];
y: [number];
\}
| Defines the explicit set of numeric tick values to be rendered on both axes, or if provided an object, specific to x and y. The tickValues prop is used to specify the values of each tick, so we only accept numeric values. Use the `formatXLabel` or `formatYLabel` options to customize how the ticks should be labeled.
Note: If `tickCount` value is also provided, it will be used to downsample the provided `tickValues` array to the specified length. |
| **`lineColor`** | string | \{
grid: string | \{
x: string;
y: string;
\};
frame: string;
\}
| Defines the color of the grid and axis lines. It can either apply to both or be customized to each. It will default to `black` if none is provided. |
-| **`lineWidth`** | number | \{
grid: number | \{
x: number;
y: number;
\};
frame: number;
\}
| Defines the width of the grid and axis lines. It can either apply to both or be customized to each. It will default to `Stylesheet.hairlineWidth` if none is provided. A value of `0` will disable the line rendering. |
+| **`lineWidth`** | number | \{
grid: number | \{
x: number;
y: number;
\};
frame: number;
\}
| Defines the width of the grid and axis lines. It can either apply to both or be customized to each. It will default to `Stylesheet.hairlineWidth` if none is provided. A value of `0` will disable the line rendering. |
| **`labelColor`** | string | \{
x: string;
y: string;
\}
| Defines the color of the axis labels. It can either apply to both or be customized to each. It will default to `black` if none is provided. |
| **`labelOffset`** | number | \{
x: number;
y: number;
\}
| Defines the offset of the axis labels. It can either apply to both or be customized to each. It will default to `0` if none is provided. |
| **`labelPosition`** | AxisLabelPosition | \{
x: AxisLabelPosition;
y: AxisLabelPosition;
\}
| Defines the position of the axis labels. It can either apply to both or be customized to each. It will default to `outset` if none is provided.
ⓘ **`AxisLabelPosition`** is an enum with the values: 'inset | 'outset'
. |
@@ -120,46 +120,49 @@ The `axisOptions` is an optional prop allows you to configure the axes and grid
The `xAxis` is an optional prop allows you to configure the X axis of the chart. If it is not present then the chart will not render any X axis. It is an object of the following properties:
-| Property | Type | Description |
-| :-----------------: | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| **`font`** | SkFont | null
| Defines the font to be used for X axis labels. If not provided, then no labels will be rendered. This font object is typically returned from Skia’s `useFont` hook. |
-| **`tickCount`** | number
| Defines the number of ticks to be rendered on the X axis. If not provided, then the chart will attempt to choose a reasonable number of ticks based on the size of the chart.
Note: This is an approximation; the scale may return more or fewer values depending on the domain, padding, and axis labels. |
-| **`tickValues`** | [number]
| Defines the explicit set of numeric tick values to be rendered on the X axis. The tickValues prop is used to specify the values of each tick, so we only accept numeric values. Use the `formatXLabel` or `formatYLabel` options to customize how the ticks should be labeled.
Note: If `tickCount` value is also provided, it will be used to downsample the provided `tickValues` array to the specified length. |
-| **`lineColor`** | Color (RN Skia Color)
| Defines the color of the X axis lines. It will default to `hsla(0, 0%, 0%, 0.25)` if none is provided. |
-| **`lineWidth`** | number
| Defines the width of the X axis lines. It will default to `Stylesheet.hairlineWidth` if none is provided. A value of `0` will disable the line rendering. |
-| **`labelColor`** | string
| Defines the color of the X axis label. It will default to `#000000 (black)` if none is provided. |
-| **`labelOffset`** | number
| Defines the offset of the axis label. It will default to `2` if none is provided. |
-| **`labelPosition`** | AxisLabelPosition;
| Defines the position of the x-axis labels. It will default to `outset` if none is provided.
ⓘ **`AxisLabelPosition`** is an enum with the values: 'inset | 'outset'
. |
-| **`axisSide`** | XAxisSide
| Defines the side of the chart that the `X` axis is rendered on. It will default to `bottom` if none is provided.
ⓘ **`XAxisSide`** is an enum with the values: 'top' | 'bottom'
.
|
-| **`formatXLabel`** | (label: T[XK]) => string
| Defines a function provide customization for formatting the X axis labels. It will default to just returning the value as a string if no function is provided. |
+| Property | Type | Description |
+| :------------------: | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| **`font`** | SkFont | null
| Defines the font to be used for X axis labels. If not provided, then no labels will be rendered. This font object is typically returned from Skia’s `useFont` hook. |
+| **`tickCount`** | number
| Defines the number of ticks to be rendered on the X axis. If not provided, then the chart will attempt to choose a reasonable number of ticks based on the size of the chart.
Note: This is an approximation; the scale may return more or fewer values depending on the domain, padding, and axis labels. |
+| **`tickValues`** | [number]
| Defines the explicit set of numeric tick values to be rendered on the X axis. The tickValues prop is used to specify the values of each tick, so we only accept numeric values. Use the `formatXLabel` or `formatYLabel` options to customize how the ticks should be labeled.
Note: If `tickCount` value is also provided, it will be used to downsample the provided `tickValues` array to the specified length. |
+| **`lineColor`** | Color (RN Skia Color)
| Defines the color of the X axis lines. It will default to `hsla(0, 0%, 0%, 0.25)` if none is provided. |
+| **`lineWidth`** | number
| Defines the width of the X axis lines. It will default to `Stylesheet.hairlineWidth` if none is provided. A value of `0` will disable the line rendering. |
+| **`labelColor`** | string
| Defines the color of the X axis label. It will default to `#000000 (black)` if none is provided. |
+| **`labelOffset`** | number
| Defines the offset of the axis label. It will default to `2` if none is provided. |
+| **`labelPosition`** | AxisLabelPosition;
| Defines the position of the x-axis labels. It will default to `outset` if none is provided.
ⓘ **`AxisLabelPosition`** is an enum with the values: 'inset | 'outset'
. |
+| **`axisSide`** | XAxisSide
| Defines the side of the chart that the `X` axis is rendered on. It will default to `bottom` if none is provided.
ⓘ **`XAxisSide`** is an enum with the values: 'top' | 'bottom'
.
|
+| **`formatXLabel`** | (label: T[XK]) => string
| Defines a function provide customization for formatting the X axis labels. It will default to just returning the value as a string if no function is provided. |
+| **`linePathEffect`** | `DashPathEffect`
| Currently accepts the `` from `react-native-skia` so one can add dashes to their axis lines. In the future this prop may accept other line path effects as well. |
### `yAxis`
The `yAxis` is an optional prop allows you to configure the **Y axes** of the chart. If it is not present then the chart will not render any Y-axis. To render multiple Y axes, pass in multiple Y axis objects to the array. It is an array of objects with the following properties:
-| Property | Type | Description |
-|:-----------------------:|---------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| Property | Type | Description |
+| :---------------------: | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`yKeys` (optional)** | YK[]
| A `string[]` array of strings indicating the _keys_ of each `data[number]` object to be used on the dependent (y) axis for charting. Each yAxis object needs to specify which Y data keys it corresponds to. If only one object is passed, then this defaults to the existing yKeys and so remains optional, but you must specify it if you want to have multiple y axes, since the axis must know which data is corresponds to! |
-| **`font`** | SkFont | null
| Defines the font to be used for x axis labels. If not provided, then no labels will be rendered. This font object is typically returned from Skia’s `useFont` hook. |
-| **`tickCount`** | number
| Defines the number of ticks to be rendered on the Y axis. If not provided, then the chart will attempt to choose a reasonable number of ticks based on the size of the chart.
Note: This is an approximation; the scale may return more or fewer values depending on the domain, padding, and axis labels. |
-| **`tickValues`** | [number]
| Defines the explicit set of numeric tick values to be rendered on the Y axis. The tickValues prop is used to specify the values of each tick, so we only accept numeric values. Use the `formatXLabel` or `formatYLabel` options to customize how the ticks should be labeled.
Note: If `tickCount` value is also provided, it will be used to downsample the provided `tickValues` array to the specified length. |
-| **`lineColor`** | Color (RN Skia Color)
| Defines the color of the x axis lines. It will default to `hsla(0, 0%, 0%, 0.25)` if none is provided. |
-| **`lineWidth`** | number
| Defines the width of the Y axis lines. It will default to `Stylesheet.hairlineWidth` if none is provided. A value of `0` will disable the line rendering. |
-| **`labelColor`** | string
| Defines the color of the Y axis label. It will default to `#000000 (black)` if none is provided. |
-| **`labelOffset`** | number
| Defines the offset of the axis label. It will default to `4` if none is provided. |
-| **`labelPosition`** | AxisLabelPosition;
| Defines the position of the Y-axis labels. It will default to `outset` if none is provided.
ⓘ **`AxisLabelPosition`** is an enum with the values: 'inset | 'outset'
. |
-| **`axisSide`** | YAxisSide
| Defines the side of the chart that the `Y` axis is rendered on. It will default to `left` if none is provided.
ⓘ **`YAxisSide`** is an enum with the values: 'left' | 'right'
.
|
-| **`formatYLabel`** | (label: T[YK]) => string
| Defines a function provide customization for formatting the Y-axis labels. It will default to just returning the value as a string if no function is provided. |
-| **`domain` (optional)** | [number] | [number, number]
| Defines the domain for the Y-axis that can be specified to control the upper and lower bounds of the Y-axis. It defaults to the min and max of the range. |
+| **`font`** | SkFont | null
| Defines the font to be used for x axis labels. If not provided, then no labels will be rendered. This font object is typically returned from Skia’s `useFont` hook. |
+| **`tickCount`** | number
| Defines the number of ticks to be rendered on the Y axis. If not provided, then the chart will attempt to choose a reasonable number of ticks based on the size of the chart.
Note: This is an approximation; the scale may return more or fewer values depending on the domain, padding, and axis labels. |
+| **`tickValues`** | [number]
| Defines the explicit set of numeric tick values to be rendered on the Y axis. The tickValues prop is used to specify the values of each tick, so we only accept numeric values. Use the `formatXLabel` or `formatYLabel` options to customize how the ticks should be labeled.
Note: If `tickCount` value is also provided, it will be used to downsample the provided `tickValues` array to the specified length. |
+| **`lineColor`** | Color (RN Skia Color)
| Defines the color of the x axis lines. It will default to `hsla(0, 0%, 0%, 0.25)` if none is provided. |
+| **`lineWidth`** | number
| Defines the width of the Y axis lines. It will default to `Stylesheet.hairlineWidth` if none is provided. A value of `0` will disable the line rendering. |
+| **`labelColor`** | string
| Defines the color of the Y axis label. It will default to `#000000 (black)` if none is provided. |
+| **`labelOffset`** | number
| Defines the offset of the axis label. It will default to `4` if none is provided. |
+| **`labelPosition`** | AxisLabelPosition;
| Defines the position of the Y-axis labels. It will default to `outset` if none is provided.
ⓘ **`AxisLabelPosition`** is an enum with the values: 'inset | 'outset'
. |
+| **`axisSide`** | YAxisSide
| Defines the side of the chart that the `Y` axis is rendered on. It will default to `left` if none is provided.
ⓘ **`YAxisSide`** is an enum with the values: 'left' | 'right'
.
|
+| **`formatYLabel`** | (label: T[YK]) => string
| Defines a function provide customization for formatting the Y-axis labels. It will default to just returning the value as a string if no function is provided. |
+| **`domain` (optional)** | [number] | [number, number]
| Defines the domain for the Y-axis that can be specified to control the upper and lower bounds of the Y-axis. It defaults to the min and max of the range. |
+| **`linePathEffect`** | `DashPathEffect`
| Currently accepts the `` from `react-native-skia` so one can add dashes to their axis lines. In the future this prop may accept other line path effects as well. |
### `frame`
The `frame` is an optional prop allows you to configure the frame of the chart. If it is not present then the chart will not render any frame. It is an object with the following properties:
-| Property | Type | Description |
-| :-------------: | -------------------------------- | -------------------------------------------------------------------------------------------------- |
-| **`lineColor`** | Color (RN Skia Color)
| Defines the color of the frame. It will default to `hsla(0, 0%, 0%, 0.25)` if none is provided. |
-| **`lineWidth`** | number
| Defines the width of the frame. It will default to `Stylesheet.hairlineWidth` if none is provided. A value of `0` will disable the line rendering. |
+| Property | Type | Description |
+| :------------------: | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`lineColor`** | Color (RN Skia Color)
| Defines the color of the frame. It will default to `hsla(0, 0%, 0%, 0.25)` if none is provided. |
+| **`lineWidth`** | number
| Defines the width of the frame. It will default to `Stylesheet.hairlineWidth` if none is provided. A value of `0` will disable the line rendering. |
+| **`linePathEffect`** | `DashPathEffect`
| Currently accepts the `` from `react-native-skia` so one can add dashes to the frame. In the future this prop may accept other line path effects as well. |
### `chartPressState`