# cee::plt::OverlayPlot

class `OverlayPlot` : public OverlayItem

  Overlay item with basic 2D plotting.

  A view overlay item capable of showing a 2D plot (with optional border and background). The overlay plot can have any number of curves and offers a curve legend and a marker line. Various settings such as range, titles and colors(text, curve, lines, background, …) can be set.

  See the topic 2D Plotting

  An overlay plot contains one or more curves where each curve is a series of x- and y-values. These values can be saved and read from the VTFx model file. Plot settings, such as which curves are used in which plots, colors, titles and other, are saved as properties. (See PropertyApplierPlot2d and PropertyBuilderPlot2d).

  The overlay item can be added to a view using the View::overlay() and Overlay::addItem(). The view manages the layout of the overlay items, so only a desired size can be given in this class. The position is specified when the overlay item is added to the view.

  An overlay item can be shown in multiple views at the same time.

  The demo apps found in the HOOPS Envision distribution offers example code for import, export and usage of plot data and overlay plots.

  See also

  cee::vis::OverlayItem and cee::vis::Overlay, and cee::vis::View

  Public Types

  enum `LegendPosition`

    Position of the plot legend.

    Values:

    enumerator `RIGHT`

      Show the legend to the right of the plot.

    enumerator `BELOW`

      Show the legend below the plot.

  Public Functions

  `OverlayPlot`(vis::Font *font)

    Constructs an overlay plot.

  Str `title`() const

    Returns the plot title.

  void `setTitle`(const Str &title)

    Sets the plot title.

  bool `drawBackground`() const

    Returns true if plot background is drawn.

  void `setDrawBackground`(bool drawBackground)

    Specifies if the border should be drawn or not.

  Color3f `backgroundColor`() const

    Returns the background color of the overlay plot.

  void `setBackgroundColor`(const Color3f &color)

    Sets the background color of the overlay plot.

  float `backgroundOpacity`() const

    Returns the opacity of the background.

    1.0 = opaque, 0.0 = fully transparent

  void `setBackgroundOpacity`(float opacity)

    Sets the opacity (transparency) of the background of the overlay plot.

    1.0 = opaque, 0.0 = fully transparent

  Color3f `borderColor`() const

    Returns the border color of the overlay plot.

  void `setBorderColor`(const Color3f &color)

    Sets the color of the border of the overlay plot.

  float `borderWidth`() const

    Returns the width of the border around the overlay plot in pixels.

  void `setBorderWidth`(float width)

    Sets the width in pixels of the border around the overlay plot.

  bool `drawBorder`() const

    Returns true if the border is drawn.

  void `setDrawBorder`(bool drawBorder)

    Specifies if the border should be drawn or not.

  const AxisSettings &`axisSettings`() const

    Returns the axis settings for this plot.

  AxisSettings &`axisSettings`()

    Returns the axis settings for this plot.

  const MarkerLine &`markerLine`() const

    Returns the marker line for this plot.

  MarkerLine &`markerLine`()

    Returns the marker line for this plot.

  bool `drawCurveLegend`() const

    Returns true if the curve legend is drawn.

  void `setDrawCurveLegend`(bool drawCurveLegend)

    Specifies if the curve legend is drawn or not.

  LegendPosition `curveLegendPosition`() const

    Returns the curve legend position.

  void `setCurveLegendPosition`(LegendPosition position)

    Sets the curve legend position.

  Color3f `textColor`() const

    Sets the color used for text (labels and titles)

  void `setTextColor`(const Color3f &color)

    Sets the color used for text (labels and titles)

  void `setFont`(vis::Font *font)

    Sets the font used by the plot.

  size_t `curveCount`() const

    Returns the number of curves in this plot.

  const Curve *`curve`(size_t curveIndex) const

    Returns the curve at the specified index.

  Curve *`curve`(size_t curveIndex)

    Returns the curve at the specified index.

  Curve *`addCurve`(const Str &curveName, const std::vector<double> &xValues, const std::vector<double> &yValues)

    Adds a curve to the plot specifying a name and an x- and y-value array.

  void `removeAllCurves`()

    Removes all curves from the plot.

  void `removeCurve`(size_t curveIndex)

    Removes the curve at the specified index from the plot.

  double `xValuesMinimum`() const

    Returns the minimum x value of all curves in the plot.

  double `xValuesMaximum`() const

    Returns the maximum x value of all curves in the plot.

  double `yValuesMinimum`() const

    Returns the minimum y value of all curves in the plot.

  double `yValuesMaximum`() const

    Returns the maximum y value of all curves in the plot.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Desktop in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...