Plotex.Output.Svg (plotex v0.5.0)

Summary

Functions

Default example CSS Styling.

Primary function to generate SVG plots from a given Plotex structure. The SVG can be styled using standard CSS. Options include ability to set the tick rotation and offset.

Functions

Default example CSS Styling.

Link to this function

generate(assigns)

Primary function to generate SVG plots from a given Plotex structure. The SVG can be styled using standard CSS. Options include ability to set the tick rotation and offset.

The overall SVG structure and CSS classes that can be used to style the SVG graph are:

.plx-graph
  .plx-title
  .plx-label-title
  .plx-labels
    .plx-x-labels
    .plx-y-labels
  .plx-grid
  .plx-data
    .plx-dataset-<n>
      .plx-data-point
      .plx-data-line

The generated SVG includes both a ployline connecting each dataset, and also either datapoints as either rect or circle type via opts.data.type = :rect | :circle.

Attributes

  • opts (:map) (required)
  • plot (Plotex) (required)
  • width (:float) - Defaults to 100.0.
  • height (:float) - Defaults to 100.0.
  • ds (:float) - Defaults to 1.5.
  • config (Plotex.Config) - Defaults to nil.
  • data (:map) - Defaults to %{}.
  • default_data (:map) - Defaults to %Plotex.Output.Options.Data{shape: :circle, width: 1.5, height: 1.5}.
  • Global attributes are accepted.

Slots

  • custom_svg