| ||
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 > KeyDefinition Struct KeyDefinition StructDefinition structure for data-placeholder in chart keys. Mostly used internally, but may be defined by the calling application to customise legend placeholders. public struct KeyDefinition Public ConstructorsCreate a custom key placeholder (type 1 = line/marker, type 2 = block key for surface or bar, type 3 = stepped line). Block key uses type=2 and requires colour, and optional FillStyle (solid fill is the default): public KeyDefinition( int type, Color color, FillStyle pattern ); Line/marker key is always type=1 and requires Colour,LineStyle and PenWidth. If MarkerSyle is omitted, no markers are drawn. public KeyDefinition( int type, Color color, LineStyle line double penwidth Marker marker ); You may also use this constructor to make a Stepped line key (type=3) suitable for Stepcharts. Example// Make 2 custom legend placeholders key1 = new KeyDefinition(1,Color.Red,LineStyle.Solid,0.8,Marker.SmallBullet); key2 = new KeyDefinition(1,Color.Navy,LineStyle.Solid,0.8,Marker.Ring); // Use them in a hand-made legend block sp.DrawKey(2,10,new KeyDefinition[]{key1,key2}); This creates two placeholders suitable for a chart with lines and markers. RequirementsNamespace: Causeway Assembly: SharpPlot (in sharpplot.dll) See also ...SharpPlot Members | DrawKey Method |