parent
d23d489ec0
commit
5d5f586f7f
10
Chart.tsx
10
Chart.tsx
|
@ -2,9 +2,11 @@ import * as shape from 'd3-shape';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {View} from 'react-native';
|
import {View} from 'react-native';
|
||||||
import {Grid, LineChart, XAxis, YAxis} from 'react-native-svg-charts';
|
import {Grid, LineChart, XAxis, YAxis} from 'react-native-svg-charts';
|
||||||
|
import {CombinedDarkTheme, CombinedDefaultTheme} from './App';
|
||||||
import {useColor} from './color';
|
import {useColor} from './color';
|
||||||
import {MARGIN, PADDING} from './constants';
|
import {MARGIN, PADDING} from './constants';
|
||||||
import Set from './set';
|
import Set from './set';
|
||||||
|
import useDark from './use-dark';
|
||||||
|
|
||||||
export default function Chart({
|
export default function Chart({
|
||||||
yData,
|
yData,
|
||||||
|
@ -18,7 +20,13 @@ export default function Chart({
|
||||||
yFormat: (value: any) => string;
|
yFormat: (value: any) => string;
|
||||||
}) {
|
}) {
|
||||||
const {color} = useColor();
|
const {color} = useColor();
|
||||||
const axesSvg = {fontSize: 10, fill: 'grey'};
|
const dark = useDark();
|
||||||
|
const axesSvg = {
|
||||||
|
fontSize: 10,
|
||||||
|
fill: dark
|
||||||
|
? CombinedDarkTheme.colors.text
|
||||||
|
: CombinedDefaultTheme.colors.text,
|
||||||
|
};
|
||||||
const verticalContentInset = {top: 10, bottom: 10};
|
const verticalContentInset = {top: 10, bottom: 10};
|
||||||
const xAxisHeight = 30;
|
const xAxisHeight = 30;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user