Scala: An ASCII “current value in range” chart/plot (Sparkline)
I just wrote some Scala code to create an ASCII chart/plot that looks like this:
+-------------------------|-------------------------+
^
In this chart, the left side of the chart represents a low value, the right side represents a high value, so the overall line represents that range, and then the ^
on the second line indicates the current value. This can be used to show the 52-week low and high values for a stock, along with its current range. It could also be used to show someone’s current batting average in a season, compared to their low and high values, and any other value that can be expressed as low, high, and current values.
I initially thought the correct name for this was a Sparkline chart, but it’s really something like a “current value in range” chart. I haven’t been able to find the exact correct name, but that’s close enough for now.