Skip to content

Commit

Permalink
move defaults to component to make them available when options is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
kangzj committed Jan 16, 2025
1 parent 60df209 commit 1cbf427
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,7 @@ const LineChart: FC< LineChartProps > = ( {
withTooltips = true,
showLegend = false,
legendOrientation = 'horizontal',
options = {
axis: {
x: {
orientation: 'bottom',
},
y: {
orientation: 'left',
},
},
},
options = {},
} ) => {
const providerTheme = useChartTheme();

Expand Down Expand Up @@ -134,8 +125,13 @@ const LineChart: FC< LineChartProps > = ( {
yScale={ { type: 'linear', nice: true } }
>
<AnimatedGrid columns={ false } numTicks={ 4 } />
<AnimatedAxis numTicks={ 5 } tickFormat={ formatDateTick } { ...options.axis.x } />
<AnimatedAxis numTicks={ 4 } { ...options.axis.y } />
<AnimatedAxis
orientation="bottom"
numTicks={ 5 }
tickFormat={ formatDateTick }
{ ...options?.axis?.x }
/>
<AnimatedAxis orientation="left" numTicks={ 4 } { ...options?.axis?.y } />

{ data.map( ( seriesData, index ) => (
<AnimatedLineSeries
Expand Down

0 comments on commit 1cbf427

Please sign in to comment.