I created custom shape
public class LineShape : ElementShape
{
public override GraphicsPath CreatePath(Rectangle bounds)
{
var path = new GraphicsPath();
path.AddLine(bounds.X, bounds.Y + 1.0f, bounds.X + bounds.Width, bounds.Y + bounds.Height);
return path;
}
}
When I add a ScatterSeries, then assigned Shape = LineShape. But these points are not drawn on the chart!!!
However, if I add an event
private void LegendElement_VisualItemCreating(object sender, LegendItemElementCreatingEventArgs e)
{
e.ItemElement = new LegendItemElement(e.LegendItem);
if (!(e.LegendItem.Element is ScatterSeries seria)) return;
e.ItemElement.MarkerElement.Shape = seria.Shape;
}
then LineShape drawn in the legend