Simple plotting of cartesian values.
Create a plot that fills screen
const p = Plot.insert({fill`viewport});const dataSet = p.dataSet;// Add datads.add({ x: 1, y: 2 });// Drawp.draw(); Copy
const p = Plot.insert({fill`viewport});const dataSet = p.dataSet;// Add datads.add({ x: 1, y: 2 });// Drawp.draw();
Create a plot that fills a container
const p = Plot.insert({parent:`#someel`}); Copy
const p = Plot.insert({parent:`#someel`});
Add data using the created data set
// Add a value to the `alpha` seriesp.dataSet.add({x:1,y:1}, `alpha`); Copy
// Add a value to the `alpha` seriesp.dataSet.add({x:1,y:1}, `alpha`);
Set default series formatting
p.setMeta(`default`, { colour: `hsl(50,100%,50%)`, lineWidth: 10}); Copy
p.setMeta(`default`, { colour: `hsl(50,100%,50%)`, lineWidth: 10});
Series can have metadata associated with it in the DataSet
// Use 'pink' by default for the series 'alpha'p.setMeta(`alpha`, { colour: `pink` }); Copy
// Use 'pink' by default for the series 'alpha'p.setMeta(`alpha`, { colour: `pink` });
List of lines to draw after drawing everything else. Lines are given in value-coordinate space
Draws a line in value-coordinate space
When range is auto, returns the range of the data Otherwise returns the user-provided range.
Converts a point in pixel coordinates to a value. Useful for converting from user input coordinates.
Positions an element at the viewport location of data point. Ensure the element has position:absolute set.
data
position:absolute
Optional
Simple plotting of cartesian values.
Create a plot that fills screen
Create a plot that fills a container
Add data using the created data set
Set default series formatting
Series can have metadata associated with it in the DataSet