react-native-financial-charts 1.0.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -225
- package/lib/module/charts/BarChart/BarChartContext.js +246 -0
- package/lib/module/charts/BarChart/BarChartContext.js.map +1 -0
- package/lib/module/charts/BarChart/components/BarChartBar.js +252 -0
- package/lib/module/charts/BarChart/components/BarChartBar.js.map +1 -0
- package/lib/module/charts/BarChart/components/BarChartCanvas.js +143 -0
- package/lib/module/charts/BarChart/components/BarChartCanvas.js.map +1 -0
- package/lib/module/charts/BarChart/components/BarChartGrid.js +48 -0
- package/lib/module/charts/BarChart/components/BarChartGrid.js.map +1 -0
- package/lib/module/charts/BarChart/components/BarChartSkeleton.js +55 -0
- package/lib/module/charts/BarChart/components/BarChartSkeleton.js.map +1 -0
- package/lib/module/charts/BarChart/components/BarChartTooltip.js +218 -0
- package/lib/module/charts/BarChart/components/BarChartTooltip.js.map +1 -0
- package/lib/module/charts/BarChart/components/BarChartYAxis.js +65 -0
- package/lib/module/charts/BarChart/components/BarChartYAxis.js.map +1 -0
- package/lib/module/charts/BarChart/constants.js +5 -0
- package/lib/module/charts/BarChart/constants.js.map +1 -0
- package/lib/module/charts/BarChart/interfaces.js.map +1 -0
- package/lib/module/charts/BarChart/utils.js +52 -0
- package/lib/module/charts/BarChart/utils.js.map +1 -0
- package/lib/module/{ChartContext.js → charts/LineChart/LineChartContext.js} +4 -4
- package/lib/module/charts/LineChart/LineChartContext.js.map +1 -0
- package/lib/module/{components → charts/LineChart/components}/ChartArea.js +1 -1
- package/lib/module/charts/LineChart/components/ChartArea.js.map +1 -0
- package/lib/module/{components → charts/LineChart/components}/ChartBaseline.js +1 -1
- package/lib/module/charts/LineChart/components/ChartBaseline.js.map +1 -0
- package/lib/module/{components → charts/LineChart/components}/ChartCanvas.js +1 -1
- package/lib/module/charts/LineChart/components/ChartCanvas.js.map +1 -0
- package/lib/module/{components → charts/LineChart/components}/ChartCursor.js +1 -1
- package/lib/module/charts/LineChart/components/ChartCursor.js.map +1 -0
- package/lib/module/{components → charts/LineChart/components}/ChartLine.js +1 -1
- package/lib/module/charts/LineChart/components/ChartLine.js.map +1 -0
- package/lib/module/{components → charts/LineChart/components}/ChartTooltipDate.js +2 -2
- package/lib/module/charts/LineChart/components/ChartTooltipDate.js.map +1 -0
- package/lib/module/{components → charts/LineChart/components}/ChartTooltipValue.js +2 -2
- package/lib/module/charts/LineChart/components/ChartTooltipValue.js.map +1 -0
- package/lib/module/charts/LineChart/interfaces.js +4 -0
- package/lib/module/charts/LineChart/interfaces.js.map +1 -0
- package/lib/module/index.js +34 -19
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/charts/BarChart/BarChartContext.d.ts +48 -0
- package/lib/typescript/src/charts/BarChart/BarChartContext.d.ts.map +1 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartBar.d.ts +41 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartBar.d.ts.map +1 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartCanvas.d.ts +8 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartCanvas.d.ts.map +1 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartGrid.d.ts +23 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartGrid.d.ts.map +1 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartSkeleton.d.ts +3 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartSkeleton.d.ts.map +1 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartTooltip.d.ts +20 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartTooltip.d.ts.map +1 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartYAxis.d.ts +40 -0
- package/lib/typescript/src/charts/BarChart/components/BarChartYAxis.d.ts.map +1 -0
- package/lib/typescript/src/charts/BarChart/constants.d.ts +3 -0
- package/lib/typescript/src/charts/BarChart/constants.d.ts.map +1 -0
- package/lib/typescript/src/charts/BarChart/interfaces.d.ts +55 -0
- package/lib/typescript/src/charts/BarChart/interfaces.d.ts.map +1 -0
- package/lib/typescript/src/charts/BarChart/utils.d.ts +11 -0
- package/lib/typescript/src/charts/BarChart/utils.d.ts.map +1 -0
- package/lib/typescript/src/charts/LineChart/LineChartContext.d.ts +16 -0
- package/lib/typescript/src/charts/LineChart/LineChartContext.d.ts.map +1 -0
- package/lib/typescript/src/charts/LineChart/components/ChartArea.d.ts.map +1 -0
- package/lib/typescript/src/charts/LineChart/components/ChartBaseline.d.ts.map +1 -0
- package/lib/typescript/src/charts/LineChart/components/ChartCanvas.d.ts.map +1 -0
- package/lib/typescript/src/charts/LineChart/components/ChartCursor.d.ts.map +1 -0
- package/lib/typescript/src/charts/LineChart/components/ChartLine.d.ts.map +1 -0
- package/lib/typescript/src/charts/LineChart/components/ChartTooltipDate.d.ts.map +1 -0
- package/lib/typescript/src/charts/LineChart/components/ChartTooltipValue.d.ts.map +1 -0
- package/lib/typescript/src/{interfaces.d.ts → charts/LineChart/interfaces.d.ts} +3 -3
- package/lib/typescript/src/charts/LineChart/interfaces.d.ts.map +1 -0
- package/lib/typescript/src/components/AnimatedTextInput.d.ts +1 -1
- package/lib/typescript/src/components/AnimatedTextInput.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +28 -10
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/charts/BarChart/BarChartContext.tsx +338 -0
- package/src/charts/BarChart/components/BarChartBar.tsx +423 -0
- package/src/charts/BarChart/components/BarChartCanvas.tsx +143 -0
- package/src/charts/BarChart/components/BarChartGrid.tsx +70 -0
- package/src/charts/BarChart/components/BarChartSkeleton.tsx +68 -0
- package/src/charts/BarChart/components/BarChartTooltip.tsx +280 -0
- package/src/charts/BarChart/components/BarChartYAxis.tsx +120 -0
- package/src/charts/BarChart/constants.ts +2 -0
- package/src/charts/BarChart/interfaces.ts +74 -0
- package/src/charts/BarChart/utils.ts +61 -0
- package/src/{ChartContext.tsx → charts/LineChart/LineChartContext.tsx} +8 -7
- package/src/{components → charts/LineChart/components}/ChartArea.tsx +1 -1
- package/src/{components → charts/LineChart/components}/ChartBaseline.tsx +1 -1
- package/src/{components → charts/LineChart/components}/ChartCanvas.tsx +1 -1
- package/src/{components → charts/LineChart/components}/ChartCursor.tsx +1 -1
- package/src/{components → charts/LineChart/components}/ChartLine.tsx +1 -1
- package/src/{components → charts/LineChart/components}/ChartTooltipDate.tsx +2 -2
- package/src/{components → charts/LineChart/components}/ChartTooltipValue.tsx +2 -2
- package/src/{interfaces.ts → charts/LineChart/interfaces.ts} +3 -3
- package/src/components/AnimatedTextInput.tsx +1 -1
- package/src/index.tsx +40 -19
- package/lib/module/ChartContext.js.map +0 -1
- package/lib/module/components/ChartArea.js.map +0 -1
- package/lib/module/components/ChartBaseline.js.map +0 -1
- package/lib/module/components/ChartCanvas.js.map +0 -1
- package/lib/module/components/ChartCursor.js.map +0 -1
- package/lib/module/components/ChartLine.js.map +0 -1
- package/lib/module/components/ChartTooltipDate.js.map +0 -1
- package/lib/module/components/ChartTooltipValue.js.map +0 -1
- package/lib/module/interfaces.js.map +0 -1
- package/lib/typescript/src/ChartContext.d.ts +0 -16
- package/lib/typescript/src/ChartContext.d.ts.map +0 -1
- package/lib/typescript/src/components/ChartArea.d.ts.map +0 -1
- package/lib/typescript/src/components/ChartBaseline.d.ts.map +0 -1
- package/lib/typescript/src/components/ChartCanvas.d.ts.map +0 -1
- package/lib/typescript/src/components/ChartCursor.d.ts.map +0 -1
- package/lib/typescript/src/components/ChartLine.d.ts.map +0 -1
- package/lib/typescript/src/components/ChartTooltipDate.d.ts.map +0 -1
- package/lib/typescript/src/components/ChartTooltipValue.d.ts.map +0 -1
- package/lib/typescript/src/interfaces.d.ts.map +0 -1
- /package/lib/module/{interfaces.js → charts/BarChart/interfaces.js} +0 -0
- /package/lib/typescript/src/{components → charts/LineChart/components}/ChartArea.d.ts +0 -0
- /package/lib/typescript/src/{components → charts/LineChart/components}/ChartBaseline.d.ts +0 -0
- /package/lib/typescript/src/{components → charts/LineChart/components}/ChartCanvas.d.ts +0 -0
- /package/lib/typescript/src/{components → charts/LineChart/components}/ChartCursor.d.ts +0 -0
- /package/lib/typescript/src/{components → charts/LineChart/components}/ChartLine.d.ts +0 -0
- /package/lib/typescript/src/{components → charts/LineChart/components}/ChartTooltipDate.d.ts +0 -0
- /package/lib/typescript/src/{components → charts/LineChart/components}/ChartTooltipValue.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# 📈 React Native Financial Charts
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
|
|
4
|
+
<img src="./docs/assets/0.gif" alt="Interactive Line Chart" width="49%" />
|
|
5
|
+
<img src="./docs/assets/barchart/0.gif" alt="Interactive Bar Chart" width="49%" />
|
|
5
6
|
</p>
|
|
6
7
|
|
|
7
8
|
A **high-performance** financial charting library for React Native, built on the power of **Skia** and **Reanimated**.
|
|
@@ -30,250 +31,114 @@ yarn add @shopify/react-native-skia react-native-reanimated react-native-gesture
|
|
|
30
31
|
> If you are using Expo Go, ensure that the Skia and Reanimated versions are compatible with your SDK.
|
|
31
32
|
> It's recommended using **Development Builds** (`npx expo run:android`) for the best performance.
|
|
32
33
|
|
|
33
|
-
##
|
|
34
|
+
## 📊 Components
|
|
35
|
+
|
|
36
|
+
### 1. Bar Chart (New in v2.0)
|
|
37
|
+
|
|
38
|
+
A high-performance bar chart with virtualization, scrolling, and rich interactivity.
|
|
34
39
|
|
|
35
40
|
```tsx
|
|
36
|
-
import
|
|
37
|
-
import { View } from 'react-native';
|
|
38
|
-
import { Chart } from 'react-native-financial-charts';
|
|
41
|
+
import { BarChart } from 'react-native-financial-charts';
|
|
39
42
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
40
43
|
|
|
41
|
-
const data = [
|
|
42
|
-
{
|
|
43
|
-
{
|
|
44
|
-
{
|
|
45
|
-
{
|
|
44
|
+
const data: BarChartItemDataInterface[] = [
|
|
45
|
+
{ label: 'Food 123 ABC', value: 1200, color: '#FF6B6B' }, // Red for expenses
|
|
46
|
+
{ label: 'Transport', value: 800, color: '#4ECDC4' }, // Teal
|
|
47
|
+
{ label: 'Invest', value: 3500, color: '#1A535C' }, // Dark Blue for savings
|
|
48
|
+
{ label: 'Invest', value: 3800, color: '#1A535C' }, // Dark Blue for savings
|
|
49
|
+
{ label: 'Rent', value: 2100, color: '#FFE66D' }, // Yellow
|
|
46
50
|
];
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
const App = () => {
|
|
49
53
|
return (
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
55
|
+
<BarChart.Root
|
|
56
|
+
data={data}
|
|
57
|
+
width={390}
|
|
58
|
+
selectable
|
|
59
|
+
showXAxis
|
|
60
|
+
scrollToTheEnd
|
|
61
|
+
>
|
|
62
|
+
<BarChart.Canvas>
|
|
63
|
+
<BarChart.Grid />
|
|
64
|
+
<BarChart.Bar />
|
|
65
|
+
<BarChart.ToolTip
|
|
66
|
+
format={(value) => {
|
|
67
|
+
'worklet';
|
|
68
|
+
return value.toString();
|
|
69
|
+
}}
|
|
70
|
+
/>
|
|
71
|
+
<BarChart.YAxis labelColor="#FFF" labelBackgroundColor="#696969" />
|
|
72
|
+
</BarChart.Canvas>
|
|
73
|
+
</BarChart.Root>
|
|
74
|
+
</GestureHandlerRootView>
|
|
66
75
|
);
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## 💡 Examples
|
|
71
|
-
|
|
72
|
-
Here are some common patterns to customize the chart to your needs.
|
|
73
|
-
|
|
74
|
-
### 1. Custom Colors (The "Bitcoin" Look)
|
|
75
|
-
|
|
76
|
-
Customize the line color and the area gradient to match specific assets (e.g., Orange for BTC, Blue for ETH).
|
|
77
|
-
|
|
78
|
-
```tsx
|
|
79
|
-
<Chart.Root data={data}>
|
|
80
|
-
<Chart.Canvas>
|
|
81
|
-
<Chart.Area
|
|
82
|
-
// Gradient from transparent Orange to transparent
|
|
83
|
-
gradientColors={['#F7931A50', '#F7931A00']}
|
|
84
|
-
/>
|
|
85
|
-
<Chart.Line
|
|
86
|
-
colors={['#F7931A']} // Solid Orange
|
|
87
|
-
strokeWidth={4}
|
|
88
|
-
/>
|
|
89
|
-
<Chart.Cursor crosshairColor="#F7931A" />
|
|
90
|
-
</Chart.Canvas>
|
|
91
|
-
</Chart.Root>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-

|
|
95
|
-
|
|
96
|
-
### 2. Minimal Sparkline
|
|
97
|
-
|
|
98
|
-
A small, simplified chart without tooltips or padding, perfect for lists or crypto tickers.
|
|
99
|
-
|
|
100
|
-
```tsx
|
|
101
|
-
<Chart.Root
|
|
102
|
-
data={data}
|
|
103
|
-
height={60}
|
|
104
|
-
width={120}
|
|
105
|
-
padding={0} // Remove padding to touch edges
|
|
106
|
-
>
|
|
107
|
-
<Chart.Canvas>
|
|
108
|
-
<Chart.Line
|
|
109
|
-
strokeWidth={2}
|
|
110
|
-
colors={['#10B981', '#10B981', '#10B981', '#10B981']}
|
|
111
|
-
/>
|
|
112
|
-
</Chart.Canvas>
|
|
113
|
-
{/* No Tooltips, no Cursor */}
|
|
114
|
-
</Chart.Root>
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-

|
|
118
|
-
|
|
119
|
-
### 3. Custom Currency Formatting (USD/EUR)
|
|
120
|
-
|
|
121
|
-
Use a Worklet to format values dynamically on the UI thread.
|
|
122
|
-
|
|
123
|
-
```tsx
|
|
124
|
-
const formatUSD = (value: number) => {
|
|
125
|
-
'worklet';
|
|
126
|
-
return `$ ${value.toFixed(2)}`;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const formatEUR = (value: number) => {
|
|
130
|
-
'worklet';
|
|
131
|
-
return `€ ${value.toFixed(2).replace('.', ',')}`;
|
|
132
76
|
};
|
|
133
|
-
|
|
134
|
-
// Usage
|
|
135
|
-
<Chart.Root data={data}>
|
|
136
|
-
<Chart.Canvas>
|
|
137
|
-
<Chart.Area />
|
|
138
|
-
<Chart.Line />
|
|
139
|
-
<Chart.Cursor />
|
|
140
|
-
</Chart.Canvas>
|
|
141
|
-
<Chart.ToolTip.Value format={formatUSD} />
|
|
142
|
-
</Chart.Root>;
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-

|
|
146
|
-
|
|
147
|
-
### 4. Customizing the Tooltip Style
|
|
148
|
-
|
|
149
|
-
Change the background color and border radius of the floating tooltip.
|
|
150
|
-
|
|
151
|
-
```tsx
|
|
152
|
-
<Chart.Root data={data}>
|
|
153
|
-
<Chart.Canvas>
|
|
154
|
-
<Chart.Area />
|
|
155
|
-
<Chart.Line />
|
|
156
|
-
<Chart.Cursor />
|
|
157
|
-
</Chart.Canvas>
|
|
158
|
-
<Chart.Tooltip.Value
|
|
159
|
-
containerStyle={{
|
|
160
|
-
backgroundColor: 'white',
|
|
161
|
-
borderRadius: 4,
|
|
162
|
-
borderWidth: 1,
|
|
163
|
-
borderColor: '#E5E7EB',
|
|
164
|
-
}}
|
|
165
|
-
style={{
|
|
166
|
-
color: 'black',
|
|
167
|
-
fontSize: 14,
|
|
168
|
-
}}
|
|
169
|
-
/>
|
|
170
|
-
</Chart.Root>
|
|
171
77
|
```
|
|
172
78
|
|
|
173
|
-
|
|
79
|
+
[Read the full BarChart Documentation](./docs/BarChartDocs.md) (Includes API Reference, Scrolling, Y-Axis customization, and more)
|
|
174
80
|
|
|
175
|
-
|
|
81
|
+
<img src="./docs/assets/barchart/0.gif" alt="Interactive Line" />
|
|
176
82
|
|
|
177
|
-
###
|
|
83
|
+
### 2. Line Chart
|
|
178
84
|
|
|
179
|
-
The
|
|
85
|
+
The classic interactive line chart for financial data.
|
|
180
86
|
|
|
181
|
-
|
|
182
|
-
| ---------------- | ------------- | -------------- | ---------------------------------------- |
|
|
183
|
-
| `data` | `DataPoint[]` | **Required** | `{ timestamp: number, value: number }[]` |
|
|
184
|
-
| `height` | `number` | `250` | Total height of the chart |
|
|
185
|
-
| `width` | `number` | `Screen Width` | Total width of the chart |
|
|
186
|
-
| `padding` | `number` | `20` | Internal horizontal padding |
|
|
187
|
-
| `containerStyle` | `ViewStyle` | `{}` | Styles for the main container |
|
|
87
|
+
[Read the full LineChart Documentation](./docs/LineChartDocs.md) (Includes API Reference, Areas, Baselines, and Advanced Tooltips)
|
|
188
88
|
|
|
189
|
-
|
|
89
|
+
<img src="./docs/assets/0.gif" alt="Interactive Line" />
|
|
190
90
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
| ---------- | ----------------- | ------- | --------------------------------------- |
|
|
195
|
-
| `children` | `React.ReactNode` | - - - | Children element. Must be Skia elements |
|
|
196
|
-
|
|
197
|
-
### `<Chart.Line />`
|
|
198
|
-
|
|
199
|
-
Draws the main chart line.
|
|
200
|
-
|
|
201
|
-
| Prop | Type | Default | Description |
|
|
202
|
-
| ------------- | ---------- | ---------------------------------------------- | ------------------------------ |
|
|
203
|
-
| `strokeWidth` | `number` | `3` | Line thickness |
|
|
204
|
-
| `colors` | `string[]` | `['#00E396', '#00E396', '#EA3943', '#EA3943']` | Gradient colors (Top → Bottom) |
|
|
205
|
-
|
|
206
|
-
### `<Chart.Baseline />`
|
|
207
|
-
|
|
208
|
-
Draws a dashed horizontal line at the starting value (baseline). Useful for visualizing profit/loss.
|
|
209
|
-
|
|
210
|
-
| Prop | Type | Default | Description |
|
|
211
|
-
| ----------- | --------- | --------- | -------------------------------------------------------- |
|
|
212
|
-
| `color` | `string` | `#858CA2` | Color of the dashed line and starting dot. |
|
|
213
|
-
| `showLabel` | `boolean` | `true` | Whether to show the label chip with the formatted value. |
|
|
214
|
-
|
|
215
|
-
### `<Chart.Area />`
|
|
216
|
-
|
|
217
|
-
Draws the gradient fill below the line.
|
|
218
|
-
|
|
219
|
-
| Prop | Type | Default | Description |
|
|
220
|
-
| ---------------- | ---------- | ---------------------------------- | -------------------------------------------------------------------------------- |
|
|
221
|
-
| `gradientColors` | `string[]` | `['#000', '#000', '#000', '#000']` | Array of 4 colors for the area gradient (Top -> Baseline -> Baseline -> Bottom). |
|
|
222
|
-
|
|
223
|
-
### `<Chart.Cursor />`
|
|
224
|
-
|
|
225
|
-
The interactive cursor that follows the finger.
|
|
226
|
-
|
|
227
|
-
| Prop | Type | Default | Description |
|
|
228
|
-
| ---------------- | -------- | --------- | ------------------------------------ |
|
|
229
|
-
| `crosshairColor` | `string` | `'white'` | Color of the vertical line |
|
|
230
|
-
| `circleColor` | `string` | `'white'` | Border color of the indicator circle |
|
|
231
|
-
|
|
232
|
-
### `<Chart.Tooltip.Value />`
|
|
233
|
-
|
|
234
|
-
Displays the current interpolated value (price, score, etc).
|
|
235
|
-
|
|
236
|
-
| Prop | Type | Default | Description |
|
|
237
|
-
| ---------------- | --------------------------- | -------- | ----------------------- |
|
|
238
|
-
| `format` | `(value: number) => string` | `$ 0.00` | Format function |
|
|
239
|
-
| `style` | `TextStyle` | `{}` | Inner text style |
|
|
240
|
-
| `containerStyle` | `ViewStyle` | `{}` | Tooltip container style |
|
|
241
|
-
|
|
242
|
-
### `<Chart.Tooltip.Date />`
|
|
243
|
-
|
|
244
|
-
Displays the current date/time.
|
|
245
|
-
|
|
246
|
-
| Prop | Type | Default | Description |
|
|
247
|
-
| ---------------- | --------------------------- | ------------ | ----------------------- |
|
|
248
|
-
| `style` | `TextStyle` | `{}` | Inner text style |
|
|
249
|
-
| `containerStyle` | `ViewStyle` | `{}` | Tooltip container style |
|
|
250
|
-
| `format` | `(value: number) => string` | `DD/MM/YYYY` | Timestamp formatter |
|
|
251
|
-
|
|
252
|
-
## 🎨 Advanced Customization
|
|
91
|
+
```tsx
|
|
92
|
+
import { LineChart } from 'react-native-financial-charts';
|
|
93
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
253
94
|
|
|
254
|
-
|
|
95
|
+
const data = [
|
|
96
|
+
{
|
|
97
|
+
timestamp: new Date('2025-11-18T10:00:00').getTime(),
|
|
98
|
+
value: 468500.2,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
timestamp: new Date('2025-11-19T10:00:00').getTime(),
|
|
102
|
+
value: 471200.5,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
timestamp: new Date('2025-11-20T10:00:00').getTime(),
|
|
106
|
+
value: 465800.1,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
timestamp: new Date('2025-11-21T10:00:00').getTime(),
|
|
110
|
+
value: 459900.0,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
timestamp: new Date('2025-11-22T10:00:00').getTime(),
|
|
114
|
+
value: 462300.75,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
timestamp: new Date('2025-11-23T10:00:00').getTime(),
|
|
118
|
+
value: 469100.3,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
timestamp: new Date('2025-11-24T10:00:00').getTime(),
|
|
122
|
+
value: 472569.81,
|
|
123
|
+
},
|
|
124
|
+
];
|
|
255
125
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
126
|
+
const App = () => {
|
|
127
|
+
return (
|
|
128
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
129
|
+
<LineChart.Root data={data} width={400}>
|
|
130
|
+
<LineChart.Canvas>
|
|
131
|
+
<LineChart.Area />
|
|
132
|
+
<LineChart.Baseline />
|
|
133
|
+
<LineChart.Line />
|
|
134
|
+
<LineChart.Cursor />
|
|
135
|
+
</LineChart.Canvas>
|
|
136
|
+
<LineChart.Tooltip.Value />
|
|
137
|
+
<LineChart.Tooltip.Date />
|
|
138
|
+
</LineChart.Root>
|
|
139
|
+
</GestureHandlerRootView>
|
|
140
|
+
);
|
|
260
141
|
};
|
|
261
|
-
|
|
262
|
-
<Chart.Tooltip.Value format={formatUSD} />;
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
### Styling the Container
|
|
266
|
-
|
|
267
|
-
```tsx
|
|
268
|
-
<Chart.Root
|
|
269
|
-
data={data}
|
|
270
|
-
containerStyle={{
|
|
271
|
-
backgroundColor: '#1E1E2D',
|
|
272
|
-
borderRadius: 20,
|
|
273
|
-
borderWidth: 1,
|
|
274
|
-
borderColor: '#333',
|
|
275
|
-
}}
|
|
276
|
-
>
|
|
277
142
|
```
|
|
278
143
|
|
|
279
144
|
## 🐛 Troubleshooting
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { createContext, useContext, useEffect, useImperativeHandle, useMemo } from 'react';
|
|
4
|
+
import { Easing, useAnimatedRef, useScrollViewOffset, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
5
|
+
import { matchFont } from '@shopify/react-native-skia';
|
|
6
|
+
import { BAR_CHART_PADDING_LEFT, BAR_CHART_PADDING_RIGHT } from "./constants.js";
|
|
7
|
+
import { calculateNiceScale } from "./utils.js";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const LABEL_PADDING_TOP = 4;
|
|
10
|
+
const APPROX_FONT_HEIGHT = 18;
|
|
11
|
+
export const BarChartContext = /*#__PURE__*/createContext(undefined);
|
|
12
|
+
const BarChartProvider = ({
|
|
13
|
+
data,
|
|
14
|
+
isLoading = false,
|
|
15
|
+
width = 300,
|
|
16
|
+
height = 300,
|
|
17
|
+
barWidth = 32,
|
|
18
|
+
spacing = 12,
|
|
19
|
+
barColor = '#E0E0E0',
|
|
20
|
+
activeBorderColor = '#333333',
|
|
21
|
+
activeBorderWidth = 2,
|
|
22
|
+
scrollToTheEnd = false,
|
|
23
|
+
isScrollable = false,
|
|
24
|
+
selectable = false,
|
|
25
|
+
font: propFont,
|
|
26
|
+
yAxisTicksCount = 5,
|
|
27
|
+
showXAxis = false,
|
|
28
|
+
verticalScaleFactor = 0.8,
|
|
29
|
+
ref,
|
|
30
|
+
onBarPress,
|
|
31
|
+
children
|
|
32
|
+
}) => {
|
|
33
|
+
// 1. Font Loading (Fallback to System Font if needed)
|
|
34
|
+
const systemFont = matchFont({
|
|
35
|
+
fontFamily: 'sans-serif',
|
|
36
|
+
fontSize: 10
|
|
37
|
+
});
|
|
38
|
+
const font = propFont ?? systemFont;
|
|
39
|
+
|
|
40
|
+
// 2. Shared Values & Refs
|
|
41
|
+
const selectedIndex = useSharedValue(-1);
|
|
42
|
+
const entryProgress = useSharedValue(0);
|
|
43
|
+
const scrollViewRef = useAnimatedRef();
|
|
44
|
+
const scrollX = useScrollViewOffset(scrollViewRef);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!isLoading) {
|
|
47
|
+
entryProgress.value = 0;
|
|
48
|
+
entryProgress.value = withTiming(1, {
|
|
49
|
+
duration: 1200,
|
|
50
|
+
easing: Easing.out(Easing.exp)
|
|
51
|
+
});
|
|
52
|
+
if (scrollToTheEnd && isScrollable) {
|
|
53
|
+
// Delay for ScrollView calculation
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
scrollViewRef.current?.scrollToEnd({
|
|
56
|
+
animated: true
|
|
57
|
+
});
|
|
58
|
+
}, 100);
|
|
59
|
+
} else {
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
scrollViewRef.current?.scrollTo({
|
|
62
|
+
x: 0,
|
|
63
|
+
animated: true
|
|
64
|
+
});
|
|
65
|
+
}, 100);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
+
}, [data, isLoading, scrollToTheEnd, isScrollable]);
|
|
71
|
+
|
|
72
|
+
// 3. Layout Calculations
|
|
73
|
+
const xAxisHeight = showXAxis ? LABEL_PADDING_TOP + APPROX_FONT_HEIGHT : 0;
|
|
74
|
+
const graphBottom = height - xAxisHeight;
|
|
75
|
+
const maxBarHeight = graphBottom * verticalScaleFactor;
|
|
76
|
+
const skeletonData = useMemo(() => {
|
|
77
|
+
return Array.from({
|
|
78
|
+
length: 6
|
|
79
|
+
}).map((_, index) => ({
|
|
80
|
+
label: '---',
|
|
81
|
+
value: 100,
|
|
82
|
+
id: `skeleton-${index}`
|
|
83
|
+
}));
|
|
84
|
+
}, []);
|
|
85
|
+
const layoutData = isLoading ? skeletonData : data;
|
|
86
|
+
|
|
87
|
+
// Detect YAxis in children
|
|
88
|
+
const {
|
|
89
|
+
hasYAxis,
|
|
90
|
+
yAxisWidth
|
|
91
|
+
} = useMemo(() => {
|
|
92
|
+
let found = false;
|
|
93
|
+
let widthFound = 50; // Default width;
|
|
94
|
+
|
|
95
|
+
const childrenArray = React.Children.toArray(children);
|
|
96
|
+
for (const child of childrenArray) {
|
|
97
|
+
if (/*#__PURE__*/React.isValidElement(child)) {
|
|
98
|
+
// Check the type.displayName to find Y-Axis component
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
if (child.type?.displayName === 'BarChartYAxis') {
|
|
101
|
+
found = true;
|
|
102
|
+
widthFound = child.props.width || 50;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
hasYAxis: found,
|
|
108
|
+
yAxisWidth: widthFound
|
|
109
|
+
};
|
|
110
|
+
}, [children]);
|
|
111
|
+
const {
|
|
112
|
+
maxValue,
|
|
113
|
+
yAxisTicks
|
|
114
|
+
} = useMemo(() => {
|
|
115
|
+
let rawMax = 0;
|
|
116
|
+
if (isLoading) {
|
|
117
|
+
rawMax = 100;
|
|
118
|
+
} else {
|
|
119
|
+
rawMax = Math.max(...data.map(item => item.value), 0);
|
|
120
|
+
}
|
|
121
|
+
const scale = calculateNiceScale(0, rawMax, yAxisTicksCount);
|
|
122
|
+
return {
|
|
123
|
+
maxValue: scale.max,
|
|
124
|
+
yAxisTicks: scale.ticks
|
|
125
|
+
};
|
|
126
|
+
}, [data, isLoading, yAxisTicksCount]);
|
|
127
|
+
const {
|
|
128
|
+
canvasWidth,
|
|
129
|
+
contentWidth,
|
|
130
|
+
effectiveBarWidth
|
|
131
|
+
} = useMemo(() => {
|
|
132
|
+
const SIDE_PADDING = BAR_CHART_PADDING_LEFT + BAR_CHART_PADDING_RIGHT;
|
|
133
|
+
const availableCanvasWidth = hasYAxis ? width - yAxisWidth : width;
|
|
134
|
+
const numberOfItems = Math.max(layoutData.length, 1);
|
|
135
|
+
const numberOfSpaces = Math.max(numberOfItems - 1, 0);
|
|
136
|
+
const totalSpacing = spacing * numberOfSpaces;
|
|
137
|
+
if (isScrollable && !isLoading) {
|
|
138
|
+
// SCROLL MODE: Use fixed barWidth from props
|
|
139
|
+
const totalBarsWidth = numberOfItems * barWidth;
|
|
140
|
+
const totalContentWidth = totalBarsWidth + totalSpacing + SIDE_PADDING;
|
|
141
|
+
return {
|
|
142
|
+
contentWidth: totalContentWidth,
|
|
143
|
+
canvasWidth: availableCanvasWidth,
|
|
144
|
+
effectiveBarWidth: barWidth
|
|
145
|
+
};
|
|
146
|
+
} else {
|
|
147
|
+
// FIT MODE: Calculate dynamic barWidth to fit container
|
|
148
|
+
const availableSpaceForBars = availableCanvasWidth - totalSpacing - SIDE_PADDING;
|
|
149
|
+
// Prevent division by zero and ensure min width of 1px;
|
|
150
|
+
const dynamicWidth = Math.max(availableSpaceForBars / Math.max(numberOfItems, 1), 1);
|
|
151
|
+
return {
|
|
152
|
+
contentWidth: availableCanvasWidth,
|
|
153
|
+
canvasWidth: availableCanvasWidth,
|
|
154
|
+
effectiveBarWidth: dynamicWidth // Override the prop
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}, [layoutData, isScrollable, barWidth, spacing, width, hasYAxis, yAxisWidth, isLoading]);
|
|
158
|
+
|
|
159
|
+
// 4. Expose Ref Mathods
|
|
160
|
+
useImperativeHandle(ref, () => ({
|
|
161
|
+
scrollToStart: (animated = true) => {
|
|
162
|
+
scrollViewRef.current?.scrollTo({
|
|
163
|
+
x: 0,
|
|
164
|
+
animated
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
scrollToEnd: (animated = true) => {
|
|
168
|
+
scrollViewRef.current?.scrollToEnd({
|
|
169
|
+
animated
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
scrollToIndex: (index, animated = true) => {
|
|
173
|
+
const positionX = index * (barWidth + spacing);
|
|
174
|
+
scrollViewRef.current?.scrollTo({
|
|
175
|
+
x: positionX,
|
|
176
|
+
animated
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
selectedIndex: (index, options) => {
|
|
180
|
+
// Update the SharedValue (triggers UI animations instantly)
|
|
181
|
+
if (index >= -1 && index < data.length) {
|
|
182
|
+
selectedIndex.value = index;
|
|
183
|
+
|
|
184
|
+
// Scroll to the bar
|
|
185
|
+
if (options?.scrollToBar && index !== -1 && isScrollable) {
|
|
186
|
+
const itemFullWidth = barWidth + spacing;
|
|
187
|
+
|
|
188
|
+
// Center logic: Item Pos - Half Screen + Half Item
|
|
189
|
+
const itemX = BAR_CHART_PADDING_LEFT + index * itemFullWidth;
|
|
190
|
+
const centerOffsetX = itemX - canvasWidth / 2 + barWidth / 2;
|
|
191
|
+
|
|
192
|
+
// Ensure scroll don't past bounds
|
|
193
|
+
const maxOffset = contentWidth - canvasWidth;
|
|
194
|
+
const targetX = Math.max(0, Math.min(centerOffsetX, maxOffset));
|
|
195
|
+
scrollViewRef.current?.scrollTo({
|
|
196
|
+
x: targetX,
|
|
197
|
+
animated: options.animatedScroll
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}));
|
|
203
|
+
return /*#__PURE__*/_jsx(BarChartContext.Provider, {
|
|
204
|
+
value: {
|
|
205
|
+
data,
|
|
206
|
+
isLoading,
|
|
207
|
+
skeletonData,
|
|
208
|
+
height,
|
|
209
|
+
width,
|
|
210
|
+
yAxisTicks,
|
|
211
|
+
canvasWidth,
|
|
212
|
+
contentWidth,
|
|
213
|
+
barWidth: effectiveBarWidth,
|
|
214
|
+
spacing,
|
|
215
|
+
verticalScaleFactor,
|
|
216
|
+
xAxisHeight,
|
|
217
|
+
graphBottom,
|
|
218
|
+
maxBarHeight,
|
|
219
|
+
isScrollable,
|
|
220
|
+
barColor,
|
|
221
|
+
activeBorderColor,
|
|
222
|
+
activeBorderWidth,
|
|
223
|
+
font,
|
|
224
|
+
showXAxis,
|
|
225
|
+
selectable: selectable ?? !!onBarPress,
|
|
226
|
+
selectedIndex,
|
|
227
|
+
entryProgress,
|
|
228
|
+
maxValue,
|
|
229
|
+
scrollViewRef,
|
|
230
|
+
scrollX,
|
|
231
|
+
hasYAxis,
|
|
232
|
+
yAxisWidth,
|
|
233
|
+
onBarPress
|
|
234
|
+
},
|
|
235
|
+
children: children
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
export const useBarChart = () => {
|
|
239
|
+
const context = useContext(BarChartContext);
|
|
240
|
+
if (!context) {
|
|
241
|
+
throw new Error('useBarChart must be used inside a <BarChart.Root />');
|
|
242
|
+
}
|
|
243
|
+
return context;
|
|
244
|
+
};
|
|
245
|
+
export default BarChartProvider;
|
|
246
|
+
//# sourceMappingURL=BarChartContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","useEffect","useImperativeHandle","useMemo","Easing","useAnimatedRef","useScrollViewOffset","useSharedValue","withTiming","matchFont","BAR_CHART_PADDING_LEFT","BAR_CHART_PADDING_RIGHT","calculateNiceScale","jsx","_jsx","LABEL_PADDING_TOP","APPROX_FONT_HEIGHT","BarChartContext","undefined","BarChartProvider","data","isLoading","width","height","barWidth","spacing","barColor","activeBorderColor","activeBorderWidth","scrollToTheEnd","isScrollable","selectable","font","propFont","yAxisTicksCount","showXAxis","verticalScaleFactor","ref","onBarPress","children","systemFont","fontFamily","fontSize","selectedIndex","entryProgress","scrollViewRef","scrollX","value","duration","easing","out","exp","setTimeout","current","scrollToEnd","animated","scrollTo","x","xAxisHeight","graphBottom","maxBarHeight","skeletonData","Array","from","length","map","_","index","label","id","layoutData","hasYAxis","yAxisWidth","found","widthFound","childrenArray","Children","toArray","child","isValidElement","type","displayName","props","maxValue","yAxisTicks","rawMax","Math","max","item","scale","ticks","canvasWidth","contentWidth","effectiveBarWidth","SIDE_PADDING","availableCanvasWidth","numberOfItems","numberOfSpaces","totalSpacing","totalBarsWidth","totalContentWidth","availableSpaceForBars","dynamicWidth","scrollToStart","scrollToIndex","positionX","options","scrollToBar","itemFullWidth","itemX","centerOffsetX","maxOffset","targetX","min","animatedScroll","Provider","useBarChart","context","Error"],"sourceRoot":"../../../../src","sources":["charts/BarChart/BarChartContext.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,mBAAmB,EACnBC,OAAO,QACF,OAAO;AAOd,SACEC,MAAM,EACNC,cAAc,EACdC,mBAAmB,EACnBC,cAAc,EACdC,UAAU,QAEL,yBAAyB;AAChC,SAASC,SAAS,QAAqB,4BAA4B;AACnE,SAASC,sBAAsB,EAAEC,uBAAuB,QAAQ,gBAAa;AAC7E,SAASC,kBAAkB,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AA4D7C,MAAMC,iBAAiB,GAAG,CAAC;AAC3B,MAAMC,kBAAkB,GAAG,EAAE;AAE7B,OAAO,MAAMC,eAAe,gBAAGlB,aAAa,CAE1CmB,SAAS,CAAC;AAEZ,MAAMC,gBAIL,GAAGA,CAAC;EACHC,IAAI;EACJC,SAAS,GAAG,KAAK;EACjBC,KAAK,GAAG,GAAG;EACXC,MAAM,GAAG,GAAG;EACZC,QAAQ,GAAG,EAAE;EACbC,OAAO,GAAG,EAAE;EACZC,QAAQ,GAAG,SAAS;EACpBC,iBAAiB,GAAG,SAAS;EAC7BC,iB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