-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
Feature Suggestion
Feature description: Dash patterns are embedded currently (see code snippet below). In my opinion, they don't look good. I need to change the dash patterns when ScottPlot is creating a pen.
Current GDI class:
var pen = new System.Drawing.Pen(color, (float)width);
if (lineStyle == LineStyle.Solid || lineStyle == LineStyle.None)
{
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
}
else if (lineStyle == LineStyle.Dash)
pen.DashPattern = new float[] { 8.0F, 4.0F }; // LET'S MAKE THIS CONFIGURABLE
else if (lineStyle == LineStyle.DashDot)
pen.DashPattern = new float[] { 8.0F, 4.0F, 2.0F, 4.0F }; // LET'S MAKE THIS CONFIGURABLE
else if (lineStyle == LineStyle.DashDotDot)
pen.DashPattern = new float[] { 8.0F, 4.0F, 2.0F, 4.0F, 2.0F, 4.0F }; // LET'S MAKE THIS CONFIGURABLE
else if (lineStyle == LineStyle.Dot)
pen.DashPattern = new float[] { 2.0F, 4.0F }; // LET'S MAKE THIS CONFIGURABLE
else
throw new NotImplementedException("line style not supported");To be added: Following properties can be added to GDI class:
public float[] DashPatternForDash {get;set;} => new float[] { 8.0F, 4.0F };
public float[] DashPatternForDashDot {get;set;} => new float[] { 8.0F, 4.0F, 2.0F, 4.0F };
public float[] DashPatternForDashDotDot {get;set;} => new float[] { 8.0F, 4.0F, 2.0F, 4.0F, 2.0F, 4.0F };
public float[] DashPatternForDot {get;set;} => new float[] { 2.0F, 4.0F };Thank you,
Murat
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels