| ||
SharpPlot Tutorials General Tutorials Chart Samples Style Examples SharpLeaf Tutorials Document Layout Tutorials Text Flow Tutorials Table Tutorials Visual Glossaries SharpPlot Class SharpPlot Properties SharpPlot Methods SharpPlot Enumerations PageMap Class SharpLeaf Reference SharpLeaf Class SharpLeaf Properties SharpLeaf Methods Table Class Table Properties Table Methods SharpLeaf Structures FontType Structure ParagraphStyle Structure BoxStyle Structure SharpLeaf Enumerations DocumentLayout Classes DocumentLayout Class PageLayout Class PageElement Abstract Class Frame : PageElement Class TextBlock : PageElement Class ImageBlock : PageElement Class Box : PageElement Class Rule : PageElement Class Common Reference Document Class VectorMath Class DbUtil Class Download Release Notes Licensing |
SharpPlot Reference > SharpPlot 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 ); You might also want to specify the edge of the block public KeyDefinition( int type, Color color, FillStyle pattern, double edgeNib, Color edgeColor, LineStyle edgeLine ); 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 | SharpPlot.DrawKey Method |