# Column

Column charts display raw data as vertical columns.

# Usage

To visualize your data with a column chart, the main .charts-css class should be followed by the .column class.

<table class="charts-css column">
  ...
</table>
1
2
3

# Wrapper

It's recommended to wrap the chart with a wrapper element. This element is used not only to hold the chart components, but also for scoping the styles.

<div id="my-chart">

  <table class="charts-css column">
    ...
  </table>

  <ul class="charts-css legend">
    ...
  </ul>

</div>
1
2
3
4
5
6
7
8
9
10
11

To set the chart dimensions, add some CSS:

#my-chart {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}
#my-chart .column {
  ...
}
#my-chart .legend {
  ...
}
1
2
3
4
5
6
7
8
9
10
11

# Heading

Add a heading to your chart using the <caption> tag. By default, the heading is hidden. To display the heading use the .show-heading class.

<div id="my-chart">

  <table class="charts-css column show-heading">
    <caption> Descriptive Column Chart Heading </caption>
    ...
  </table>

</div>
1
2
3
4
5
6
7
8

# Data

To transform HTML tables into charts, you need to provide data. The chart requires unitless numbers, between 0 to 1.


 


<tr>
  <td> $ 40K </td>
</tr>
1
2
3

Use the --size variable to set the data.


 


<tr>
  <td style="--size: 0.4"> $ 40K </td>
</tr>
1
2
3

To help the framework identify the text, wrap the content with a <span class="data"> tag.


 


<tr>
  <td style="--size: 0.4"> <span class="data"> $ 40K </span> </td>
</tr>
1
2
3
Column Example #1
$ 20K
$ 40K
$ 60K
$ 80K
$ 100K
Open in:

# Multiple Datasets

Single dataset have one <td> tag in each <tr>.


 


<tr>
  <td> Data </td>
</tr>
1
2
3

Multiple datasets have several <td> tags in each <tr>.


 
 
 


<tr>
  <td> Data </td>
  <td> Data </td>
  <td> Data </td>
</tr>
1
2
3
4
5

As any other data item, they should have the relevant structure.


 
 
 


<tr>
  <td style="--size: 0.2"> <span class="data"> Data </span> </td>
  <td style="--size: 0.4"> <span class="data"> Data </span> </td>
  <td style="--size: 0.6"> <span class="data"> Data </span> </td>
</tr>
1
2
3
4
5

When using multiple datasets you should add the .multiple class to let the framework apply different styles.

<table class="charts-css column multiple">
  ...
</table>
1
2
3
Column Example #2
$ 20K
$ 40K
$ 60K
$ 80K
$ 100K
Open in:
Column Example #3
$ 20K $ 40K $ 600K $ 80K $ 100K
$ 20K $ 40K $ 60K $ 80K $ 100K
Open in:

# Labels

Add labels to your data and control the labels' positions and size. Labels added using <th> tag inside the <tr>.


 





<tr>
  <th scope="row"> Label </th>
  <td> Data </td>
  <td> Data </td>
  <td> Data </td>
</tr>
1
2
3
4
5
6

By default, labels are hidden. To display labels use the .show-labels class.

<table class="charts-css column show-labels">
  ...
</table>
1
2
3
Column Example #4
Year Progress
2016
2017
2018
2019
2020
Open in:
Column Example #5
Year Progress
2016
2017
2018
2019
2020
Open in:

# Axes

Control the axes displayed on the chart.

# Primary Axis

To add a primary axis, separating the labels from the data, use the .show-primary-axis class.

<table class="charts-css column show-primary-axis">
  ...
</table>
1
2
3
Column Example #6
Year Progress
2016
2017
2018
2019
2020
Open in:
Column Example #7
Year Progress
2016
2017
2018
2019
2020
Open in:

# Secondary Axes

To add secondary axes, located behind the chart data, use the .show-*-secondary-axes class. Use the .show-*-secondary-axes class. Replace the * in the class name, with any number 1-10. For example, to display four axes use the .show-4-secondary-axes class.

<table class="charts-css column show-4-secondary-axes">
  ...
</table>
1
2
3
Column Example #8
Year Progress
2016
2017
2018
2019
2020
Open in:
Column Example #9
Year Progress
2016
2017
2018
2019
2020
Open in:

# Data Axes

Data axes are auto-generated based on the amount of columns (<tr> tags) in the chart. Add data axes using the .show-data-axes class.

<table class="charts-css column show-data-axes">
  ...
</table>
1
2
3
Column Example #10
Year Progress
2016
2017
2018
2019
2020
Open in:
Column Example #11
Year Progress
2016
2017
2018
2019
2020
Open in:

# Spacing

Control the space between the data items and the datasets.

# Data Spacing

To add space between data items use the .data-spacing-* class.

<table class="charts-css column data-spacing-10">
  ...
</table>
1
2
3
Column Example #12
Year Progress
2016
2017
2018
2019
2020
Open in:
Column Example #13
Year Progress
2016
2017
2018
2019
2020
Open in:

# Datasets Spacing

To add space between data items use the .datasets-spacing-* class.

<table class="charts-css column multiple datasets-spacing-10">
  ...
</table>
1
2
3
Column Example #14
Year Progress 1 Progress 2 Progress 3 Progress 4 Progress 5
2000
2020
Open in:
Column Example #15
Year Progress 1 Progress 2 Progress 3 Progress 4 Progress 5
2000
2020
Open in:

# Orientation

Control the chart orientation, or direction. The initial orientation is top-to-bottom (on LTR and RTL languages) and right-to-left (on TTM languages).

# Reverse

Use the .reverse class to reverse the orientation.

<table class="charts-css column reverse">
  ...
</table>
1
2
3
Column Example #16
2016
2017
2018
2019
2020
Open in:
Column Example #17
2016
2017
2018
2019
2020
Open in:

# Reverse Labels

Use the .reverse-labels class to reverse the labels position.

<table class="charts-css column reverse-labels">
  ...
</table>
1
2
3
Column Example #18
2016
2017
2018
2019
2020
Open in:
Column Example #19
2016
2017
2018
2019
2020
Open in:

# Reverse Data

To reverse the data order use the .reverse-data class.

<table class="charts-css column reverse-data">
  ...
</table>
1
2
3
Column Example #20
Year Progress
2016
2017
2018
2019
2020
Open in:
Column Example #21
Year Progress
2016
2017
2018
2019
2020
Open in:

# Reverse Datasets

To reverse the datasets order use the .reverse-datasets class.

<table class="charts-css column reverse-datasets">
  ...
</table>
1
2
3
Column Example #22
Year Progress 1 Progress 2 Progress 3 Progress 4 Progress 5
2000
2020
Open in:
Column Example #23
Year Progress 1 Progress 2 Progress 3 Progress 4 Progress 5
2000
2020
Open in:

# Reverse Data & Datasets

Combine the two classes to reverse the data order and the datasets order.

<table class="charts-css column reverse-data reverse-datasets">
  ...
</table>
1
2
3
Column Example #24
Year Progress 1 Progress 2 Progress 3 Progress 4 Progress 5
2000
2020
Open in:
Column Example #25
Year Progress 1 Progress 2 Progress 3 Progress 4 Progress 5
2000
2020
Open in: