You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- `'top'` (default): Shows values in the chart header area
283
+
- `'tooltip'`: Displays a floating tooltip box near the highlight line
284
+
- `'none'`: Hides value display, useful with `onHighlightChanged` for custom UI
285
+
286
+
### X-Axis Dividers
287
+
288
+
Customize the vertical grid lines on the X-axis:
289
+
290
+
```tsx
291
+
// Dashed tick lines (default style)
292
+
<Chart
293
+
xDividerConfig={{
294
+
type:'tick',
295
+
color:'#999',
296
+
strokeWidth:1,
297
+
strokeDasharray:'4,4',
298
+
}}
299
+
/>
300
+
301
+
// Alternating background segments
302
+
<Chart
303
+
xDividerConfig={{
304
+
type: 'segment',
305
+
variant: 'hour', // or 'day' or { dynamicThreshold: 95040000 }
306
+
color: '#F5F5F5',
307
+
}}
308
+
/>
309
+
```
310
+
311
+
**Segment variants:**
312
+
313
+
-`'hour'`: Every other hour has a background segment
314
+
-`'day'`: Every other day has a background segment
315
+
-`{ dynamicThreshold: number }`: Auto-switches between hour/day based on visible time range
316
+
317
+
### Error Segments
318
+
319
+
Display error messages and highlight problematic time ranges:
320
+
321
+
```tsx
322
+
const errorSegments = [
323
+
{
324
+
message: 'Sensor offline',
325
+
messageColor: '#FF0000',
326
+
start: Date.now() -3600000,
327
+
end: Date.now() -1800000,
328
+
},
329
+
]
330
+
331
+
<Chart
332
+
// ... other props
333
+
errorSegments={errorSegments}
334
+
/>
335
+
```
336
+
337
+
Data points within error segments will show the error message instead of values, and the background will be highlighted.
338
+
212
339
### Multiple Datasets
213
340
214
341
```tsx
@@ -328,6 +455,11 @@ const datasetWithSlices = {
328
455
- react-native-webview >= 11.0.0
329
456
- iOS 11.0+ / Android API 21+
330
457
458
+
## Known Limitations
459
+
460
+
-**Error segment gradient**: The gradient style for error segments is currently hardcoded and cannot be customized
461
+
-**Highlight snap behavior**: The snap-to-data-point logic (distance thresholds of 8 pixels and 10 minutes) is hardcoded and not configurable via props
462
+
331
463
## Contributing
332
464
333
465
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
0 commit comments