uber / react-vis

Data Visualization Components
https://uber.github.io/react-vis
MIT License
8.73k stars 835 forks source link

Chart not accurate #1432

Open lishine opened 3 years ago

lishine commented 3 years ago

Cannot figure out why chart with react-vis differ so much from same chart with recharts. Why it is so wrong? And different curves didn't help... This is a price chart. I compared it to an external program - Tradingview and the recharts is pretty accurate. Cannot understand what is wrong. Pictures are attached

time is in ms

            <XYPlot getX={(d: any) => d.time} getY={(d: any) => d.price} width={1900} height={880}>
                <Line
                    data={dataSnap.data as any[]}
                    size={3}
                    fill='blue'
                    // curve='curveLinear'
                />
                <XAxis
                    // tickValues={data.map((d) => d.timestamp)}
                    tickTotal={10}
                    tickFormat={(v) => {
                        return dayjs(v).format('mm')
                        // return dayjs(v).format('HH-mm-ss-sss')
                    }}

                    // tickTotal={100}
                />
                <YAxis width={70} tickTotal={10} />
            </XYPlot>
lishine commented 3 years ago

React-vis

image

lishine commented 3 years ago

Recharts

image

lishine commented 3 years ago

Tradingview

image