Class GraphBaseAbstract

An abstract that should be extends to generate Graph

Hierarchy

Constructors

Properties

backgroundColor: string
color: string
graphType: GraphType
height: number
statsmanager: StatsManager
time: number
width: number

Methods

  • Returns

    • The graph buffer

    Example

    const graph = new LineGraph(statsmanager, "cpu", {
    height: 400,
    width: 800,
    time: 604800000,
    color: "rgba(227, 227, 227, 0.9)",
    backgroundColor: "rgba(40, 40, 40, 0.9)",
    fontSize: 14
    });
    const buffer = graph.generate("ram");
    fs.writeFileSync("ram.png", buffer);

    Throws

    • If there is no data found

    Throws

    • If the graph type is not supported

    Parameters

    • targetStats: string

      The name of the stats to display

    Returns Promise<<internal>.Buffer>

Generated using TypeDoc