#include <plot.h>
Plotting style, used for both layout and SVG rendering.
Colour/dash/hatch styles are defined as CSS classes, assigned to elements based on their integer style index. CSS is written inline in the SVG, and can be extended/overridden with .cssPrefix
/.cssSuffix
.
It generates CSS classes from .colours
(svg-plot-sN
/svg-plot-fN
/svg-plot-tN
for stroke/fill/text), .dashes
(svg-plot-dN
) and .hatches
(svg-plot-hN
), where N
is the index - e.g. there are six colours by default, generating svg-plot-s0
to svg-plot-s5
.
Nested Classes | |
struct | Counter |
struct | Hatch |
Methods | |
std::string | strokeClass (const Counter &counter) const |
std::string | fillClass (const Counter &counter) const |
std::string | textClass (const Counter &counter) const |
std::string | dashClass (const Counter &counter) const |
std::string | hatchClass (const Counter &counter) const |
std::string | markerId (const Counter &counter) const |
const std::string & | markerRaw (const Counter &counter) const |
void | css (std::ostream &o) const |
Attributes | |
double | scale = 1 |
scales the entire plot (including adjusting the precision) More... | |
double | padding = 10 |
double | lineWidth = 1.5 |
double | precision = 100 |
double | markerSize = 3.25 |
double | tickH = 4 |
double | tickV = 4 |
double | labelSize = 12 |
double | valueSize = 10 |
double | fontAspectRatio = 1 |
scales size estimates, if using a particularly wide font More... | |
double | textPadding = 5 |
double | lineHeight = 1.2 |
double | fillOpacity = 0.28 |
double | hatchWidth = 1 |
double | hatchSpacing = 3 |
double | animation = 2 |
Animation duration. More... | |
std::string | scriptHref = "" |
std::string | scriptSrc = "" |
std::string | cssPrefix = "" |
std::string | cssSuffix = "" |
std::vector< std::string > | colours = {"#0073E6", "#CC0000", "#00B300", "#806600", "#E69900", "#CC00CC"} |
std::vector< std::vector< double > > | dashes = {{}, {1.2, 1.2}, {2.8, 1.6}, {5, 4}, {4, 1, 1, 1, 1, 1}, {10, 3}, {4, 2, 1, 2}} |
std::vector< std::string > | markers |
SVG literals for the markers. These should be centered on (0, 0) and look correct next to a filled circle of radius 1. They will be given both a stroke and fill-class, so they should specify fill="none" /stroke="none" if fill/stroke is not wanted. More... | |
std::vector< Hatch > | hatches = {{}, {-50}, {{30}, 0.9, 0.8}, {{8, 93}, 0.7, 1}} |
double signalsmith::plot::PlotStyle::animation = 2 |
Animation duration.
double signalsmith::plot::PlotStyle::fontAspectRatio = 1 |
scales size estimates, if using a particularly wide font
std::vector<std::string> signalsmith::plot::PlotStyle::markers |
SVG literals for the markers. These should be centered on (0, 0)
and look correct next to a filled circle of radius 1. They will be given both a stroke and fill-class, so they should specify fill="none"
/stroke="none"
if fill/stroke is not wanted.
double signalsmith::plot::PlotStyle::scale = 1 |
scales the entire plot (including adjusting the precision)