Skip to content

Commit

Permalink
fix: show chart in react native
Browse files Browse the repository at this point in the history
  • Loading branch information
mnindrazaka committed Oct 17, 2024
1 parent 1e15199 commit 57351b2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
4 changes: 2 additions & 2 deletions apps/mobile/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export const App = () => {
linking={{
prefixes: ['/'],
config: {
initialRouteName: 'home',
initialRouteName: 'dashboard',
screens: {
home: '',
dashboard: '',
categoryList: 'categories',
categoryCreate: 'categories/create',
categoryUpdate: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from 'victory-native';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from 'victory';
1 change: 1 addition & 0 deletions libs/ui/src/presentation/views/base/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export * from './Layout';
export * from './Form';
export * from './Pagination';
export * from './Sheet';
export * from './Chart';
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
ErrorView,
LoadingView,
VictoryChart,
VictoryTheme,
VictoryLine,
VictoryTooltip,
VictoryScatter,
VictoryAxis,
VictoryLegend,
VictoryZoomContainer,
} from 'victory';
import { ErrorView, LoadingView } from '../../../base';
} from '../../../base';
import { Button, H6, XStack, YStack } from 'tamagui';

type GroupBy = 'date' | 'month';
Expand Down Expand Up @@ -58,7 +58,6 @@ export const TransactionStatisticView = ({
width={600}
height={300}
padding={{ top: 50, bottom: 50, left: 80, right: 50 }}
containerComponent={<VictoryZoomContainer />}
>
<VictoryLine
style={{
Expand All @@ -72,30 +71,18 @@ export const TransactionStatisticView = ({
data: { stroke: '#24c48e' },
parent: { border: '1px solid #ccc' },
}}
// data={statistics.map((statistic) => ({
// y: statistic.totalIncome,
// x: statistic.date,
// }))}
data={totalIncomeStatistics}
/>
<VictoryScatter
style={{ data: { fill: '#3189c4' } }}
size={3}
// data={statistics.map((statistic) => ({
// y: statistic.total,
// x: statistic.date,
// }))}
size={6}
data={totalStatistics}
labels={({ datum }) => `[Total] Date: ${datum.x} Total: ${datum.y}`}
labelComponent={<VictoryTooltip constrainToVisibleArea />}
/>
<VictoryScatter
style={{ data: { fill: '#24c48e' } }}
size={3}
// data={statistics.map((statistic) => ({
// y: statistic.totalIncome,
// x: statistic.date,
// }))}
size={6}
data={totalIncomeStatistics}
labels={({ datum }) => `[Income] Date: ${datum.x} Total: ${datum.y}`}
labelComponent={<VictoryTooltip constrainToVisibleArea />}
Expand Down

0 comments on commit 57351b2

Please sign in to comment.