mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-11 16:33:22 -06:00
Graph Type: Add Drop Shadow and Add Legend Across Top
Graph Type's Add Drop Shadow, as https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/visualize-data/add-drop-shadows.html describes, and Add Legend Across Top, as https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/visualize-data/change-the-position-of-legends.html describes. - dropShadow: a shadow behind each column, bar, stacked segment, line (line, scatter and radar) and pie wedge, just behind the series of its layer, so areas and columns drawn in front don't hide the shadows of the layer behind them. - legendAcrossTop: the legend's swatches and labels left to right from the plot's left edge, wrapping at the plot's width, the last row just above the plot and anything drawn over it (radar and stacked-pie labels). Own choices, as the pages don't say: a shadow is a black copy 2 pt down and right at 35% opacity; markers, areas and legend swatches cast none, nor do stacked segments of 0; a graph with more than 200,000 shadowed marks draws none. New fields are written only when set. Graphs with default options draw the same art as before.
This commit is contained in:
@@ -293,6 +293,12 @@ pub struct GraphSpec {
|
||||
pub right_axis_min: Option<f64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub right_axis_max: Option<f64>,
|
||||
/// Graph Type › Add Drop Shadow (behind columns, bars, lines and pie wedges) and Add Legend Across Top (the
|
||||
/// legend in rows above the plot instead of a column on its right).
|
||||
#[serde(skip_serializing_if = "std::ops::Not::not")]
|
||||
pub drop_shadow: bool,
|
||||
#[serde(skip_serializing_if = "std::ops::Not::not")]
|
||||
pub legend_across_top: bool,
|
||||
/// Pie graphs: Legends in Wedges (the series labels inside their wedges instead of a legend beside the pies),
|
||||
/// Position and Sort.
|
||||
#[serde(skip_serializing_if = "std::ops::Not::not")]
|
||||
@@ -408,6 +414,8 @@ impl Default for GraphSpec {
|
||||
right_axis_min: None,
|
||||
right_axis_max: None,
|
||||
series_markers: vec![],
|
||||
drop_shadow: false,
|
||||
legend_across_top: false,
|
||||
pie_legend_in_wedges: false,
|
||||
pie_position: PiePosition::Even,
|
||||
pie_sort: PieSort::None,
|
||||
|
||||
Reference in New Issue
Block a user