Mobile Responsive API
API reference for mobile-responsive features and touch interactions.
Touch Configuration
interface TouchOptions {
enabled?: boolean
pinchZoom?: boolean
swipeScroll?: boolean
doubleTapZoom?: boolean
sensitivity?: number
threshold?: number
}
Example:
chart.start({
touch: {
enabled: true,
pinchZoom: true,
swipeScroll: true,
sensitivity: 1.0
}
})
Chart Methods
resize()
chart.resize(width?: number, height?: number): void
Example:
chart.resize() // Auto-resize
chart.resize(800, 600) // Specific size
isMobile()
chart.isMobile(): boolean
Example:
if (chart.isMobile()) {
console.log('Mobile device')
}
Touch Events
touchstart, touchmove, touchend
chart.on('touchstart', (event: TouchEvent) => void)
chart.on('touchmove', (event: TouchEvent) => void)
chart.on('touchend', (event: TouchEvent) => void)
pinch
chart.on('pinch', (event: PinchEvent) => void)
interface PinchEvent {
scale: number
center: { x: number, y: number }
}
Related Documentation
- Example - Mobile example
- Performance - Performance optimization