Pie Chart Demo

Pie Chart Demo

Source: pie_chart_demo.f90

Build pie charts using both the stateful API and figure_t (exploded wedges, autopct, and start angles).

Outputs are written in PNG, PDF, and ASCII formats.

Run it with:

Generated media is written to output/example/fortran/pie_chart_demo/.

Files

  • pie_chart_demo.f90 - Source code
  • Generated media in output/example/fortran/pie_chart_demo/

Running

make example ARGS="pie_chart_demo"

Output

Oo Energy

oo_energy.png

ASCII output:

                           Clean energy capacity mix
+--------------------------------------------------------------------------------+
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                       Storage                  |
|                                                                                |
|                                                                                |
|                         Solar                                                  |
|                                                  12%                           |
|                            ----42%--------  -----                              |
|                      --------------------  ------------                        |
|                   ----------------------  -------------=-                      |
|                  ----------------------  ---------========         - Solar     |
|                 ----------------------  ----=========18%===  Hydro = Wind      |
|                 --------------------- +====================        % Hydro     |
|                  ---------------   +++++++++===============        # Storage   |
|                   ---------    +++++++++++++++++++========                     |
|                     ---     ++++++++++++++++++++++++++++                       |
|                         +++++++++++++++++++28%+++++++                          |
|                               +++++++++++++++++                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                             Wind                               |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+

Download ASCII

Download PDF

Stateful Sales

stateful_sales.png

ASCII output:

                             Regional revenue share
+--------------------------------------------------------------------------------+
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                    Online                      |
|                                                                                |
|                                                                                |
|                           North                                                |
|                                                15.0%                           |
|                                                                                |
|                               ---30.0%-========                                |
|                         ---------------==============                          |
|                      ------------------===============15.0%   West  - North    |
|                    --------------------==========  ---------        = East     |
|                   ---------------------=====  ---------------       % South    |
|                   --------------------- ---------------------       # West     |
|                   -----------+++++++++ =========  -----------       @ Online   |
|                   +-+++++++++++++++++++ ================== -                   |
|                     +++++++++++++++++++ =========18.0%==                       |
|                        +++++++++++++22.0%============                          |
|                             +++++++++++++=======                               |
|                                                       South                    |
|                                                                                |
|                                East                                            |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
|                                                                                |
+--------------------------------------------------------------------------------+

Download ASCII

Download PDF