:orphan:
************************************
chart recipes
************************************
Common examples to start building charts with the ``visualization_toolkit``.
Each tile below will have a different configuration of the ``chart`` function to display data.
.. caution::
Many of the code examples in these recipes include loading CSV data from pandas.
This should not be used in production scenarios and is only done for the purposes of
creating live code demos in the documentation.
Pass data to the ``chart`` function using pyspark dataframes in Databricks notebooks or using lists of dictionaries generated from DBSQL queries
via the ``execute_query`` function for data apps.
.. raw:: html
.. thumbnail-parent-div-open
.. thumbnail-parent-div-close
.. raw:: html
Area Chart Examples
===================================
See below for common area chart options to use when creating visualizations.
.. raw:: html
.. thumbnail-parent-div-open
.. raw:: html
.. only:: html
.. image:: /recipes/area_chart/images/thumb/sphx_glr_plot_area_chart_thumb.png
:alt:
:ref:`sphx_glr_recipes_area_chart_plot_area_chart.py`
.. raw:: html
Basic Area Chart
.. thumbnail-parent-div-close
.. raw:: html
Axes Customization Examples
===================================
See below for common options to style axes. Axis can be adjusted for tick positioning and number formatting.
.. raw:: html
.. thumbnail-parent-div-open
.. raw:: html
.. only:: html
.. image:: /recipes/axes/images/thumb/sphx_glr_plot_date_axis_start_thumb.png
:alt:
:ref:`sphx_glr_recipes_axes_plot_date_axis_start.py`
.. raw:: html
Truncate X-axis and Y-Axis
.. raw:: html
.. only:: html
.. image:: /recipes/axes/images/thumb/sphx_glr_plot_date_axis_bar_chart_thumb.png
:alt:
:ref:`sphx_glr_recipes_axes_plot_date_axis_bar_chart.py`
.. raw:: html
Date Axis for Bar Charts
.. raw:: html
.. only:: html
.. image:: /recipes/axes/images/thumb/sphx_glr_plot_data_axis_tick_interval_thumb.png
:alt:
:ref:`sphx_glr_recipes_axes_plot_data_axis_tick_interval.py`
.. raw:: html
Set Date Axis Intervals
.. raw:: html
.. only:: html
.. image:: /recipes/axes/images/thumb/sphx_glr_plot_date_axis_tick_format_thumb.png
:alt:
:ref:`sphx_glr_recipes_axes_plot_date_axis_tick_format.py`
.. raw:: html
Specify Date Axis Tick Formats
.. raw:: html
.. only:: html
.. image:: /recipes/axes/images/thumb/sphx_glr_plot_numerical_axis_tick_format_thumb.png
:alt:
:ref:`sphx_glr_recipes_axes_plot_numerical_axis_tick_format.py`
.. raw:: html
Numerical axis formatting and intervals
.. thumbnail-parent-div-close
.. raw:: html
Bar Chart Examples
===================================
See below for common bar chart options to use when creating visualizations.
.. raw:: html
.. thumbnail-parent-div-open
.. raw:: html
.. only:: html
.. image:: /recipes/bar_chart/images/thumb/sphx_glr_plot_bar_chart_thumb.png
:alt:
:ref:`sphx_glr_recipes_bar_chart_plot_bar_chart.py`
.. raw:: html
Basic Bar Chart
.. raw:: html
.. only:: html
.. image:: /recipes/bar_chart/images/thumb/sphx_glr_plot_stacked_bar_chart_thumb.png
:alt:
:ref:`sphx_glr_recipes_bar_chart_plot_stacked_bar_chart.py`
.. raw:: html
Stacked Bar Chart
.. raw:: html
.. only:: html
.. image:: /recipes/bar_chart/images/thumb/sphx_glr_plot_clustered_bar_chart_thumb.png
:alt:
:ref:`sphx_glr_recipes_bar_chart_plot_clustered_bar_chart.py`
.. raw:: html
Clustered Bar Chart
.. thumbnail-parent-div-close
.. raw:: html
Chart Context Examples
===================================
See below for examples of modifying charts to convey context such as annotations or shaded regions.
.. raw:: html
.. thumbnail-parent-div-open
.. raw:: html
.. only:: html
.. image:: /recipes/chart_context/images/thumb/sphx_glr_plot_positive_negative_regions_thumb.png
:alt:
:ref:`sphx_glr_recipes_chart_context_plot_positive_negative_regions.py`
.. raw:: html
Shade Positive and Negative Regions
.. raw:: html
.. only:: html
.. image:: /recipes/chart_context/images/thumb/sphx_glr_plot_shaded_region_thumb.png
:alt:
:ref:`sphx_glr_recipes_chart_context_plot_shaded_region.py`
.. raw:: html
Shaded Regions
.. raw:: html
.. only:: html
.. image:: /recipes/chart_context/images/thumb/sphx_glr_plot_floating_annotations_thumb.png
:alt:
:ref:`sphx_glr_recipes_chart_context_plot_floating_annotations.py`
.. raw:: html
Chart Floating Annotations
.. raw:: html
.. only:: html
.. image:: /recipes/chart_context/images/thumb/sphx_glr_plot_annotation_thumb.png
:alt:
:ref:`sphx_glr_recipes_chart_context_plot_annotation.py`
.. raw:: html
Chart Annotations
.. thumbnail-parent-div-close
.. raw:: html
Combo Chart Examples
===================================
See below for combo chart options to use when creating visualizations.
Combo charts are a mix of lines or bar charts.
.. raw:: html
.. thumbnail-parent-div-open
.. raw:: html
.. only:: html
.. image:: /recipes/combo_chart/images/thumb/sphx_glr_plot_combo_chart_same_axis_thumb.png
:alt:
:ref:`sphx_glr_recipes_combo_chart_plot_combo_chart_same_axis.py`
.. raw:: html
Combo Chart on Same Axis
.. raw:: html
.. only:: html
.. image:: /recipes/combo_chart/images/thumb/sphx_glr_plot_combo_chart_thumb.png
:alt:
:ref:`sphx_glr_recipes_combo_chart_plot_combo_chart.py`
.. raw:: html
Combo Charts on Different Y Axes
.. thumbnail-parent-div-close
.. raw:: html
Heatmap Chart Examples
===================================
See below for examples of creating heatmap visualizations
.. raw:: html
.. thumbnail-parent-div-open
.. raw:: html
.. only:: html
.. image:: /recipes/heatmap_chart/images/thumb/sphx_glr_plot_heatmap_chart_thumb.png
:alt:
:ref:`sphx_glr_recipes_heatmap_chart_plot_heatmap_chart.py`
.. raw:: html
Basic Heatmap Chart
.. thumbnail-parent-div-close
.. raw:: html
Line Chart Examples
===================================
See below for common line chart options to use when creating visualizations.
.. raw:: html
.. thumbnail-parent-div-open
.. raw:: html
.. only:: html
.. image:: /recipes/line_chart/images/thumb/sphx_glr_plot_line_chart_thumb.png
:alt:
:ref:`sphx_glr_recipes_line_chart_plot_line_chart.py`
.. raw:: html
Basic Line Chart
.. raw:: html
.. only:: html
.. image:: /recipes/line_chart/images/thumb/sphx_glr_plot_line_chart_with_shaded_bounds_thumb.png
:alt:
:ref:`sphx_glr_recipes_line_chart_plot_line_chart_with_shaded_bounds.py`
.. raw:: html
Line Chart with Shaded Bounds
.. raw:: html
.. only:: html
.. image:: /recipes/line_chart/images/thumb/sphx_glr_plot_line_format_chart_thumb.png
:alt:
:ref:`sphx_glr_recipes_line_chart_plot_line_format_chart.py`
.. raw:: html
Line Chart Formatting
.. thumbnail-parent-div-close
.. raw:: html
Pivot Chart Examples
===================================
See below for options to pivot charts based on data with multiple categories that need to be plotted individually.
.. raw:: html
.. thumbnail-parent-div-open
.. raw:: html
.. only:: html
.. image:: /recipes/pivoting/images/thumb/sphx_glr_plot_pivot_chart_all_categories_thumb.png
:alt:
:ref:`sphx_glr_recipes_pivoting_plot_pivot_chart_all_categories.py`
.. raw:: html
Pivot Charts across All Categories
.. raw:: html
.. only:: html
.. image:: /recipes/pivoting/images/thumb/sphx_glr_plot_pivot_chart_comparison_thumb.png
:alt:
:ref:`sphx_glr_recipes_pivoting_plot_pivot_chart_comparison.py`
.. raw:: html
Pivot Charts without Stacking
.. raw:: html
.. only:: html
.. image:: /recipes/pivoting/images/thumb/sphx_glr_plot_pivot_chart_stacked_thumb.png
:alt:
:ref:`sphx_glr_recipes_pivoting_plot_pivot_chart_stacked.py`
.. raw:: html
Stacked Pivot Charts
.. thumbnail-parent-div-close
.. raw:: html
Styling Chart Examples
===================================
See below for options to change overall styles for charts
.. raw:: html
.. thumbnail-parent-div-open
.. raw:: html
.. only:: html
.. image:: /recipes/styling/images/thumb/sphx_glr_plot_atlas_chart_theme_thumb.png
:alt:
:ref:`sphx_glr_recipes_styling_plot_atlas_chart_theme.py`
.. raw:: html
Use Atlas theme for charts
.. raw:: html
.. only:: html
.. image:: /recipes/styling/images/thumb/sphx_glr_plot_hover_template_thumb.png
:alt:
:ref:`sphx_glr_recipes_styling_plot_hover_template.py`
.. raw:: html
Customize Tooltops (Hover Templates)
.. thumbnail-parent-div-close
.. raw:: html
Waterfall Chart Examples
===================================
See below for examples to create a waterfall (bridge) chart
.. raw:: html
.. thumbnail-parent-div-open
.. raw:: html
.. only:: html
.. image:: /recipes/waterfall_chart/images/thumb/sphx_glr_plot_waterfall_chart_thumb.png
:alt:
:ref:`sphx_glr_recipes_waterfall_chart_plot_waterfall_chart.py`
.. raw:: html
Basic Waterfall Chart
.. thumbnail-parent-div-close
.. raw:: html
.. toctree::
:hidden:
:includehidden:
/recipes/area_chart/index.rst
/recipes/axes/index.rst
/recipes/bar_chart/index.rst
/recipes/chart_context/index.rst
/recipes/combo_chart/index.rst
/recipes/heatmap_chart/index.rst
/recipes/line_chart/index.rst
/recipes/pivoting/index.rst
/recipes/styling/index.rst
/recipes/waterfall_chart/index.rst
.. only:: html
.. rst-class:: sphx-glr-signature
`Gallery generated by Sphinx-Gallery `_