Skip to content

Commit 6cdf68f

Browse files
authored
(DOCSP-31714) [Charts] Order Data Tutorial. (#613)
* (DOCSP-31714) Updated steps 3 and 4. * (DOCSP-31714) Updated steps 3 and 4. * (DOCSP-31714) Updated steps 3 and 4. * (DOCSP-31714) Updated screenshot * (DOCSP-31714) Replaced {+charts+} with MongoDB Charts. * (DOCSP-31714) Moved screenshot. * (DOCSP-31714) Moved screenshot. * (DOCSP-31714) Moved screenshot. * (DOCSP-31714) Edit dashboard name * (DOCSP-31714) Edits.
1 parent fad119f commit 6cdf68f

File tree

3 files changed

+40
-55
lines changed

3 files changed

+40
-55
lines changed
-20.2 KB
Loading
57.6 KB
Loading

source/includes/steps-column-chart-sales-by-store.yaml

Lines changed: 40 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ ref: click-stacked-column
1414
level: 4
1515
content: |
1616
17-
a. In the :guilabel:`Chart Type` dropdown, select
18-
:guilabel:`Column`.
17+
In the :guilabel:`Chart Type` dropdown, select
18+
:guilabel:`Stacked Column`.
1919
20-
b. Click :guilabel:`Stacked` below the dropdown.
20+
To render a :ref:`stacked column <stacked-ref-example>` chart,
21+
MongoDB Charts creates a bar or column for each distinct value in the
22+
:guilabel:`category` :ref:`encoding channel <encoding-channels>`
23+
field.
2124
22-
.. example:: Column Chart
23-
24-
This chart renders a column for each store location's revenue.
25-
Because there are six different store locations, the chart
26-
will contain six columns.
2725
---
2826
title: Add the desired fields to the proper encoding channels.
2927
ref: bar-chart-add-fields
@@ -32,67 +30,45 @@ content: |
3230
3331
a. Drag the ``storeLocation`` property from the :guilabel:`Fields`
3432
section of the Chart Builder view to the :guilabel:`X Axis`
35-
encoding channel. This tells MongoDB Charts to create a column
36-
for each ``storeLocation`` value in the dataset.
37-
38-
#. In the :guilabel:`Fields` section click the ``items`` field to
39-
expand the ``items`` object and view its properties.
33+
encoding channel.
34+
35+
This tells MongoDB Charts to create a column for each ``storeLocation`` value in the dataset.
4036
4137
.. note::
4238
4339
MongoDB Charts infers the data type of each field and
4440
provides symbols to easily determine these data types when
45-
building your chart. For example, the calendar icon next to
46-
the ``saleDate`` field signifies that this field is a
47-
timestamp. These symbols can help ensure your chart renders as
41+
building your chart. These symbols can help ensure your chart renders as
4842
expected by using proper data types for each
4943
:ref:`encoding channel <encoding-channels>`.
44+
For example, the calendar icon next to
45+
the ``saleDate`` field signifies that this field is a
46+
timestamp.
5047
51-
#. Drag the ``items.price`` field to the :guilabel:`Y Axis`
52-
encoding channel. The :guilabel:`Y Axis` encoding channel
53-
determines which field to use for the chart's
54-
:manual:`aggregation </aggregation>`.
48+
#. In the :guilabel:`Fields` section click the ``items`` field to
49+
expand the ``items`` object and view its properties.
5550
56-
.. example:: Aggregation
5751
58-
:manual:`Aggregation <aggregation>` processes data records
59-
using a wide variety of methods and returns computed results
60-
which may not be available in the original dataset. Because we
61-
are interested in the total revenue from each store, we use
62-
the ``items.price`` field here and will use an aggregation
63-
operator which will allow us to add the ``items.price`` fields
64-
together.
52+
#. Drag the ``items.price`` field to the :guilabel:`Y Axis`
53+
encoding channel.
54+
55+
This tells MongoDB Charts to use the ``items.price`` field
56+
for the chart's :manual:`aggregation </aggregation>`.
6557
66-
#. In the :guilabel:`Array Reductions` dropdown, select
58+
#. In the :guilabel:`items` dropdown below :guilabel:`Array Reductions`, select
6759
:guilabel:`Unwind array`.
6860
69-
.. example:: Unwind array
70-
71-
Array reductions dictate how to process an array so
72-
its elements can be visualized. The :guilabel:`unwind array`
73-
option creates a new document for each element in the array,
74-
so each item's price is added to the total for that store.
75-
76-
For more information on unwinding arrays, refer to the
77-
:manual:`unwind aggregation documentation </reference/operator/aggregation/unwind/>`.
61+
Array reductions dictate how to process an array so
62+
its elements can be visualized.
63+
The :manual:`unwind array </reference/operator/aggregation/unwind/>`
64+
option creates a new document for each element in the array,
65+
so each item's price is added to the total for that store.
7866
7967
#. In the :guilabel:`Aggregate` dropdown, select :guilabel:`sum`.
8068
81-
.. example:: Sum
82-
83-
This option adds the prices of all items per store together to
84-
display the chart. For more information on the ``$sum``
85-
aggregation command, refer to the
86-
:manual:`sum aggregation documentation </reference/operator/aggregation/sum/>`.
87-
88-
Your chart should now look something like this:
89-
90-
.. figure:: /images/charts/tutorial-stacked-bar-in-progress-2.png
91-
:figwidth: 750px
92-
:alt: Stacked Bar Chart Builder
93-
94-
Notice that the stores generating the most revenue are the
95-
``Denver`` and ``Seattle`` locations.
69+
The :manual:`$sum aggregation operator </reference/operator/aggregation/sum/>`
70+
adds the prices of all items per store together to
71+
display the chart.
9672
---
9773
title: Title your chart.
9874
ref: bar-chart-add-title
@@ -109,15 +85,24 @@ content: |
10985
Total Sales ($) by Store Location
11086
11187
#. Click the check mark to save your title.
88+
89+
Your chart should now look something like this:
90+
91+
.. figure:: /images/charts/tutorial-stacked-bar-in-progress-2.png
92+
:figwidth: 750px
93+
:alt: Stacked Bar Chart Builder
94+
95+
Notice that the stores generating the most revenue are the
96+
``Denver`` and ``Seattle`` locations.
11297
---
11398
title: Click :guilabel:`Save and Close` at the top right of the chart
11499
builder view.
115100
ref: bar-chart-save-and-close
116101
level: 4
117102
content: |
118103
119-
You will be navigated back to your :guilabel:`Super Store Supply
120-
Sales` dashboard and it should look something like this:
104+
You will be navigated back to your :guilabel:`Super Supply Store
105+
Orders` dashboard and it should look something like this:
121106
122107
.. figure:: /images/charts/order-tutorial-dashboard-stage1.png
123108
:figwidth: 750px

0 commit comments

Comments
 (0)