Add showlegend option to allow a series to opt out of being in the legend

This commit is contained in:
Nathan Daly 2018-11-21 17:06:27 -05:00
parent c26689fcb1
commit 594c39698e
2 changed files with 2 additions and 1 deletions

View File

@ -279,6 +279,7 @@ const _series_defaults = KW(
:series_annotations => nothing, # a list of annotations which apply to the coordinates of this series :series_annotations => nothing, # a list of annotations which apply to the coordinates of this series
:primary => true, # when true, this "counts" as a series for color selection, etc. the main use is to allow :primary => true, # when true, this "counts" as a series for color selection, etc. the main use is to allow
# one logical series to be broken up (path and markers, for example) # one logical series to be broken up (path and markers, for example)
:showlegend => true, # when false, this series will be left out of the generated legend.
:hover => nothing, # text to display when hovering over the data points :hover => nothing, # text to display when hovering over the data points
:stride => (1,1), # array stride for wireframe/surface, the first element is the row stride and the second is the column stride. :stride => (1,1), # array stride for wireframe/surface, the first element is the row stride and the second is the column stride.
) )

View File

@ -47,7 +47,7 @@ function should_add_to_legend(series::Series)
:hexbin,:bins2d,:histogram2d,:hline,:vline, :hexbin,:bins2d,:histogram2d,:hline,:vline,
:contour,:contourf,:contour3d,:surface,:wireframe, :contour,:contourf,:contour3d,:surface,:wireframe,
:heatmap, :pie, :image :heatmap, :pie, :image
)) )) && series.plotattributes[:showlegend] == true
end end
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------