You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|Contains the pie chart implementation using the elastic-charts library. The goal is to eventually deprecate the old implementation and keep only this. Until then, the library used is defined by the Legacy charts library advanced setting.
Copy file name to clipboardExpand all lines: docs/user/dashboard/lens-advanced.asciidoc
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -295,6 +295,41 @@ image::images/lens_advanced_5_2.png[Line chart with cumulative sum of orders mad
295
295
296
296
. Click *Save and return*.
297
297
298
+
[discrete]
299
+
[[compare-time-ranges]]
300
+
=== Compare time ranges
301
+
302
+
*Lens* allows you to compare the currently selected time range with historical data using the *Time shift* option.
303
+
304
+
Time shifts can be used on any metric. The special shift *previous* will show the time window preceding the currently selected one, spanning the same duration.
305
+
For example, if *Last 7 days* is selected in the time filter, *previous* will show data from 14 days ago to 7 days ago.
306
+
307
+
If multiple time shifts are used in a single chart, a multiple of the date histogram interval should be chosen - otherwise data points might not line up in the chart and empty spots can occur.
308
+
For example, if a daily interval is used, shifting one series by *36h*, and another one by *1d*, is not recommended. In this scenario, either reduce the interval to *12h*, or create two separate charts.
309
+
310
+
To compare current sales numbers with sales from a week ago, follow these steps:
311
+
312
+
. Open *Lens*.
313
+
314
+
. From the *Chart Type* dropdown, select *Line*.
315
+
316
+
. From the *Available fields* list, drag and drop *Records* to the visualization builder.
317
+
318
+
. Copy the *Count of Records* series by dragging it to the empty drop target of the *Vertical axis* dimension group (*Drop a field or click to add*)
319
+
320
+
. Shift the second *Count of Records* series by one week to do a week-over-week comparison
321
+
322
+
.. Click the new *Count of Records [1]* dimension
323
+
324
+
.. Click *Add advanced options* below the field selector
325
+
326
+
.. Click *Time shift*
327
+
328
+
.. Click the *1 week* option. You can also define custom shifts by typing amount followed by time unit (like *1w* for a one week shift), then hit enter.
329
+
330
+
[role="screenshot"]
331
+
image::images/lens_time_shift.png[Line chart with week-over-week sales comparison]
===== Why is my value with the incorrect color when using value-based coloring?
322
+
323
+
There could be various reasons for a specific value in the table to have a different color than expected.
324
+
325
+
Here's a short list of few different aspects to check:
326
+
* Make sure the value falls within the desired color stop value defined in the panel. Color stop values are "inclusive".
327
+
328
+
* Make sure you have the right value precision setup: value formatters could round the numeric values up or down.
329
+
330
+
* Make sure the right color continuity option is selected: if the number is below the first color stop value, a continuity of type `Below` or `Above and below range` is required.
331
+
332
+
* The default values set by the Value type are based on the current data range displayed on the data table.
333
+
334
+
** If a custom `Number` configuration is used, check that the color stop values are covering the current data range.
335
+
336
+
** If a `Percent` configuration is used, and the data range changes, the colors displayed are affected.
0 commit comments