--- title: "Bar Chart (legacy)" slug: "bar-chart" updated: 2023-03-14T03:12:26Z published: 2023-03-14T03:12:26Z canonical: "docs.preset.io/bar-chart" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.preset.io/llms.txt > Use this file to discover all available pages before exploring further. # Bar Chart (legacy) Try Preset's updated Bar ChartFormerly known as the Time Series Bar Chart, our new Bar Chart supports both temporal and non-temporal dimensions on X-axis. We recommend using the Bar Chart for additional functionalities.  The Bar Chart (legacy) uses bars to help users compare metrics across groups or segments. Here are some examples: ### ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Group%2026.png) Reference Content If you're new to visualizing data in Preset, we recommend the following reference articles: - [Creating a Chart](https://portal.document360.io/v1/docs/creating-a-chart): A walkthrough of the overall process of chart selection and creation. - [Using Preset Chart Builder](https://portal.document360.io/v1/docs/using-preset-explore): How to work with the Chart Builder page, the primary interface used when creating a chart. ## **Creating a Bar Chart** To create a Bar Chart, you need to define the following values: - X-axis: the column(s) you want the metric(s) to be grouped/categorized by - Y-axis**:** the metric(s) you want to visualize on the Y-axis These are all defined in the **Data** tab within Chart Builder. Here's a concrete example, with a breakdown afterward: ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-09-20%20at%202.12.02%20PM.png) Here's an explanation of the selections we made in the chart builder interface to generate this chart. | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-09-20%20at%202.16.21%20PM.png) | **Chart Builder options** - **Dimensions:** to showcase the best-selling genres in NA and EU, we put the *genre* column as the dimension - **Metrics**: we chose to apply the SUM() function to both the *na_sales* and *eu_sales* columns | | --- | --- | | **![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/query.png)** | **Generated SQL Query** - SELECT clause contains both aggregates and the dimension column - GROUP BY clause contains the dimension column | ## Bar Chart with More Complex Grouping **Multiple Dimensions** To showcase more complex pair-wise group metrics, you can use multiple **Dimension** columns in Chart Builder. This technique will do generate **m** by **n** bars, with **m** corresponding to the number of groups in the first column you choose and **n** corresponding to the number of groups in the second column you choose. ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-09-20%20at%202.33.40%20PM.png) This chart has a staggering 293 bars, which means that we probably can't effectively showcase all of them here. Here's a breakdown of this chart: | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-09-20%20at%202.29.49%20PM.png) | **Chart Builder options** - **Metrics:** we simplified to just the SUM of the *na_sales* column for each combination of groups - **Dimensions:** now we're grouping the metric by the pair-wise groups from the *platform* and the *genre* columns | | --- | --- | | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Group%2025.png) | **Generated SQL Query** - **Multiple group by columns this time** | **Dimensions and Breakdowns** Using the two dimensions above results in nearly 300 individual bars, which is difficult to both show and interpret. We can instead color segments of each bar by using the **Breakdowns** feature. This re-uses a dimensional column for breaking up existing bars, instead of generating new ones! Here's what the new chart looks like:![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-09-20%20at%202.38.22%20PM.png) All we did was move the *genre* column from the **Dimensions** section to the **Breakdowns** section and check the **Stacked Bars** checkbox in the **Customize** panel! Even the final generated SQL query is exactly the same, but this chart now compactly visualizes all 293 data points but without needing 293 individual bars. ## **Customizing your Bar Chart** You can customize the table experience further using the following options under the Customize tab. Here's an explanation of some of them: - **Legend:** if this checkbox is ticked, the legend for each dimension and color will be shown - **Bar Values**: if this checkbox is ticked, the total value for each bar in the graph will be shown at the top of each bar - **Rich Tooltip**: if this checkbox is ticked, the tooltip shown upon mouse hovering will contain lots of rich information on the data. *We recommend disabling if you're seeing performance impacts for large numbers of groups* - **Stacked Bars:** if this checkbox is ticked, then the unique group values in the **Breakdowns** column will be stacked on top of each other - **Sort Bars**: if this checkbox is ticked, then the bars will be sorted - **Y Axis Label**: enter a descriptive name for your y-axis label - **X Axis Label**: enter a descriptive name for your x-axis label