Open homerokzam opened 11 months ago
evaluator.ts:157 Uncaught TypeError: Cannot read properties of undefined (reading 'invert')
Simple line chart plot
node: v20.5.0 react: "^18.2.0"
import { ChartCanvas, Chart, LineSeries, CandlestickSeries, XAxis, YAxis, discontinuousTimeScaleProvider } from "react-financial-charts";
const CustomChartCanvas = (props) => { const ohlcData = props.data.map(item => ({ date: new Date(item.Date), open: item.Open, high: item.High, low: item.Low, close: item.Close, volume: item.Volume }));
// console.log(ohlcData);
return ( <> {ohlcData && ( <ChartCanvas height={400} width={800} ratio={3} type={'svg'} margin={{ left: 50, right: 50, top: 10, bottom: 30 }} data={ohlcData} seriesName="OHLC" xAccessor={d => d.date} xScaleProvider={discontinuousTimeScaleProvider} xExtents={[ohlcData[0].date, ohlcData[ohlcData.length - 1].date]} > <Chart id={1} yExtents={d => [d.high, d.low]}>
<YAxis /> <LineSeries yAccessor={d => d.close} /> </Chart> </ChartCanvas> )} </>
) }
export default CustomChartCanvas;
I'm submitting a...
What is the current behavior
evaluator.ts:157 Uncaught TypeError: Cannot read properties of undefined (reading 'invert')
What is the expected behavior
Simple line chart plot
Please tell us about your environment
node: v20.5.0 react: "^18.2.0"
Other information
import { ChartCanvas, Chart, LineSeries, CandlestickSeries, XAxis, YAxis, discontinuousTimeScaleProvider } from "react-financial-charts";
const CustomChartCanvas = (props) => { const ohlcData = props.data.map(item => ({ date: new Date(item.Date), open: item.Open, high: item.High, low: item.Low, close: item.Close, volume: item.Volume }));
// console.log(ohlcData);
return ( <> {ohlcData && ( <ChartCanvas height={400} width={800} ratio={3} type={'svg'} margin={{ left: 50, right: 50, top: 10, bottom: 30 }} data={ohlcData} seriesName="OHLC" xAccessor={d => d.date} xScaleProvider={discontinuousTimeScaleProvider} xExtents={[ohlcData[0].date, ohlcData[ohlcData.length - 1].date]} > <Chart id={1} yExtents={d => [d.high, d.low]}>
) }
export default CustomChartCanvas;