Overview

Data mapping in Cristalyse allows you to flexibly bind data columns to visual chart properties like axis, color, and size, making it easy to represent complex datasets meaningfully.

Basic Mapping

Mapping Axes

Bind data fields to the X and Y axes:

CristalyseChart()
  .data(data)
  .mapping(x: 'date', y: 'temperature')
  .geomLine()
  .build()

Multi-Field Mapping

Visualize multiple metrics simultaneously:

CristalyseChart()
  .data(data)
  .mapping(x: 'month', y: 'revenue', size: 'profit', color: 'region')
  .geomPoint()
  .build()

Advanced Data Mapping

Dynamic Mapping

Change mappings at runtime to reflect dynamic data changes:

CristalyseChart()
  .data(data)
  .mapping(
    x: 'week',
    y: 'growth',
    color: isRevenue ? 'revenue' : 'profit',
  )
  .geomLine()
  .build()

Best Practices

Consistent Scales

  • Maintain consistency in axis mapping across related charts.
  • Utilize color mapping for quick insights in comparison charts.

Real-Time Mapping

  • Allow dynamic mapping for real-time data presentations.
  • Prepare data transformations before passing to chart mapping.

Combining Mappings

Combine color, size, and shape mappings for detailed insights:

CristalyseChart()
  .data(data)
  .mapping(
    x: 'hour',
    y: 'traffic',
    size: 'conversions',
    color: 'channel',
  )
  .geomPoint()
  .build()

Sales Analysis

Map sales data to both revenue and profit margins.

Real-Time Sensor Data

Dynamic mapping for fluctuating environmental data.

Market Segmentation

Visualize customer segments using size and color mapping.

Project Timelines

Use time mapping to align tasks with deadlines.

Next Steps