--- title: "Mixed Chart" slug: "mixed-time-series-chart" updated: 2023-04-07T18:29:53Z published: 2023-04-07T18:29:53Z canonical: "docs.preset.io/mixed-time-series-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. # Mixed Chart The Mixed Chart lets you combine two different charts in a single chart container using a shared X-axis. Here are some examples: ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/grouped_examples.png) If you're unsure how to combine charts effectively, [this blog post](https://preset.io/blog/mixed-time-series-charts-tutorial/?utm_source=Preset-Docs&utm_medium=Referral&utm_campaign=Preset-Docs) explains some common use cases. ### Reference Content The following articles may be useful resources as you build your chart: - [Creating a Chart](/v1/docs/creating-a-chart): A walkthrough of the overall process of chart selection and creation. - [Using Preset Chart Builder](/v1/docs/using-preset-explore): How to work with the Chart Builder page, the primary interface used when creating a chart. ## Creating a Mixed Chart To create a simple Mixed Chart, you need to define: - A shared X-axis for both visualizations - The attributes for the 1st visualization (Query A) - The attributes for the 2nd visualization  (Query B) These are all defined in the **Data** tab within Chart Builder. | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Mixed%20chart%20x%20axis%20no%20drop%20shadow.png) | **Shared X-axis** - X-axis: Select the dataset column (e.g., Time, Categories) to be visualized. - Time Grain: Define the granularity of the X-axis (Hourly, Daily, Weekly, etc.). The field will appear for temporal dimensions only. | | --- | --- | | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-07-26%20at%205.11.37%20PM.png) | **1st Visualization (Query A)** - Drag or select the **Metric(s)** to be visualized on the Y-axis for your 1st chart. - Under the **Customize** tab, use the **Series Type** field to select the chart type (Line, Scatter, Bar, etc.) | | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-07-26%20at%205.21.34%20PM.png) | **2nd Visualization (Query B)** - Drag or select the **Metric(s)** to be visualized on the Y-axis for your 2nd chart. - Under the **Customize** tab, use the **Series Type** field to select the chart type (Line, Scatter, Bar, etc.) | Click **Create** **Chart** or **Update Chart** to generate the queries, run the queries, and visualize the results. ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-07-26%20at%207.55.20%20PM.png) ## Understanding Both Queries and Results The Mixed Chart is unique because the Preset backend generates **two different SQL queries** and aligns the results on the shared X-axis. | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-07-27%20at%207.51.22%20AM.png) | **View Both Queries** You can click the [...] button in the top right corner of the Chart Builder interface and then click **View Query** in any chart to see the queries generated. - The 1st query corresponds to **Query A** - The 2nd query corresponds to **Query B** | | --- | --- | | ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/both_results.png) | **View Both Results Sets** There are two **Results** tabs underneath the rendered chart, corresponding to the results of both queries. - Results show results from **Query A** - Results 2 shows results from **Query B** | ## Advanced Analytics As with most visualizations in Preset, the Mixed Chart supports **Advanced Analytics** features like: - [Rolling Window and Rolling Function](/v1/docs/rolling-window) - [Time Shift and Resampling](/v1/docs/time-comparison) Because the Mixed Charts combine two queries, results, and charts, you can apply these settings at the *individual chart level*. In the following example, we apply a **7-day rolling mean to one line chart and a 5-Day rolling mean to the other line chart.** ## ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/advanced_analytics(1).png) You can find more examples of Advanced Analytics workflows for this chart type [in our blog post](https://preset.io/blog/mixed-time-series-charts-tutorial/?utm_source=Preset-Docs&utm_medium=Referral&utm_campaign=Preset-Docs#tutorial-mixed-time-series-chart-with-rolling-mean). ## Customization Options The **Customize** tab exposes a number of options for tweaking the look and feel of this chart. ![](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Screen%20Shot%202022-07-28%20at%201.07.59%20PM.png) - **X Axis** section: Customize the name and bottom margin in pixels for the shared X-axis. - **Y Axis** section: Customize the name, margin, and position of the Y-axis. - **Color Scheme**: Pick a range of colors used for visualization. - **Query A and Query B** sections: All customization options for each chart - Series Type: Choose chart type between Line, Scatter, Smooth Line, Bar, and Step. - Stack Series checkbox: If the chart has multiple X-axis, checking this checkbox will stack the series (useful for stacking bar charts). - Area Chart checkbox and Opacity slider: Shade the area under a line chart if checkbox is ticked and use the Opacity slider to specify the degree of opacity. - Show Values checkbox: Ticking this will show each data point, as a number, for this chart. - Marker and Marker Size: For line charts, you can enable markers (or circles) for the data points and use the slider to choose the size. - **Y Axis** - If set to Primary, this chart's computed Y-axis will be on the left hand side. - If set to Secondary, this chart's computed Y-axis will be on the right hand side. - You can enable two different Y-axis ranges by setting one chart to Primary and the other chart to Secondary. - **Legend** - Show Legend checkbox: If ticked, will show each Metric in the Legend. - Type: If set to Scroll, the Legend will only show a few Metrics at a time and will hide the rest. If set to Plain, the Legend will attempt to show all Metrics. - Orientation: Location of the Legend as it relates to the chart container (Top, Bottom, Left, or Right). - Margin: Additional whitespace margin between Legend and chart container (in pixels). - **X Axis** - Format: Choose the format for the X-axis labels or default to Adaptive Formatting to let the tool decide. - Rotate Axis Label: Optionally rotate the X-axis label. - **Tooltip** - Rich Tooltip checkbox: If ticked, shows all Metric / Series values as you hover across the X-axis. - Tooltip Sort by Metric checkbox: If ticked, sorts the tooltip by the selected metric in descending order.