Description
Babar is a small Node.js library that draws bar charts in your console. You pass it an array of [x, y] points, and it returns a string you can print. It is meant for a rough view of data, such as whether values look random or follow a linear or exponential trend, rather than as an advanced charting tool. The library is lightweight, at around 100 lines of code, and offers colour output, ASCII output and automatic bucketing, which averages the values that fall into each bucket. You can set a caption, the bar and grid colours, a width and height that the chart fits into, the number of fractions for the axis labels, and the minimum and maximum values for each axis. Its limits are that it draws only bar charts, handles one data set per graph, supports only numerical labels and linear axes, and does not yet support negative y values. The project is released under the MIT license.…
Highlights
- Draws bar charts in the console from [x, y] points
- Colour output and ASCII output
- Automatic bucketing of values
- Options for caption, colours, width, height and axis range
- Small library under 100 lines, MIT license
Ratings & Reviews
No ratings yet
Be the first to rate babar.
People also visit
babar FAQ
What is Babar?
Babar is a Node.js library that draws bar charts in the console. It is meant for quick, rough views of data rather than advanced charting.
What data does it take?
An array of points, where each point is an array of two values [x, y]. It returns a string that you output to the console.
Can I customise the chart?
Yes. Options include a caption, the bar colour (cyan by default), the grid colour, a width and height to fit the output, the number of fractions for the x and y labels, and the minimum and maximum values for each axis.
What are its limits?
It has limited options and draws only bar charts, with one data set per graph. It supports only numerical labels and linear axes, and negative y values are not supported yet.
What license is it under?
It is released under the MIT license.
What are the best babar alternatives?
Popular alternatives to babar include chartkick, chartist and frappe-charts. See all babar alternatives














