Fill and Legend Toggle
Fill the area under a trendline, and keep one when its dataset is hidden
Try It
Click a series in the legend:
- New users (blue, tinted area): the trendline is filled with
fillColor. Hide the series and its trendline goes with it
- Returning users (purple, solid line): the dataset sets
alwaysShowTrendline: true, so its trendline stays on the chart even when the series is hidden
Configuration Used
- fillColor is a trendline option:
trendlineLinear.fillColor fills between the line and the bottom of the chart area
- alwaysShowTrendline is a dataset option, not a trendline option — it sits next to
label and data
- legend entries for trendlines are separate; these two datasets do not add any, so the legend stays short