| ||
Introducing SharpPlot Your First Chart Recent Updates Sample Charts Tutorials General Tutorials Chart Tutorials SharpPlot Class Properties 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 > Methods > MapCoords - Convert chart co-ordinates to points SharpPlot.MapCoords – Convert chart co-ordinates to pointsMaps values from chart axes to points, relative to current origin. Returns two matching arrays of x and y values. This is useful for positioning text output and drawing arbitrary text, for example to annotate data points. Exampleyvec = sp.GetYTickPositions(); sp.NoteStyle = NoteStyles.Absolute; nyv = sp.MapCoords(0,yvec)[1]; foreach (double ny in nyv) sp.DrawNote("Hello",0,ny); Overloads
DescriptionWhen positioning text, it may be useful to convert from the co-ordinate system of the chart (defined by the (x,y) axes) to points. This allows you to use Absolute Positioning of Notes or Keys which is much more useful when making simple typographic adjustments, such as centre-lining text on the x-height of the font. This simple utility takes note of the current state of the chart, and converts matching arrays of x and y values to an array of arrays of points, with appropriate origin for use with the AbsolutePosition style. See also ...SharpPlot Members | GetXTickPositions Method | GetYTickPositions Method |