Skip to content

SignalXY: Too many markers drawn in step display mode #1896

@grabul

Description

@grabul

After version > 4.1.33 if StepDisplay = true every point to draw a line to is now marked with a marker (if marker size > 0).

image

Possible fix in SignalPlotXYGeneric.cs:

add line

        PointF[] PointsToMark = (PointF[])PointsToDraw.Clone();

before

        if (StepDisplay)
            PointsToDraw = GetStepPoints(PointsToDraw);

and replace variable PointsToDraw with PointsToMark in the section below where the drawing of the markers is done

      if (PointsToMark.Length > 1)
      {
          float dataSpanXPx = PointsToMark[PointsToMark.Length - 1].X - PointsToMark[0].X;
          float markerPxRadius = .3f * dataSpanXPx / PointsToMark.Length;
          markerPxRadius = Math.Min(markerPxRadius, MarkerSize / 2);
          float scaledMarkerSize = markerPxRadius * 2;

          if (markerPxRadius > .3)
          {
              // skip not visible before and after points
              var PointsWithMarkers = PointsToMark
                                      .Skip(PointBefore.Length)
                                      .Take(PointsToDraw.Length - PointBefore.Length - PointAfter.Length)
                                      .ToArray();

              MarkerTools.DrawMarkers(gfx, PointsWithMarkers, MarkerShape, scaledMarkerSize, MarkerColor, MarkerLineWidth);
          }
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGunexpected behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions