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
Describe the bug
The decimal fraction of the values in the chart corresponding to the y-axis is not regular. ex) 1.4200, 1.32, 1.2200 ...
This is a formatter that applies logic that cuts the decimal point. We checked that the input and output values are output normally.
However, the priceFormat function within the addCandlestickSeries indicates an irregular decimal length.
To Reproduce
// LWchart.tsx <Chart options={options} candlestickSeries={[{ data: chart }]} autoWidth height={380} onCrosshairMove={(param) => handleCrosshairMoved(param, chart[chart.length - 1])} chartRef={(chart) => { chart.timeScale().fitContent(); // chart.timeScale().scrollToPosition(2, true); chart.addCandlestickSeries({ priceFormat: { type: "custom", formatter: (priceValue) => { return decimalSplit(priceValue); }, minMove: 0.0000000001, }, }); }} /> // decimalSplit.ts export const decimalSplit = (value: string | number) => { // return value; if (!value) return "0"; const splitStr = String(value).split("."); if (!splitStr[1]) return splitStr[0]; if (Number(splitStr[0]) > 10) { return `${splitStr[0]}.${splitStr[1].slice(0, 2)}`; } else if (Number(splitStr[0]) > 0) { return `${splitStr[0]}.${splitStr[1].slice(0, 4)}`; } else { return `${splitStr[0]}.${splitStr[1].slice(0, 8)}`; } };
Github code => https://github.com/perifinance/peri.dex/blob/main/src/screens/Chart/LWchart.tsx
Expected behavior
The values on the y-axis must be numbers of regular length
Screenshots
Additional context
There was no problem with the input output value through the logic I made myself. An issue occurs in the view group only through priceFormat.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
The decimal fraction of the values in the chart corresponding to the y-axis is not regular.
ex) 1.4200, 1.32, 1.2200 ...
This is a formatter that applies logic that cuts the decimal point. We checked that the input and output values are output normally.
However, the priceFormat function within the addCandlestickSeries indicates an irregular decimal length.
To Reproduce
Github code => https://github.com/perifinance/peri.dex/blob/main/src/screens/Chart/LWchart.tsx
Expected behavior
The values on the y-axis must be numbers of regular length
Screenshots

Additional context
There was no problem with the input output value through the logic I made myself.
An issue occurs in the view group only through priceFormat.
The text was updated successfully, but these errors were encountered: