Text Attributes

Attribute Font

Text is drawn using Font objects constructed using the FontName, FontSize and FontStyle attributes. The ChartNode.Font property does not save the Font object, but sets these three attributes.

This arrangement allows one to specify font size and style at lower nodes and change the font face at the root node.

Multiline text strings are allowed. They are created by newline characters in the string that creates the text item.

Attribute FontName

FontName is a string-valued attribute that specifies the logical font name or a font face name. IMSL charting is largely made up of classes that inherit from ChartNode. Therefore AbstractChartNode.FontName should be used to set the font name.

Attribute FontSize

FontSize is an integer-valued attribute that specifies the point size of the font. Its default value is 12. IMSL charting is largely made up of classes that inherit from ChartNode. Therefore AbstractChartNode.FontSize should be used to set the font size.

Attribute FontStyle

FontStyle is a System.Drawing. FontStyle-valued attribute that specifies the font style. This can be a bitwise combination of any of the standard types in the FontStyle enumeration. Its default value is FontStyle.Regular. IMSL charting is largely made up of classes that inherit from ChartNode. Therefore AbstractChartNode.FontStyle should be used to set the font style.

Attribute TextAngle

TextAngle is an integer-valued attribute that specifies the angle, in degrees, at which text is drawn. IMSL charting is largely made up of classes that inherit from ChartNode. Therefore ChartNode.TextAngle should be used to set the text angle. The angle is measured counterclockwise. Its default value is 0.

Attribute TextColor

TextColor is a Color-valued attribute that specifies the color in which the text is drawn. Its default value is Color.Black. IMSL charting is largely made up of classes that inherit from ChartNode. Therefore AbstractChartNode.TextColor should be used to set the text color.

Attribute TextFormat

TextFormat is a Format-valued or a String-valued attribute that specifies how to format string objects. IMSL charting is largely made up of classes that inherit from ChartNode. Therefore AbstractChartNode.TextFormat should be used to set the text format.The .NET Framework provides a wide variety of formatting options and convenient standard format specifiers.

For numeric values, specifiers like “C” for Currency, ‘E” for scientific exponential, and “P” for Percentage are available. DateTime objects can use “d” for a Short date pattern or “D” for a Long date pattern and many others. Custom Numeric Format Strings can be created using “0” for a zero placeholder, "#" for a digit placeholder and others. The default value is “0.00”

Attribute TextFormatProvider

TextFormatProvider is an IFormatProvider-valued attribute that supplies cul­ture-specific formatting information. IMSL charting is largely made up of classes that inherit from ChartNode. Therefore AbstractChartNode.TextFormatProvider should be used to set the text format provider. The default value is null so the default Culture-Info, DateTimeFormatInfo and NumberFormatInfo are utilized.

Attribute Title

Title is a Text-valued that contains the title for a node. IMSL charting is largely made up of classes that inherit from ChartNode. Therefore, most chart classes will set a title using method ChartNode.SetTitle. The chart title is a unique in that the ChartNode.ChartTitle property should be used. The class Text holds a string and its alignment and offset information.

The alignment of a Text object is the bitwise combination of one of

    TEXT_X_LEFT, TEXT_X_CENTER, TEXT_X_RIGHT, and one of

    TEXT_Y_BOTTOM, TEXT_Y_CENTER, TEXT_Y_TOP.

The offset moves the start of the text away from the reference point in the direction of the alignment. So if the alignment bit TEXT_X_LEFT is set and the offset is greater than zero then the text starts a distance further to the left than if the offset were zero. The distance moved is the value of offset times the default marker size. The offset is usually zero, but the Data node sets it to 2.0 for labeling data points.

A Text object is drawn relative to a reference point. The alignment specifies the position of the reference point on the box that contains the text. There are nine such possible positions. In the following samples, the reference point is marked with a square.

If the text is drawn at an angle, then the alignment is relative to the horizontally/vertically aligned bounding box of the text.

Samples

Following are sample fonts in styles plain, italic and bold. These may look different on different platforms.

If the text is drawn at an angle, then the alignment is relative to the horizontally/ vertically aligned bounding box of the text.



Visual Numerics - Developers of IMSL and PV-WAVE
http://www.vni.com/
PHONE: 713.784.3131
FAX:713.781.9260