
Advanced configuration - textBlock, layoutSprite, and sprite properties
textBlock
, layoutSprite
, and sprite
are core elements that control property sets that are inherited and/or used by elements that are higher up in the flash charting hierarchy. In most cases you probably won't need to change their defaults, but it really depends on what you hope to achieve with your charts.
Text block
Usage: charting.textBlock.*
The textBlock
element controls text display in legend and axis labels as well as axis title and message text.
Values
- textBlock
Used by
The textBlock
element is referred to by:
pie
chartratioBar
chartlegend
axisLabels
In addition, the axisTitle
element inherits all of its properties from textBlock
, except for placement
.
Text block properties
The textBlock element controls formatting properties for text in chart labels and messages
| ||||
Property name | Value type | Definition | Default | Supported by JSChart? |
text |
string | The raw text to display. (For HTML formatted text, see the htmlText property.) |
No text by default. | No |
textColor |
number | The hexadecimal color value of the text. | 0x000000 (black) |
No |
defaultTextFormat |
textFormat | The format to apply to the text. Arranged as a comma-delimited list of property name/value pairs, enclosed in curly braces. For details (and defaults) see the "Text format properties" subtopic, below. | See below. | No |
htmlText |
string | The HTML-formatted text to display. (For raw text, see the text property.) |
No text by default. | No |
condenseWhite |
boolean | Determines whether white space should be condensed for HTML-formatted text. Used in conjunction with htmlText . |
false |
No |
wordWrap |
boolean | Determines whether to wrap long lines of text to the next line. | false |
No |
overflowMode |
string | Determines the manner in which inline text that overflows layout bounds is handled. Valid values are default ,ellipsisStart (has the same effect as default), ellipsisMiddle (cuts off the text at the middle of the line, halfway to the layout boundary, and adds an ellipsis to indicate continuation), ellipsisEnd (cuts off the overflowing text at the layout boundary and adds an ellipsis to indicate continuation), and ellipsisNone (disables text truncation entirely). |
default |
Yes, but for legend items only. |
useBitmapRendering |
boolean | Indicates whether to render text as a bitmap. Bitmap rendering enables you to apply effects, such as alpha transparency and rotation transforms to the text. |
false |
No |
useBitmapSmoothing |
boolean | Determines whether a smoothing algorithm should be applied to the text when you set useBitmapRendering to true . |
false |
No |
bitmapSmoothingSharpness |
number | When you are working with text and useBitmapRendering and useBitmapSmoothing are both set to true , this enables you to set the sharpness of the smoothing algorithm. Valid values are between 1 (low) and 8 (high). |
3 |
No |
bitmapSmoothingQuality |
number | When you are working with text and useBitmapRendering and useBitmapSmoothing are both set to true , this enables you to set the quality of the smoothing algorithm. Valid values are between 0 (low) and 15 (high). |
1 |
No |
Text format properties
When you work with chart text blocks, there are default text formatting properties that determine basic format aspects like alignment, color, font, indentation, italicization, and so on. You use the defaultTextFormat
property to change the default text format of text blocks.
This table presents the properties and default values for defaultTextFormat
. To specify a new set of defaults for defaultTextFormat
, provide the changes in the form of a comma-delimited list of text formatting property/value pairs, without spaces and enclosed in brackets, like so:
{prop1:value1,prop2:value2,...,propN:valueN}
These are the properties and defaults for defaultTextFormat .
| ||||
Property name | Value type | Definition | Default | Supported by JSChart? |
align |
string | Controls text alignment. Valid values are center , justify , left , and right . |
left |
No |
blockindent |
number | Controls the amount of text block indentation in terms of pixels. | 0 |
No |
bold |
boolean | Controls whether the text is bold or not. | false |
No |
bullet |
boolean | Controls whether the text is bulleted or not. | false |
No |
color |
number | Determines the color of the text, as expressed in hexadecimal values. | 0x000000 (black) |
No |
font |
string | Determines the type of font used for the text. Valid values are _sans (for the default sans-serif font), _serif (for the default serif font) and _typewriter (for the default monospaced font). Additionally you can assign popular fonts by name, such as verdanna --if the font is unavailable the browser will use the machine's default font, which is usually something like Times New Roman. |
_sans |
No |
indent |
number | Controls the indentation from the left margin to the first character in a paragraph, in pixels. | 0 |
No |
italic |
boolean | Controls whether the text is italicized or not. | false |
No |
kerning |
boolean | Determines whether text kerning is enabled. | false |
No |
leading |
number | Determines the amount of vertical space between lines, in pixels. | 0 |
No |
leftMargin |
number | Controls the left margin of the paragraph, in pixels. | 0 |
No |
letterSpacing |
number | Controls the amount of space that is uniformly distributed between all characters. | 0 |
No |
rightMargin |
number | Controls the right margin of the paragraph, in pixels | 0 |
No |
size |
number | Controls the point size of the text. | 12 |
No |
underline |
boolean | Determines whether the text is underlined or not. | false |
No |
Layout sprite
Usage: charting.layoutSprite.*
The layoutSprite
element is the base for all visual elements in charts that require advanced layout management. It has its own properties and inherits root properties from sprite
.
Values
layoutSprite
Used by
All values of the following elements have layoutSprite
properties, along with their own individual properties:
In addition, the legend
element uses layoutSprite
.
Properties
layoutSprite elements are the base for all charting elements that require advanced layout management. They inherit properties from sprite and have the following additional properties.
| ||||
Property name | Value type | Definition | Default | Supported by JSChart? |
visibility |
string | Controls the sprite visibility mode. Valid values are visible (sprite element is displayed), hidden (sprite element is hidden, but layout space is reserved for it), and collapsed (sprite element is hidden, and space is not reserved for it in the layout). |
visible |
No |
clip |
boolean | Determines whether the sprite portions that fall outside its layout bounds are clipped. | false |
No |
snap |
boolean | Determines whether to snap the sprite to whole pixels. | false |
No |
minimumWidth |
number | The minimum allowable width of the sprite, in pixels. | 0 |
No |
minimumHeight |
number | The minimum allowable height of the sprite, in pixels. | 0 |
No |
maximumWidth |
number | The maximum allowable width of the sprite, in pixels. | Infinity |
No |
maximumHeight |
number | The maximum allowable height of the sprite, in pixels. | Infinity |
No |
margin |
margin | The margin to place around the sprite, in pixels. Should be represented as four comma-separated integers within parentheses and without spaces, representing left, right, top, and bottom, respectively | (0,0,0,0) |
No |
alignmentX |
number | The horizontal alignment of the sprite within its layout bounds. Valid values are between 0 (left aligned) and 1 (right aligned). |
auto |
No |
alignmentY |
number | The vertical alignment of the sprite within its layout bounds. Valid values are between 0 (top aligned) and 1 (bottom aligned). |
auto |
No |
layoutTransform |
matrix | Defines the transformation matrix to apply to the sprite before layout. This is represented as a comma-delimited list of six numeric values enclosed within parentheses and without spaces, corresponding to a, b, c, d, tx, and ty respectively: (a,b,c,d,tx,ty) . |
No default defined. | No |
renderTransform |
matrix | Defines the transformation matrix to apply to the final rendered fill. This is represented as a comma-delimited list of six numeric values enclosed within parentheses and without spaces, corresponding to a, b, c, d, tx, and ty respectively: (a,b,c,d,tx,ty) . |
No default defined. | No |
renderTransformOrigin |
point | The origin, or anchor point, of the renderTransform . A point is represented by two integers representing x and y coordinates respectively, comma-separated within parentheses and without spaces. |
(0,0) |
No |
renderTransformOriginMode |
string | The coordinate mode of the RenderTransformOrigin . Valid values are relative (indicating coordinates are between 0 and 1 ) and absolute (indicating coordinates are in pixels). |
relative |
No |
Sprite
sprite
is the base visual element for Splunk charts. It provides properties to the layoutSprite
element, and also provides properties to visual elements in each chart type.
Values
- sprite
Used by
layoutSprite
- every
chart
type
Properties
The sprite element provides root properties for several charting elements.
| ||||
Property name | Value type | Definition | Default | Supported by JSChart? |
x |
number | The x position of the sprite in its parent container. | 0 |
No |
y |
number | The y position of the sprite in its parent container. | 0 |
No |
width |
number | The width of the sprite in pixels. | auto |
No |
height |
number | The height of the sprite in pixels. | auto |
No |
scaleX |
number | The x scale of the sprite. | 1 |
No |
scaleY |
number | The y scale of the sprite. | 1 |
No |
rotation |
number | The rotation of the sprite in degrees. | 1 |
No |
alpha |
number | The alpha transparency of the sprite. Valid values are between 0 (transparent) and 1 (opaque). |
1 |
No |
visible |
boolean | Determines whether the sprite is visible or not. | true |
No |
blendMode |
string | Determines the blend mode to apply to the sprite. The blend mode affects how an object looks in relation to the objects around or underneath it. This is achieved by varying the transparency or color of the blended object. Valid values include:add , alpha , darken , difference , erase , hardlight , invert , layer , lighten , multiply , normal , overlay , screen , subtract . For more information, see this discussion of Flash blend modes. |
normal |
No |
PREVIOUS Advanced configuration - Layout and data table properties |
NEXT Module Reference |
This documentation applies to the following versions of Splunk® Enterprise: 6.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.0.9, 6.0.10, 6.0.11, 6.0.12, 6.0.13, 6.0.14, 6.0.15, 6.1, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 6.1.7, 6.1.8, 6.1.9, 6.1.10, 6.1.11, 6.1.12, 6.1.13, 6.1.14, 6.2.0, 6.2.1, 6.2.2, 6.2.3, 6.2.4, 6.2.5, 6.2.6, 6.2.7, 6.2.8, 6.2.9, 6.2.10, 6.2.11, 6.2.12, 6.2.13, 6.2.14, 6.2.15
Comments
can anyone give an example of the usage please?
Thanks
Hi Antonyhan,
This is a good question for the Answers community forum. You can post the question here: http://answers.splunk.com