Skip to content

Graph/Chart plotting library #100

@maximecb

Description

@maximecb

Minimalist graph and bar chart plotting library based on lib/draw (X11 drawing library, already implemented). This could be loosely inspired from Python's matplotlib. Should allow updating/redrawing the graphs dynamically as new data is added. This could be used, for example, to chart mathematical functions, or stock prices over time.

Example usage:

plot = require('lib/plot')

// Draws a graph linking points by line segments
// values is an array of y values
// yMin and yMax are the range of the y axis
// xMin, xMax and xDelta determine x values corresponding to point indices
plot.graph(canvas, values, yMin, yMax, xMin, xMax, xDelta)

// Draws a bar graph with labeled bars
plot.barChart(/* TODO: determine argument format */)

I would strongly advise not trying to cover every possible use case for the first version of this library, as this may increase the difficulty and complexity significantly. Comments/feedback welcome.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions