| |||||||||||||
Introducing SharpPlot Your First Chart Recent Updates Sample Charts Tutorials General Tutorials Chart Tutorials SharpPlot Class Properties Methods Enumerations Style examples Glossaries Active Charts VectorMath Class DBUtil Class Get SharpPlot Download SharpPlot Buying SharpPlot SharpPlot Support Upgrading from GraPL Release notes |
Reference > Structures > LineStyle Struct LineStyle StructLine-styles (built-in and user-defined dash-repeat sequences). public struct LineStyle Public ConstructorCreates a custom dashed line from a vector of even length giving on-off pattern in points. public LineStyle( double[] newDefinition // int[] and Pen are also accepted here ); Examplesp.SetContourStyle(Color.Red,LineStyle.Dash,1.2); sp.SetDatumLineStyle(Color.Maroon,new LineStyle(new int[] {12,4,24,4})); // Long dashes Public Static Properties
Creating Custom Dashed LinesA dashed line is defined by an array of integers which give the on-off-on-off cycle in points. Custom lines are drawn with square ends to make the segments exactly the length you ask for. The cycle always begins at the start of the pattern (so the dash-offset is zero) here. For example: LineStyle mydash = new LineStyle(new int[]{1,2,2,2,3,2,4,2}); Note that in charts rendered to SVG you can animate the dash-offset to give the effect of a ‘walking line’. Using a Pen object with Raster OutputIt is possible to use an existing .Net Pen object to create your line, but this method will only be effective in charts rendered to raster formats. public LineStyle( Pen myPen ); The color and Width of the pen will be overridden by the color setting and width of the line being drawn. RequirementsNamespace: Causeway Assembly: SharpPlot (in sharpplot.dll) See also ...SharpPlot Members | SetDatumLineStyle Method | SetGridLineStyle Method | SetLineStyles Method |