FusionCharts for Flex > FusionWidgets and XML > Widget XML API > Gauges > Bulb Gauge

Bulb Gauge Specification Sheet

SWF: Bulb.swf

Bulb Gauge
 Sample XML for Bulb Gauge

<chart upperLimit='100' lowerLimit='0' numberSuffix='%'>
   <colorRange>
      <color minValue='0' maxValue='15' label='Low' code='00FF00' />
      <color minValue='15' maxValue='35' label='Medium' code='FFFF00' />
      <color minValue='35' maxValue='100' label='High' code='FF0000' />
   </colorRange>
   <value>12</value>
</chart>

Chart Objects

Object Name Description STYLES supported Animation Parameters
BACKGROUND Background refers to the background for entire chart.
  • Animation
  • Shadow
  • Glow
  • Bevel
  • Blur
  • _alpha
  • _x
  • _y
  • _xScale
  • _yScale
GAUGE The bulb which represents value.
  • Animation
  • Shadow
  • Glow
  • Bevel
  • Blur
  • _alpha
  • _x
  • _y
  • _xScale
  • _yScale
VALUE Value textfield for the chart (if visible).
  • Animation
  • Font
  • Shadow
  • Glow
  • Bevel
  • Blur
  • _alpha
  • _x
  • _y

<chart> element Attributes
Attribute Name Type / Range Description
Functional Attributes
animation Boolean (0/1) This attribute lets you set the configuration whether the chart should appear in an animated fashion. If you do not want to animate any part of the chart, set this as 0.
defaultAnimation Boolean (0/1) By default, each chart animates some of its elements. If you wish to switch off the default animation patterns, you can set this attribute to 0. It can be particularly useful when you want to define your own animation patterns using Styles feature.
clickURL URL in FusionCharts format The entire chart can now act as a hotspot. Use this URL to define the hotspot link for the chart. The link can be specified in FusionCharts Link Format.
palette Number (1-5) Each chart has 5 pre-defined color palettes which you can choose from. Each palette renders the chart in a different color theme. Valid values are 1-5.
paletteThemeColor Color Code If you want your own palette derived from a particular hex color, you an specify the same here. All other colors on the chart would automatically derive from that palette.
annRenderDelay Number (seconds) If you've defined any annotation groups over chart, using this attribute you can set the duration after which they'll render on the chart. The timer starts from the time the chart has initialized.
autoScale Boolean (0/1) If you've defined the chart parameters (like gauge origin, co-ordinates etc.) using a different chart size and now want to scale the chart to a different size, you need to specify the original width and height and then set this attribute to 1.
manageResize
Since v1.3
Boolean (0/1) Setting this attribute to 1, you can allow the chart to automatically resize itself when the parent container of the chart is resized. This setting is not applicable when autoScale is set to 0.This setting is not applicable when autoScale is set to 0.
origW Number (Pixels) If you've opted to dynamically resize the chart, you can convey the original width of chart using this attribute. It refers to the width based on which you had defined the various co-ordinates/radius of the gauge.

For example, if you had designed a gauge with 300 px width and in that you had set the gauge radius to be 100, then you can use the dynamic resizing feature and specify origW='300'. It will automatically check the current width and scale the radius etc. appropriately. Please note that both the original width and height of the chart need to be set.

To know more on how this attribute works, please read Angular Gauge > Dynamic Resizing page.
origH Number (Pixels) If you've opted to dynamically resize the chart, you can convey the original height of chart using this attribute. It refers to the height based on which you had defined the various co-ordinates/radius of the gauge.

For example, if you had designed a gauge with 300 px height and in that you had set the gauge radius to be 100, then you can use the dynamic resizing feature and specify origH='300'. It will automatically check the current height and scale the radius etc. appropriately. Please note that both the original width and height of the chart need to be set.

To know more on how this attribute works, please read Angular Gauge < Dynamic Resizing page.
showValue Boolean (0/1) Whether to show chart's value?
useColorNameAsValue Boolean (0/1) Whether to use the color range label as value or show the actual numerical value?
placeValuesInside Boolean (0/1) Whether to place values inside the bulb or below it?
showPrintMenuItem Boolean (0/1) Whether to show "Print Chart" item in the context menu of the chart? Even if you opt to hide the item in context menu, you can still opt to invoke print() method of the chart to print the same.
showAboutMenuItem Boolean (0/1) Setting this to 1 shows up a custom context menu in the chart, which can be customized to show your text and can be linked to your URL. For e.g., you can set the context menu of the chart to include "About your company name" and then link to your company home page. By default, the chart shows "About FusionCharts" when right clicked.
aboutMenuItemLabel String The menu item label for the custom context menu item.
aboutMenuItemLink String Link for the custom context menu item. You can specify the link in FusionCharts link format to be able to open the same in new window, pop-ups, frames or as JavaScript links.
refreshInstantly
Since v1.3
Boolean (0/1) By default, the real-time charts wait for a few seconds after rendering for the first time and before updating itself with new data. To allow the chart to start updating itself as soon as it is rendered, set this attribute to 1.
useEllipsesWhenOverflow
Since v1.3
Boolean (0/1) When enabled in AUTO mode, long data labels are truncated by adding ellipses to prevent them from overflowing the chart background. The default value is 1.
 
Axis properties
upperLimit Number This attribute helps you explicitly set the lower limit of the chart. If you don't specify this value, it is automatically calculated by FusionCharts based on the data provided by you.
lowerLimit Number This attribute helps you explicitly set the upper limit of the chart. If you don't specify this value, it is automatically calculated by FusionCharts based on the data provided by you.
 
Real-time properties
dataStreamURL URL This parameter sets the path of the page, which is supposed to relay real-time data to the chart. If you've special characters as a part of your data stream URL, like ? or &, you'll need to URL Encode the entire dataStreamURL

This page needs to be on the same sub-domain on which the chart is hosted and invoked from. Otherwise, the Flash sandbox security would restrict it from accessing the data and hence the real-time feature won't work.
Example: dataStreamURL='liveQuote.aspx?name=xyz'
refreshInterval Number For this parameter, you can specify the number of seconds after which the chart will look for new data. This process will happen continuously - i.e., if you specify 5 seconds here, the chart will look for new data every 5 seconds.
dataStamp String Constantly changing data stamp that can be added to real time data URL, so as to maintain a state. Please see the section Real time capabilities > Adding data-stamp
showRTMenuItem Boolean (0/1) Whether to show the real-time update related menu items (like Start/Stop Update) in chart's context menu?
 
Gauge Scale (Color Range) Properties
gaugeFillAlpha Number (0-100) Fill alpha for the bulb.
gaugeOriginX Number (Pixels) If you want to specify your origin X for the bulb, please use this attribute.
gaugeOriginY Number (Pixels) If you want to specify your origin Y for the bulb, please use this attribute.
gaugeRadius Number (Pixels) Your custom radius for the bulb.
showGaugeBorder Boolean (0/1) Whether to show a border around bulb?
gaugeBorderColor Color Code or Fill Mix formula (but single token) Color of bulb border. You can either specify a hex code here (like 333333), or a single token from gradient fill mix like {dark-20} or {light-30}. The chart will then calculate the border color for each color range individually (based on the color code for each color range).
gaugeBorderThickness Number (Pixels) Thickness of bulb border.
gaugeBorderAlpha Number (0-100) Alpha of bulb border.
is3D Boolean (0/1) Whether to render the bulb in 2D or 3D mode?
 
Message Logger
useMessageLog Boolean (0/1) Whether to use message logger for the chart?
messageLogWPercent Number (percent) This attribute lets you set the width percent of the message logger window w.r.t entire chart width. So, if you set it as 80, the message logger window will take up 80% of chart width.
messageLogHPercent Number (percent) This attribute lets you set the height percent of the message logger window w.r.t entire chart height.
messageLogShowTitle Boolean (0/1) Whether to show the title for message logger?
messageLogTitle String If you've opted to show the title for message logger, you can define your custom title here. Examples are "Error log", "Server History" etc. The title displays at the top left corner of chart.
messageLogColor Color Code You can customize the color of the entire message log window by setting a hex value for this attribute.
messageGoesToLog Boolean (0/1) The messages streamed to the chart can either be displayed in the message log window or can be passed to JavaScript (which we'll see next). This attribute lets you control whether the messages should be logged in the in-built log window.
messageGoesToJS Boolean (0/1) This attribute lets you configure whether each message streamed from the server should be passed to a local JavaScript function.
messageJSHandler String If you've opted to pass each message to JavaScript function, this attribute lets you define the name of the function. This helps you create your custom functions to react to messages streamed from server.
messagePassAllToJS Boolean (0/1) Whether all parameters passed as part of message envelope be passed to the custom JavaScript function.
 
Number Formatting Properties
formatNumber Boolean (0/1) This configuration determines whether the numbers displayed on the chart will be formatted using commas, e.g., 40,000 if formatNumber='1' and 40000 if formatNumber='0'
numberPrefix String Using this attribute, you could add prefix to all the numbers visible on the graph. For example, to represent all dollars figure on the chart, you could specify this attribute to ' $' to show like $40000, $50000. For more details, please see Advanced Number Formatting section.
numberSuffix String Using this attribute, you could add suffix to all the numbers visible on the graph. For example, to represent all figure quantified as per annum on the chart, you could specify this attribute to ' /a' to show like 40000/a, 50000/a. For more details, please see Advanced Number Formatting section.
decimals Number Number of decimal places to which all numbers on the chart would be rounded to.
forceDecimals Boolean (0/1) Whether to add 0 padding at the end of decimal numbers? For example, if you set decimals as 2 and a number is 23.4. If forceDecimals is set to 1, FusionCharts will convert the number to 23.40 (note the extra 0 at the end)
formatNumberScale Boolean (0/1) Configuration whether to add K (thousands) and M (millions) to a number after truncating and rounding it - e.g., if formatNumberScale is set to 1, 1043 would become 1.04K (with decimals set to 2 places). Same with numbers in millions - an M will added at the end. For more details, please see Advanced Number Formatting section.
defaultNumberScale String The default unit of the numbers that you're providing to the chart. For more details, please see Advanced Number Formatting section.
numberScaleUnit String Unit of each block of the scale. For more details, please see Advanced Number Formatting section.
numberScaleValue String Range of the various blocks that constitute the scale. For more details, please see Advanced Number Formatting section.
scaleRecursively Boolean (0/1) Whether to scale the number recursively? For more details, please see Advanced Number Formatting section.
maxScaleRecursion Number How many recursions to complete during recursive scaling? -1 completes the entire set of recursion.
scaleSeparator String What character to use to separte the scales that generated after recursion?
decimalSeparator String This option helps you specify the character to be used as the decimal separator in a number. For more details, please see Advanced Number Formatting section.
thousandSeparator String This option helps you specify the character to be used as the thousands separator in a number. For more details, please see Advanced Number Formatting section.
inDecimalSeparator String In some countries, commas are used as decimal separators and dots as thousand separators. In XML, if you specify such values, it will give a error while converting to number. So, FusionCharts accepts the input decimal and thousand separator from user, so that it can covert it accordingly into the required format. This attribute lets you input the decimal separator. For more details, please see Advanced Number Formatting section.
inThousandSeparator String In some countries, commas are used as decimal separators and dots as thousand separators. In XML, if you specify such values, it will give a error while converting to number. So, FusionCharts accepts the input decimal and thousand separator from user, so that it can covert it accordingly into the required format. This attribute lets you input the thousand separator. For more details, please see Advanced Number Formatting section.
 
Background Cosmetics
bgColor Color Code This attribute sets the background color for the chart. You can set any hex color code as the value of this attribute. To specify a gradient as background color, separate the hex color codes of each color in the gradient using comma. Example: FF5904,FFFFFF. Remember to remove # and any spaces in between. See the gradient specification page for more details.
bgAlpha Number (0-100) Sets the alpha (transparency) for the background. If you've opted for gradient background, you need to set a list of alpha(s) separated by comma. See the gradient specification page for more details.
bgRatio Numbers separated by comma If you've opted for a gradient background, this attribute lets you set the ratio of each color constituent. See the gradient specification page for more details.
bgAngle Number (0-360) Angle of the background color, in case of a gradient. See the gradient specification page for more details.
showBorder Boolean (0/1) Whether to show a border around the chart or not?
borderColor Color Code Border color of the chart.
borderThickness Number (Pixels) Border thickness of the chart.
borderAlpha Number (0-100) Border alpha of the chart.
bgImage

or

bgSWF - deprecated
String To place any image (JPG/PNG/GIF) or Flash movie (SWF) as background of the chart, enter the (path and) name of the background image or SWF file. It should be in the same domain as the chart.
bgImageAlpha

or

bgSWFAlpha - deprecated
Number (0-100) Helps you specify the opacity for the loaded background image or Flash movie.
bgImageDisplayMode
Since v1.3
String (stretch, tile, fit, fill, center, none) Helps you specify the mode in which the background image is to be displayed.
  • Stretch - expands the image to fit the entire chart area, without maintaining original image constraints
  • Tile - the image is repeated as a pattern on the entire chart area
  • Fit - fits the image proportionately on the chart area
  • Fill -proportionately fills the entire chart area with the image
  • Center - the image is positioned at the center of the chart area
  • None - Default mode. None of the above modes are applied
For more details click here.
bgImageVAlign
Since v1.3
String (top, middle, bottom) Helps you to vertically align the background image.
bgImageHAlign
Since v1.3
String (left, middle, right) Helps you to horizontally align the background image.
bgImageScale
Since v1.3
Number (0-300) Helps you magnify the background image.This attribute will only work when the attribute bgImageDisplayMode is set to none, center or tile.
logoURL String You can load an external logo (JPEG/PNG/SWF) on the chart once it has rendered. This attribute lets you specify the URL of the same. Owing to Flash Player security settings, you can only specify logo that are on the sub-domain as the SWF file of the chart.
logoPosition String ( TL, TR, BL, BR, CC )

Where to position the logo on the chart:

  • TL - Top-left
  • TR - Top-right
  • BR - Bottom right
  • BL - Bottom left
  • CC - Center of screen
logoAlpha Number (0-100) Once the logo has loaded on the chart, you can configure its opacity using this atribute.
logoScale Number (0-100) You can also change the scale of externally loaded logo at run-time by specifying a value for this parameter.
logoLink String If you want to link the logo to an external URL, specify the link in this attribute. The link can be in FusionCharts link format, allowing you to link to new windows, pop-ups, frames etc.
 
Font Properties
baseFont Font Name This attribute lets you set the font face (family) of all the text (data labels, values etc.) on chart. If you specify outCnvBaseFont attribute also, then this attribute controls only the font face of text within the chart canvas bounds.
baseFontSize Number This attribute sets the base font size of the chart i.e., all the values and the names in the chart which lie on the canvas will be displayed using the font size provided here.
baseFontColor Color Code This attribute sets the base font color of the chart i.e., all the values and the names in the chart which lie on the canvas will be displayed using the font color provided here.
 
Tool tip properties
showToolTip Boolean (0/1) Whether to show tool tip for the chart?
toolTipBgColor Color Code Background color for the tool tip
toolTipBorderColor Color Code Border Color for the tool tip.
showToolTipShadow Boolean (0/1) Whether to show shadow for tool-tips on the chart.
 
Chart Paddings & Margins
chartLeftMargin Number (Pixels) Amount of empty space that you want to put on the left side of your chart. Nothing is rendered in this space.
chartRightMargin Number (Pixels) Amount of empty space that you want to put on the right side of your chart. Nothing is rendered in this space.
chartTopMargin Number (Pixels) Amount of empty space that you want to put on the top of your chart. Nothing is rendered in this space.
chartBottomMargin Number (Pixels) Amount of empty space that you want to put on the bottom of your chart. Nothing is rendered in this space.
valuePadding Number (Pixels) Distance between the value and bulb.

<colorRange> --> <color> element
Attribute Name Type / Range Description
minValue Number Indicates the starting value of that color range. The minValue of the first color range should be equal to the chart's lowerLimit, and the minValue of the succeeding <color> element should be equal to the current <color> element's maxValue.
maxValue Number Indicates the end value of that color range. The maxValue of the last color range should be equal to the chart's upperLimit.
code Color Code Actual color (hex color) of the color range using which it will be filled.
label String Visible label for the color range.
alpha Number (0-100) Sets the transparency of each range in the color range.
borderColor Color Code Border color of that particular color in the range. If you want to specify a different border for each range in the color range, you can use this attribute.
borderAlpha Number (0-100) Border alpha for the color range.


The chart also accepts the following XML elements, which have not been discussed here:

  • <annotations> - Discussed in the section Annotations
  • <styles> - Discussed in the section STYLEs
  • <alerts> - Discussed in the section Alert Manager