Skip to main content

Responsive Configuration

The responsive options allow charts to adapt their configuration based on screen size or other conditions. This enables mobile-friendly, adaptive visualizations.

Basic Structure

Responsive Rules

rules

Array<object>
required
Array of responsive rule objects
Each rule contains:
  • condition - When to apply the rule
  • chartOptions - Options to merge when condition is met

Condition Options

maxWidth

number
Maximum chart width (in pixels) for this rule to apply

minWidth

number
Minimum chart width (in pixels) for this rule to apply

maxHeight

number
Maximum chart height (in pixels) for this rule to apply

minHeight

number
Minimum chart height (in pixels) for this rule to apply

Combined Conditions

Custom Callback

Function
Custom function that returns true when rule should apply

Chart Options

chartOptions

object
required
Chart configuration to merge when condition is met
Any chart option can be modified:

Common Responsive Patterns

Mobile-First Design

Hide Elements on Small Screens

Adjust Spacing

Simplify for Performance

Responsive Text Sizing

Complete Example

Testing Responsive Behavior

Best Practices

  1. Mobile-First: Start with mobile configuration, enhance for larger screens
  2. Performance: Disable animations and complex features on small devices
  3. Readability: Increase font sizes, reduce clutter on small screens
  4. Touch-Friendly: Ensure adequate spacing for touch interactions
  5. Test Multiple Breakpoints: Cover phone, tablet, desktop sizes
  6. Progressive Enhancement: Add features as screen size increases

See Also