Skip to content
New issue

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

Simple chart plotting only 'close' of a stock #697

Open
2 tasks
homerokzam opened this issue Oct 21, 2023 · 0 comments
Open
2 tasks

Simple chart plotting only 'close' of a stock #697

homerokzam opened this issue Oct 21, 2023 · 0 comments

Comments

@homerokzam
Copy link

homerokzam commented Oct 21, 2023

I'm submitting a...

  • [X ] bug
  • feature
  • chore

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"

  • Version: 1.1.0
  • Browser: [all | Chrome XX | Firefox XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari ]
  • Chrome: Version 118.0.5993.70 (Official Build) (arm64)

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]}>

          <LineSeries yAccessor={d => d.close} />
      </Chart>
    </ChartCanvas>
  )}
</>

)
}

export default CustomChartCanvas;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant