Skip to content

Commit 2c20b14

Browse files
committed
add params custom formatting
1 parent 403c4fb commit 2c20b14

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/oraidex-common-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@oraichain/oraidex-common-ui",
3-
"version": "1.0.31",
3+
"version": "1.0.32",
44
"files": [
55
"dist/"
66
],

packages/oraidex-common-ui/src/components/TVChartContainer/TVChartContainer.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ export type TVChartContainerProsp = {
5555
}>;
5656
customExchangeName?: string;
5757
customOverrideChartProps?: Overrides;
58+
customFormatters?: {
59+
priceFormatterFactory?: (symbolInfo: any, minTick: any) => any;
60+
};
5861
};
5962

6063
export default function TVChartContainer({
@@ -70,7 +73,8 @@ export default function TVChartContainer({
7073
customPeriodConfig,
7174
customTimeFrames,
7275
customExchangeName,
73-
customOverrideChartProps
76+
customOverrideChartProps,
77+
customFormatters
7478
}: TVChartContainerProsp) {
7579
const chartContainerRef = useRef<HTMLDivElement | null>(null);
7680
const tvWidgetRef = useRef<IChartingLibraryWidget | null>(null);
@@ -150,6 +154,9 @@ export default function TVChartContainer({
150154
...defaultChartProps.overrides,
151155
...(customOverrideChartProps || {})
152156
},
157+
custom_formatters: {
158+
...(customFormatters || {})
159+
},
153160
debug: true,
154161
timezone: getTradingViewTimeZone(),
155162
symbol: symbolRef.current, // Using ref to avoid unnecessary re-renders on symbol change and still have access to the latest symbol

0 commit comments

Comments
 (0)