Charts

We have charts in the terminal!

Presenting numbers, especially when comparing device performance benchmark numbers, can sometimes be clearer if you use a chart instead of a table. In order to use charts, you must specify at least the chart elements that can be described as an array of ChartElement class instances, which is usually set in the Elements property. You can create a new element like this:

var element = new ChartElement()
{
    Name = "Element 1",
    Value = 12,
};

You must specify at least the name and the value to identify your element. However, elements can either have a random color (if the Color property isn't specified) or a specific color. It can also be hidden from view by enabling the Hidden property.

Breakdown chart

This gives you either a horizontal stick or a vertical stick that describes what part of the whole stick has taken per each item. This describes a breakdown of several items that you want to present.

var chart = new BreakdownChart()
{
    Left = 1,
    Top = 2,
    InteriorWidth = 60,
    Showcase = true,
    Elements =
    [
        new()
        {
            Name = "C#",
            Value = 80,
        },
        new()
        {
            Name = "Java",
            Value = 13,
        },
        new()
        {
            Name = "C++",
            Value = 6.9,
        },
        new()
        {
            Name = "Shell",
            Value = 0.1,
        },
    ]
};
TextWriterRaw.WriteRaw(chart.Render());

Bar chart

This gives you a horizontal bar chart that allows you to present various numbers in an amazing way for comparison.

Stick chart

This gives you a vertical bar chart that allows you to present various numbers in an amazing way for comparison.

Stem and Leaf Chart

This shows you a stem and leaf chart that describes the breakdown of the numbers, with the following conditions:

  • The stem either represents the digit of tens and greater (if the number is not a decimal) or the numeric part (if the number is a decimal)

  • The leaf either represents the digit of ones (if the number is not a decimal) or the decimal part with the precision of two decimal digits (if the number is a decimal)

Line Charts

This allows you to render a line chart that shows you rises and falls of a specific data to the console.

Wins and Losses

This chart allows you to visualize wins and losses for a company or for other things in your console.

Pie charts

Pie charts visualize data, like all other data charts, but in a pie instead of the usual bars. It uses the values to calculate the arc angles of all elements to then display the whole pie to the console.

Chart of Lines

This kind of chart demonstrates how an item has increased or decreased over either time periods or, more generally, iterations. It uses lines for such demonstration.

Last updated