Spark Win/Loss

ALIAS: sparkwinloss

Example of Spark Win-Loss Chart:

FusionCharts should load here..

JavaScript embedding code:

    <script type="text/javascript">
    FusionCharts.ready(function(){
        var myChart = new FusionCharts({
            "type": "sparkwinloss",
            "dataFormat": "jsonurl",
            "dataSource": "chartdata.json"
        });
    });
    </script>

Data for this chart:

...

Chart Attributes

Functional Attributes

These attributes let you control a variety of functional elements on the chart. For example, you can opt to show/hide data labels, data values, y-axis values. You can also set chart limits and extended properties.

Name Type Range Description
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.
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.
paletteThemeColor Color Code Hex Code If you want your own palette derived from a particular hex color, you can specify the same here. All other colors on the chart will automatically derive from that palette.
annRenderDelay Number In seconds If you've defined any annotation groups over the 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.
showValue Boolean 0/1 Whether to show the value of chart?
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()` JavaScript method of the chart to print the same.
useRoundEdges
Since 3.2
Boolean 0/1 If you wish to plot columns with round edges and fill them with a glass effect gradient, set this attribute to 1. `showShadow` attribute doesn't work anymore when this attribute is set to 1.
showShadow
Since 3.2
Boolean 0/1 Whether to show win/loss column shadows.
manageResize
Since 3.2
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.
useEllipsesWhenOverflow
Since 3.2
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.

Chart Caption

These attributes let you configure the chart caption and sub-caption.

Name Type Description
caption String Caption of the chart.
subCaption String Sub-caption of the chart.

Chart Caption Cosmetics

These attributes let you customize the cosmetic properties for the chart caption and sub-caption.

Name Type Range Description
captionAlignment String "left", "center", "right" Sets horizontal alignment of caption
captionOnTop Boolean 0/1 Whether caption should be on top of the data plot area
captionFontSize Number 0 - 72 Sets the caption font size in pixels
subCaptionFontSize Number 0 - 72 Sets the sub-caption font size (in pixels)
captionFont String Font Name Sets the caption font family
subCaptionFont String Font Name Sets the sub-caption font family
captionFontColor Color Hex Code Sets the caption font color
subCaptionFontColor Color Hex Code Sets the sub-caption font color
captionFontBold Boolean 0/1 Whether the caption font should be displayed in bold
subCaptionFontBold Boolean 0/1 Whether the sub caption font should be displayed in bold
alignCaptionWithCanvas Boolean 0/1 Whether the caption is aligned with the canvas. Else, it will be aligned with the entire chart area
captionHorizontalPadding Number In Pixels If caption is not centre aligned, lets you configure the padding (in pixels) from either edge. Will be ignored if caption is centre aligned.

Data Plot (Win/Loss Bar) Properties

These attributes let you customize the cosmetic properties of the data plot (win/loss bar).

Name Type Range Description
winColor Color Code Hex Code Fill colors for bar indicating win
lossColor Color Code Hex Code Fill colors for bar indicating loss
drawColor Color Code Hex Code Fill colors for bar indicating draw
scoreLessColor Color Code Hex Code Fill colors for bar indicating scoreless matches

Period Block Properties

Period blocks are alternate colored bands that help to easily interpret periods on the chart.

These attributes let you customize the cosmetic properties for the period blocks.

Name Type Range Description
periodLength Number How many data points will each period block encapsulate?
periodColor Color Code Hex Code Color for the period block.
periodAlpha Number 0-100 Alpha for the period block.

Chart Cosmetics

These attributes let you customize chart cosmetics like the background color, background alpha, canvas color, canvas alpha etc.

Name Type Range Description
bgColor Color Code Hex 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`.
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.
bgRatio Numbers separated by comma If you've opted for a gradient background, this attribute lets you set the ratio of each color constituent.
bgAngle Number 0-360 Angle of the background color, in case of a gradient.
showBorder Boolean 0/1 Whether to show a border around the chart or not?
borderColor Color Code Hex Code Border color of the chart.
borderThickness Number In pixels Border thickness of the chart.
borderAlpha Number 0-100 Border alpha of the chart.
bgImage String To place any image (JPG/PNG/GIF) as background of the chart, enter the (path and) name of the background image. It should be in the same domain as the chart.
bgImageAlpha Number 0-100 This attribute specifies the opacity for the loaded background image.
bgImageDisplayMode
Since 3.2
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.
bgImageVAlign
Since 3.2
String 'top', 'middle', 'bottom' Helps you to vertically align the background image.
bgImageHAlign
Since 3.2
String 'left', 'middle', 'right' Helps you to horizontally align the background image.
bgImageScale
Since 3.2
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) to your chart, this attribute lets you specify the URL. Due to cross domain security restrictions it is advised to use a logo from the same domain name as your charts.
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 attribute.
logoScale Number 0-100 You can also change the size 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

These attributes let you define the generic font properties for all the text on the chart, allowing you a high level control over font properties.

Name Type Range Description
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 Hex 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.

Chart Paddings and Margins

FusionWidgets XT allows you to manually customize the padding of various elements on the chart to allow advanced manipulation and control over chart visualization. Padding in FusionWidgets XT is always defined in pixels, unless the attribute itself suggests some other scale (like plotSpacePercent).

You can also define the chart margins. Chart margins refer to the empty space left on the top, bottom, left, and right of the chart. That means, FusionWidgets XT will not plot anything in that space.

It is not necessary for you to specify any padding/margin values. FusionWidgets XT automatically assumes the best values for the same.

These attributes let you configure the functional and cosmetic properties of chart paddings and margins.

Name Type Range Description
captionPadding Number In pixels This attribute lets you control the horizontal space (in pixels) between the caption and left side of chart canvas.
valuePadding Number In pixels Horizontal distance between the chart and value
plotSpacePercent Number In percent This attribute defines the space between two columns. If you intend to increase or decrease the spacing between columns, you can do so using this attribute. For example, if you wanted all columns to stick to each other without any space in between, you can set plotSpacePercent to 0. Similarly, if you want very thin columns, you can set plotSpacePercent to its max value of 80.
chartLeftMargin Number In 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 In 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 In pixels Amount of empty space that you want to put on the top of your chart. Nothing is rendered in this space.
chartBottomMargin Number In pixels Amount of empty space that you want to put at the bottom of your chart. Nothing is rendered in this space.
canvasLeftMargin Number In pixels Left margin of canvas. Canvas will start from that position.
canvasRightMargin Number In pixels Right margin of canvas. Canvas will end at that position.

The <set> Element

Each <set> element (child of <dataset> element) represents a set of data which is to be plotted on the graph and determines a set of data which will appear on the chart.

For a single series chart, a typical <set> element will look like:

<set label='January' value='17400' />

These attributes let you configure individual data values in a data-set.

Name Type Range Description
value String 'W', 'L', or 'D' Value for the column. W indicates win, L indicates loss and D indicates draw.
scoreless Boolean 0/1 Whether the match was scoreless? The column can then be colored using a different color.