ScatterPlot - mwasiluk/ODC-d3 GitHub Wiki
Scatterplot extends [Chart With Color Groups](Chart With Color Groups)
#Demo Online demo
Scatterplot is created with an ODCD3.ScatterPlot function:
var placeholderSelector = "#scatterplot";
var data = [ ... ]; // array of arrays/objects
var config = { //optional config object
...
};
var plot = new ODCD3.ScatterPlot(placeholderSelector, data, config);
#Configuration
The ODCD3.ScatterPlot function takes 3 parameters:
- selector for plot placeholder element - d3.select compatible (string or node)
- data to plot
- optional config object
Configuration object properties (not inherited from [Chart With Color Groups](Chart With Color Groups)):
- guides - show axis guides, boolean (default: false)
- showTooltip - show tooltip on dot hover, boolean (default: true)
- dotRadius - point dot radius, default: 2
-
x - X axis configuration object:
- title - axis title, default: ''
- key - object property name or array index with X axis value, default: 0
- scale - axis scale, default: 'linear'
-
value - X value accessor function, may be used to override default accessor:
function (datum, key) { return datum[key]; }
-
y - Y axis configuration object:
- title - axis title, default: ''
- key - object property name or array index with Y axis value, default: 1
- scale - axis scale, default: 'linear'
-
value - Y value accessor function, may be used to override default accessor:
function (datum, key) { return datum[key]; }