| ||
Introducing SharpPlot Your First Chart Recent Updates Sample Charts Tutorials General Tutorials Chart Tutorials SharpPlot Class Methods Structures Enumerations Style examples Glossaries Active Charts VectorMath Class DBUtil Class Get SharpPlot Download SharpPlot Buying SharpPlot SharpPlot Support Upgrading from GraPL Release notes |
Reference > Properties > YCaption Property SharpPlot.YCaption PropertySets the Y caption or a pair of captions. The Y-axis caption is written by default vertically alongside the axis. public string YCaption {get; set;} Examplesp.YCaption = "Tonnes"; It may also be placed above the top of the axis: sp.YAxisStyle = YAxisStyles.AtEnd; This is a better placement for short captions such as ‘mm’ or ‘kg’. Captions written at the top of the axis will be split into multiple lines if you include ‘\n’ in the text, for example ‘Height\n(cm)’ will give a two-line caption. The Caption style controls the alignment of the text for captions placed ‘atend’. For centred ‘atend’ captions the centred text is wrapped into an effective width of twice the appropriate margin, and left or right aligned text is wrapped into the margin width. Setting a pair of captionsIf you pass a pair of captions separated by the tab character, they are written at the lower and upper ends of the axis. sp.YCaption = "Cooler\tHotter"; This is a useful technique when the X-axis is vertically centered. sp.XAxisStyle = XAxisStyles.ArrowedAxis|XAxisStyles.BalancedAxis|XAxisStyles.AtEndCaption; sp.YCaption = "Cooler\tHotter"; sp.XCaption = "Drier\tMuch\nWetter"; sp.YAxisStyle = YAxisStyles.ArrowedAxis|YAxisStyles.BalancedAxis|YAxisStyles.AtEndCaption; See also ...SharpPlot Members | CaptionStyle Property | YCaptionFormat Property | Formatting text with simple HTML tags |