ScatterPlot

A scatterplot. This visualization will plot values at specified x and y positions. Additional fields may determine the color, size, and shape of the plotted points.

Example

JavaScript

<body>
<script src="//unpkg.com/candela"></script>
<script>
  var el = document.createElement('div')
  document.body.appendChild(el);

  var data = [];
  for (var d = 0; d < 10; d += 1) {
    data.push({
      a: d,
      b: d
    });
  }

  var vis = new candela.components.ScatterPlot(el, {
    data: data,
    x: 'a',
    y: 'b',
    width: 700,
    height: 400
  });
  vis.render();
</script>
</body>

Python

import pycandela

data = [{'a': d, 'b': d} for d in range(10)]

pycandela.components.ScatterPlot(
    data=data, x='a', y='b', width=700, height=400)

R

library(candela)

candela('ScatterPlot', data=mtcars, x='mpg', y='wt', color='disp')

Options

data (Table)
The data table.
x (String)
The x axis field. Must contain numeric data. See Axis scales.
y (String)
The y axis field. Must contain numeric data. See Axis scales.
size (String)
The field used to size the points.
shape (String)
The field used to determine the shape of each point.
color (String)
The field used to color the points. See Color scales.
hover (Array of String)
The fields to display on hover.
width (Number)
Width of the chart in pixels. See Sizing.
height (Number)
Height of the chart in pixels. See Sizing.
renderer (String)
Whether to render in "svg" or "canvas" mode (default "canvas").