We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No type errors, but when rendering this error is thrown.
"react-charts": "3.0.0-beta.54"
import { Chart as GoogleChart } from "react-google-charts"; import { AxisOptions, Chart as ReactChart } from 'react-charts'; ... function TemperatureChartReact({ normals }: { normals: Record<Month, { tmin: number, tmax: number }> }) { type Temperature = { month: Month, temperature: number, } type Series = { label: string, data: Temperature[] } const data = useMemo(() => { return Object .entries(normals) .map(([month, normal]) =>({ month: Number.parseInt(month) as Month, temperature: normal.tmax })) }, [normals]) const series: Series[] = [ { label: 'Temperature', data } ] const primaryAxis = React.useMemo( (): AxisOptions<Temperature> => ({ getValue: datum => datum.month }), [] ) const secondaryAxes = React.useMemo( (): AxisOptions<Temperature>[] => [ { getValue: datum => datum.temperature } ], [] ) return ( <ReactChart options={{ data: series, primaryAxis, secondaryAxes }} /> ) }
Series object
[ { label: 'Temperature', data: [ { month: 1, temperature: 22.46 }, { month: 2, temperature: 24.56 }, { month: 3, temperature: 26.67 }, { month: 4, temperature: 29.56 }, { month: 5, temperature: 32.25 }, { month: 6, temperature: 33.48 }, { month: 7, temperature: 33.14 }, { month: 8, temperature: 32.59 }, { month: 9, temperature: 31.46 }, { month: 10, temperature: 29.36 }, { month: 11, temperature: 27.36 }, { month: 12, temperature: 24.04 } ] } ]
The text was updated successfully, but these errors were encountered:
I am facing the same issue, has anyone been able to resolve this?
Sorry, something went wrong.
No branches or pull requests
No type errors, but when rendering this error is thrown.
"react-charts": "3.0.0-beta.54"
Series object
The text was updated successfully, but these errors were encountered: