diff --git a/types/victory/index.d.ts b/types/victory/index.d.ts index 8131c760c9..2f57c5fff2 100644 --- a/types/victory/index.d.ts +++ b/types/victory/index.d.ts @@ -1087,6 +1087,13 @@ declare module "victory" { * @default "y" */ y?: DataGetterPropType; + /** + * Use y0 data accessor prop to determine how the component defines the baseline y0 data. + * This prop is useful for defining custom baselines for components like VictoryBar or VictoryArea. + * This prop may be given in a variety of formats. + * @example 'last_quarter_profit', () => 10, 1, 'employees.salary', ["employees", "salary"] + */ + y0?: DataGetterPropType; } // Common labable interface diff --git a/types/victory/victory-tests.tsx b/types/victory/victory-tests.tsx index 1d45fa49fd..6d8152361e 100644 --- a/types/victory/victory-tests.tsx +++ b/types/victory/victory-tests.tsx @@ -487,6 +487,7 @@ test = ( { y: 6, x: 'B' }, { y: 7, x: 'C' }, ]} + y0={(d) => d.y - 1} /> );