-
Notifications
You must be signed in to change notification settings - Fork 16
ASCIIGraph | Getting Started
Mitch Talmadge edited this page Oct 2, 2017
·
6 revisions
Graphs are simply large Strings. Use the ASCIIGraph class to configure the graph,
and plot() to convert it to a String.
The first thing you need to do when using ASCIIGraph is to ensure that your data is in the form of a double array.
The index of the array corresponds to the value on the x axis, and the value at the index corresponds to the value on the y axis.
To use the ASCIIGraph class, first call the static method ASCIIGraph#fromSeries(double[]). This creates an ASCIIGraph instance which you can configure in-line. Once configured, simply call the ASCIIGraph#plot() method, which returns the graph as a String.
The most simple example might be:
ASCIIGraph.fromSeries(new double[] { 1.0, 2.0, 3.0 }).plot();As you can see, there's not much to show on the graph. Try adding more data!
ASCIIGraph
ASCIITable
