|
| 1 | +.. _combo-chart-ref: |
| 2 | + |
| 3 | +============ |
| 4 | +Combo Charts |
| 5 | +============ |
| 6 | + |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 1 |
| 13 | + :class: singlecol |
| 14 | + |
| 15 | +Combo charts offer a combined :ref:`column <column-bar-chart-ref>` and |
| 16 | +:ref:`line <line-area-chart-ref>` view. |
| 17 | + |
| 18 | +Combo Chart Encoding Channels |
| 19 | +----------------------------- |
| 20 | + |
| 21 | +Combo charts provide the following |
| 22 | +:ref:`encoding channels <encoding-channels>`: |
| 23 | + |
| 24 | +.. list-table:: |
| 25 | + :header-rows: 1 |
| 26 | + :widths: 20 80 |
| 27 | + |
| 28 | + * - Encoding Channel |
| 29 | + - Description |
| 30 | + |
| 31 | + * - X Axis |
| 32 | + - In the :guilabel:`category` axis encoding channel, a column is |
| 33 | + rendered for each unique value from this field. |
| 34 | + |
| 35 | + * - Columns |
| 36 | + - - The fields that you use in this channel build the columns in |
| 37 | + this chart. |
| 38 | + |
| 39 | + - The :guilabel:`aggregation` axis encoding channel dictates |
| 40 | + which field to aggregate on and the type of aggregation to |
| 41 | + perform. This ultimately dictates the size of each column. |
| 42 | + |
| 43 | + .. note:: |
| 44 | + |
| 45 | + You can map multiple fields to this channel to create |
| 46 | + a multi-series chart. However, unlike other charts, you can't |
| 47 | + create a multi-series chart with the :guilabel:`Series` |
| 48 | + channel on combo charts. To learn more, see |
| 49 | + :ref:`Multiple Field Mappings <multiple-field-mappings>`. |
| 50 | + |
| 51 | + * - Lines |
| 52 | + - - The fields that you use in this channel build one or more |
| 53 | + lines on this chart. |
| 54 | + |
| 55 | + - The :guilabel:`aggregation` axis encoding channel dictates |
| 56 | + which field to aggregate on and the type of aggregation to |
| 57 | + perform. |
| 58 | + |
| 59 | +Combo Chart Types |
| 60 | +----------------- |
| 61 | + |
| 62 | +Combo charts provide the following sub-types: |
| 63 | + |
| 64 | +.. list-table:: |
| 65 | + :header-rows: 1 |
| 66 | + :widths: 20 80 |
| 67 | + |
| 68 | + * - Sub-Type Name |
| 69 | + - Description |
| 70 | + |
| 71 | + * - :ref:`Grouped <grouped-combo-ref-example>` |
| 72 | + - |charts| groups data by the category specified in the |
| 73 | + :guilabel:`category` :ref:`encoding channel |
| 74 | + <encoding-channels>`, and plots a column for each value |
| 75 | + in the :guilabel:`Columns` encoding channel. |
| 76 | + |
| 77 | + * - :ref:`Stacked <stacked-combo-ref-example>` |
| 78 | + - |charts| creates a column for each distinct value in the |
| 79 | + :guilabel:`category` :ref:`encoding channel <encoding-channels>` |
| 80 | + field, and splits each column into segments based on the |
| 81 | + the :guilabel:`Columns` encoding channel. |
| 82 | + |
| 83 | +Use Cases |
| 84 | +--------- |
| 85 | + |
| 86 | +- Combo charts bring together the useful aspects of both :ref:`column |
| 87 | + <column-bar-chart-ref>` and :ref:`line <line-area-chart-ref>` charts |
| 88 | + into a single chart. |
| 89 | + |
| 90 | +Customization Options |
| 91 | +--------------------- |
| 92 | + |
| 93 | +The following customization options are specific to combo |
| 94 | +charts. To see all available customization options, see |
| 95 | +:ref:`customize-charts`. |
| 96 | + |
| 97 | +.. note:: |
| 98 | + |
| 99 | + If the columns and lines in your combo use different scales, |
| 100 | + consider a :ref:`secondary-y-axis`. This option appears on the |
| 101 | + :guilabel:`Customize` pane in the :guilabel:`Fields` section for any |
| 102 | + fields mapped to the :guilabel:`Lines` channel. Fields mapped to the |
| 103 | + :guilabel:`Columns` channel appear only on the primary axis. |
| 104 | + |
| 105 | +Adjust X-Axis Label Angle |
| 106 | +~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 107 | +You can adjust the X-axis label angle. |
| 108 | + |
| 109 | +.. include:: /includes/customization/adjust-x-axis-label-angle.rst |
| 110 | + |
| 111 | +Set Distinct Dash Style per Series |
| 112 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 113 | + |
| 114 | +On combo charts, you can opt to display each series in the chart with a |
| 115 | +distinct dash style. This option can help make your chart more |
| 116 | +accessible by distinguishing between series beyond color. |
| 117 | + |
| 118 | +.. include:: /includes/customization/set-distinct-dash-style-per-series.rst |
| 119 | + |
| 120 | +Smooth Lines |
| 121 | +~~~~~~~~~~~~ |
| 122 | + |
| 123 | +.. include:: /includes/customization/smooth-lines.rst |
| 124 | + |
| 125 | +Show or Hide Data Markers |
| 126 | +~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 127 | + |
| 128 | +On combo charts, you can dictate whether |charts-short| displays |
| 129 | +visible data markers that represent individual data points along the |
| 130 | +line. Enabling this option makes it easier to see exactly where your |
| 131 | +data points lie along a line. Hovering over these markers shows the |
| 132 | +exact data values in a tooltip, making it easier to view precise |
| 133 | +measurements. |
| 134 | + |
| 135 | +.. include:: /includes/customization/show-hide-data-markers.rst |
| 136 | + |
| 137 | +Show or Hide Data Value Labels |
| 138 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 139 | + |
| 140 | +.. include:: /includes/customization/show-hide-data-labels.rst |
| 141 | + |
| 142 | +Examples |
| 143 | +-------- |
| 144 | + |
| 145 | +.. _grouped-combo-ref-example: |
| 146 | + |
| 147 | +Grouped Combo Chart |
| 148 | +~~~~~~~~~~~~~~~~~~~ |
| 149 | + |
| 150 | +The following grouped combo chart shows the number of award |
| 151 | +nominations, wins, and metascores by director. |
| 152 | + |
| 153 | +The :guilabel:`X Axis` category of ``director`` creates a group |
| 154 | +for each director in the data set, and each group is split by the |
| 155 | +:guilabel:`Columns` encoding channel fields of ``nominations`` and |
| 156 | +``wins``. The :guilabel:`Lines` encoding channel field of |
| 157 | +``metacritic`` displays as a line: |
| 158 | + |
| 159 | +.. figure:: /images/charts/combo-chart-grouped.png |
| 160 | + :figwidth: 750px |
| 161 | + :alt: Grouped Combo Chart Reference |
| 162 | + |
| 163 | +.. _stacked-combo-ref-example: |
| 164 | + |
| 165 | +Stacked Combo Chart |
| 166 | +~~~~~~~~~~~~~~~~~~~~ |
| 167 | + |
| 168 | +The following stacked combo chart shows the number of award |
| 169 | +nominations, wins, and metascores by director. |
| 170 | + |
| 171 | +The :guilabel:`X Axis` category of ``director`` creates a column for |
| 172 | +each director in the data set, :ref:`limited <charts-limit-data>` to |
| 173 | +only the top 10 as sorted by the aggregated sum of ``awards.wins`` from |
| 174 | +:guilabel:`Columns`. The :guilabel:`Columns` encoding channel fields of |
| 175 | +``nominations`` and ``wins`` segment each column. The :guilabel:`Lines` |
| 176 | +encoding channel field of ``metacritic`` displays as a line: |
| 177 | + |
| 178 | +.. figure:: /images/charts/combo-chart-stacked.png |
| 179 | + :figwidth: 750px |
| 180 | + :alt: Stacked Combo Chart Reference |
| 181 | + |
| 182 | +Limitations |
| 183 | +----------- |
| 184 | + |
| 185 | +The maximum query response size for combo charts is 5000 |
| 186 | +documents. |
0 commit comments