Skip to content

Commit 7fb1ca9

Browse files
jeff-allen-mongocbushJeff Allen
committed
(DOCSP-12801): Custom dashes for line charts (#428)
* (DOCSP-12801): Custom dashes for line charts Author: Jeff Allen <[email protected]> * Apply suggestions from code review Co-authored-by: Chris Bush <[email protected]> * Additional refactoring for Customization Co-authored-by: Chris Bush <[email protected]> Co-authored-by: Jeff Allen <[email protected]>
1 parent 5ade9ee commit 7fb1ca9

File tree

6 files changed

+132
-100
lines changed

6 files changed

+132
-100
lines changed

source/chart-type-reference/column-bar-chart.txt

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,6 @@ may be beneficial to use one over the other:
184184
- :ref:`Limit Data <charts-limit-data>`
185185
- :ref:`Bin data <charts-bin-data>`
186186

187-
Limitations
188-
-----------
189-
190-
The maximum query response size for column and bar charts is 5000 documents.
191-
192187

193188
Examples
194189
--------
@@ -291,3 +286,19 @@ shade of green indicates a longer average runtime:
291286
:figwidth: 750px
292287
:alt: Colored Bar Chart Reference
293288

289+
Customization Options
290+
---------------------
291+
292+
The following customization options are specific to column and bar
293+
charts. To see all available customization options, see
294+
:ref:`customize-charts`.
295+
296+
Show or Hide Data Value Labels
297+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298+
299+
.. include:: /includes/customization/show-hide-data-labels.rst
300+
301+
Limitations
302+
-----------
303+
304+
The maximum query response size for column and bar charts is 5000 documents.

source/chart-type-reference/donut-chart.txt

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ Consider using donut charts to display:
8282
:ref:`column or bar chart <column-bar-chart-ref>`.
8383

8484

85-
Limitations
86-
-----------
87-
88-
The maximum query response size for a donut chart is 5000 documents.
89-
90-
9185
Examples
9286
--------
9387

@@ -163,3 +157,40 @@ segment according to the aggregated value signified in the
163157
:guilabel:`Arc` encoding channel. In this case, we aggregate the
164158
:guilabel:`mean` price for all properties rented by the day, week, and
165159
month.
160+
161+
Customization Options
162+
---------------------
163+
164+
The following customization options are specific to donut charts
165+
charts. To see all available customization options, see
166+
:ref:`customize-charts`.
167+
168+
Show or Hide Data Value Labels
169+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170+
171+
.. include:: /includes/customization/show-hide-data-labels.rst
172+
173+
.. _show-hide-data-category-labels:
174+
175+
Show or Hide Category Labels
176+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177+
178+
You can dictate whether |charts-short| displays text labels for
179+
**categories** in your donut charts.
180+
181+
To set this option:
182+
183+
1. Open the :ref:`Customize <customize-charts>` pane for your chart.
184+
185+
#. In the :guilabel:`General Customization` section, set the
186+
:guilabel:`Data Category Labels` toggle switch to the desired
187+
setting.
188+
189+
.. note::
190+
191+
.. include:: /includes/fact-donut-chart-labels.rst
192+
193+
Limitations
194+
-----------
195+
196+
The maximum query response size for a donut chart is 5000 documents.

source/chart-type-reference/line-area-chart.txt

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Line and Area Charts
99
.. contents:: On this page
1010
:local:
1111
:backlinks: none
12-
:depth: 2
12+
:depth: 1
1313
:class: singlecol
1414

1515
Line charts and area charts display information as a series of data
@@ -98,13 +98,6 @@ showing relative percentages.
9898
For a detailed example, see the :ref:`100% Stacked Area Chart Example
9999
<one-hundred-stacked-area-example>`.
100100

101-
102-
Limitation
103-
----------
104-
105-
The maximum document limit for discrete line and area charts is 5000 documents.
106-
107-
108101
.. _continuous-charts:
109102

110103
Continuous Line and Area Charts
@@ -159,12 +152,6 @@ Continuous line and area charts provide the following
159152
mapped to the :guilabel:`Y Axis aggregation`
160153
:ref:`encoding channel <encoding-channels>`.
161154

162-
Limitation
163-
----------
164-
165-
The maximum document limit for continuous line and area charts is 50000 documents.
166-
167-
168155
Discrete Area Versus Continuous Area Charts Display
169156
---------------------------------------------------
170157

@@ -354,3 +341,59 @@ holds. This comparison shows how close the battery is to a full charge.
354341
along a range. We want to plot each ``timestamp`` as an individual
355342
point, rather than show an aggregated value from many data values.
356343

344+
Customization Options
345+
---------------------
346+
347+
The following customization options are specific to line and area
348+
charts. To see all available customization options, see
349+
:ref:`customize-charts`.
350+
351+
Show or Hide Data Markers
352+
~~~~~~~~~~~~~~~~~~~~~~~~~
353+
354+
On line and area charts, you can dictate whether |charts-short| displays
355+
visible data markers that represent individual data points. Enabling
356+
this option makes it easier to see exactly where your data points lie
357+
along a line. Hovering over these markers shows the exact data values in
358+
a tooltip, making it easier to view precise measurements.
359+
360+
To set this option:
361+
362+
1. Open the :ref:`Customize <customize-charts>` pane for your chart.
363+
364+
#. In the :guilabel:`General Customization` section, set the
365+
:guilabel:`Data Markers` toggle switch to the desired setting.
366+
367+
To customize the formatting of the number in the data marker tooltip,
368+
modify the :ref:`Number Formatting <customize-number-formats>`
369+
settings for the relevant field.
370+
371+
Set Distinct Dash Style per Series on Line Charts
372+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
373+
374+
On discrete and continuous line charts, you can opt to display each
375+
series in the chart with a distinct dash style. This option can help
376+
make your chart more accessible by distinguishing between
377+
series beyond color.
378+
379+
To set this option:
380+
381+
1. Open the :ref:`Customize <customize-charts>` pane for your chart.
382+
383+
#. In the :guilabel:`General Customization` section, set the
384+
:guilabel:`Dash Styles per Series` toggle switch to the desired
385+
setting.
386+
387+
Show or Hide Data Value Labels
388+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
389+
390+
.. include:: /includes/customization/show-hide-data-labels.rst
391+
392+
Limitations
393+
-----------
394+
395+
- The maximum document limit for discrete line and area charts is 5000
396+
documents.
397+
398+
- The maximum document limit for continuous line and area charts is
399+
50000 documents.

source/customize-charts.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ of your visualizations. You can use these options to display your data
1717
in the proper format, show data labels to relay precise measurements,
1818
and many other formatting techniques.
1919

20+
The documentation for specific chart types covers additional
21+
customization options pretaining to those charts. See the :ref:`Chart
22+
Types <chart-type-reference>` page to learn more about customizing a
23+
particular chart type.
24+
2025
|charts| provides three types of customization options:
2126

2227
General Customizaton Options

source/customize-charts/general-customization.txt

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -20,58 +20,6 @@ visualization.
2020
:figwidth: 251px
2121
:alt: Field level customizations
2222

23-
Show or Hide Data Markers on a Line Chart
24-
-----------------------------------------
25-
26-
You can dictate whether |charts-short| displays visible data markers
27-
which represent individual data points on line charts. Enabling this
28-
option makes it easier to see exactly where your data points lie
29-
along a line. Hovering over these markers shows the exact data values
30-
in a tooltip, making it easier view precise measurements.
31-
32-
To set this option:
33-
34-
1. Navigate to the :guilabel:`Customization` tab in the
35-
:doc:`Chart Builder </build-charts>`.
36-
37-
#. In the :guilabel:`General Customization` section, set the
38-
:guilabel:`Data Markers` toggle switch to the desired setting.
39-
40-
To customize the formatting of the number in the data marker tooltip,
41-
modify the :ref:`Number Formatting <customize-number-formats>`
42-
settings for the relevant field.
43-
44-
Applicable Chart Types
45-
~~~~~~~~~~~~~~~~~~~~~~
46-
47-
This customization option is available on the following chart types:
48-
:ref:`Discrete Line <discrete-charts>`,
49-
:ref:`Continuous Line <continuous-charts>`,
50-
:ref:`Discrete Area <discrete-charts>`, and
51-
:ref:`Continuous Area <continuous-charts>`.
52-
53-
.. _show-hide-data-value-labels:
54-
55-
Show or Hide Data Value Labels
56-
------------------------------
57-
58-
You can dictate whether |charts-short| displays text labels for your
59-
data **values**. Data value labels show the exact values of your data
60-
points.
61-
62-
To set this option:
63-
64-
1. Navigate to the :guilabel:`Customization` tab in the
65-
:doc:`Chart Builder </build-charts>`.
66-
67-
#. In the :guilabel:`General Customization` section, set the
68-
:guilabel:`Data Value Labels` toggle switch to the desired
69-
setting.
70-
71-
To customize the formatting of the number in the data label, modify
72-
the :ref:`Number Formatting <customize-number-formats>` settings for
73-
the relevant field.
74-
7523
Applicable Chart Types
7624
~~~~~~~~~~~~~~~~~~~~~~
7725

@@ -85,27 +33,6 @@ Line <discrete-charts>`, :ref:`Continuous Line <continuous-charts>`,
8533
:ref:`Continuous Area <continuous-charts>`, and
8634
:ref:`Donut <donut-chart-ref>`.
8735

88-
.. note::
89-
90-
.. include:: /includes/fact-donut-chart-labels.rst
91-
92-
.. _show-hide-data-category-labels:
93-
94-
Show or Hide Data Category Labels on Donut Charts
95-
-------------------------------------------------
96-
97-
You can dictate whether |charts-short| displays text labels for
98-
data **categories** in your donut charts.
99-
100-
To set this option:
101-
102-
1. Navigate to the :guilabel:`Customization` tab in the
103-
:doc:`Chart Builder </build-charts>`.
104-
105-
#. In the :guilabel:`General Customization` section, set the
106-
:guilabel:`Data Category Labels` toggle switch to the desired
107-
setting.
108-
10936
.. note::
11037

11138
.. include:: /includes/fact-donut-chart-labels.rst
@@ -117,8 +44,8 @@ You can resize the text labels on a chart. Resizing text labels changes:
11744

11845
- Axis labels
11946
- Axis tick labels
120-
- :ref:`Data value labels <show-hide-data-value-labels>`
121-
- :ref:`Data category labels <show-hide-data-category-labels>`
47+
- Data value labels
48+
- Data category labels
12249
- Legend caption and entries
12350

12451
To set this option:
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
You can dictate whether |charts-short| displays text labels for your
2+
data **values**. Data value labels show the exact values of your data
3+
points.
4+
5+
To set this option:
6+
7+
1. Open the :ref:`Customize <customize-charts>` pane for your chart.
8+
9+
#. In the :guilabel:`General Customization` section, set the
10+
:guilabel:`Data Value Labels` toggle switch to the desired
11+
setting.
12+
13+
To customize the formatting of the number in the data label, modify
14+
the :ref:`Number Formatting <customize-number-formats>` settings for
15+
the relevant field.

0 commit comments

Comments
 (0)