ALIAS: multilevelpie
Example of Multi-level Pie Chart:
JavaScript embedding code:
<script type="text/javascript"> FusionCharts.ready(function(){ var myChart = new FusionCharts({ "type": "multilevelpie", "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. |
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. |
clickURL |
String | 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. | |
paletteColors |
String | List of hex color codes separated by comma | While the `palette` attribute allows to select a palette theme that applies to chart background, canvas, font and tool-tips, it does not change the colors of data items (that is, column, line, pie etc.). Using `paletteColors` attribute, you can specify your custom list of hex colors for the data items. The list of colors have to be separated by comma. For example, `"paletteColors": "#FF0000, #0372AB, #FF5904..."`. The chart will cycle through the list of specified colors and then render the data plot accordingly. To use the same set of colors throughout all your charts in a web application, you can store the list of palette colors in your application globally and then provide the same in each chart JSON. |
showPrintMenuItem |
Boolean | 0/1 | When you right click on the chart it shows a context menu. This attribute allows you to show or hide the "Print" option in the context menu. |
unescapeLinks |
Boolean | 0/1 | Internally the chart decodes a Url that you set as link. Before invoking the link it again encodes the Url. If you are passing multilingual characters via a Url or do not want this decode-encode mechanism to be handled by chart you can set,`unescapeLinks='0'`. |
showLabels |
Boolean | 0/1 | Allows you to show or hide the labels on the chart. |
showValues Since 3.2.1 |
Boolean | 0/1 | Allows you to show or hide the values on the chart. |
showValuesInTooltip Since 3.2.1 |
Boolean | 0/1 | Allows you to show the values of the chart in the tooltip. |
showPercentValues Since 3.2.1 |
Boolean | 0/1 | Allows you to show the values as percentage on the chart. |
showPercentInTooltip Since 3.2.1 |
Boolean | 0/1 | Allows you to show the percentage values of the chart in tooltip. |
Chart Titles
These attributes let you set 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. |
Chart Cosmetics
These attributes let you customize chart cosmetics like the background color, background alpha, canvas color, canvas alpha etc.
Name | Type | Range | Description |
---|---|---|---|
showBorder |
Boolean | 0/1 | Whether to show a border around the chart or not. |
borderColor |
Color | 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. |
bgColor |
Color | 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 |
Number | 0-100 | 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. |
bgImage Since 3.2. |
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 Since 3.2. |
Number | 0-100 | This attribute specifies the opacity for the loaded background image. |
bgImageDisplayMode Since 3.2.1 |
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.1 |
String | left, center, right | Helps you to vertically align the background image. |
bgImageHalign Since 3.2.1 |
String | left, center, right | Helps you to horizontally align the background image. |
bgImageScale Since 3.2.1 |
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 | URL | 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-300 | You can also change the scale of an externally loaded logo at run-time by specifying a value for this parameter. |
logoLink |
String | URL | 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. |
Data Plot Cosmetics
These attributes let you customize the cosmetics (columns, lines, area, pie or any data that you're plotting) of the data plots in the chart.
If the plots can show borders, you can control the border properties using the attributes listed below. Or, if they support gradient fills, you can again configure various properties of the gradient using these attributes.
Various other controls over plot cosmetics can be attained using this set of attributes.
Name | Type | Range | Description |
---|---|---|---|
showPlotBorder |
Boolean | 0/1 | Whether the pie border would show up. |
plotBorderColor |
Color | Hex Code | Color for pie border. |
plotBorderThickness |
Number | 0-5 (Pixels) | Thickness for pie border. |
plotBorderAlpha |
Number | 0-100 | Alpha for pie border. |
plotFillAlpha |
Number | 0-100 | This attribute lets you set the fill alpha for plot. |
showShadow |
Boolean | 0/1 | Whether to apply the shadow effect for pie. |
shadowColor |
Color | Hex Code | Lets you set a color of the shadow for pie. |
shadowAlpha |
Number | 0-100 | Lets you set alpha of the shadow for pie. |
plotFillColor |
Color | Hex Code | Fill color for all the pies. |
Data Value Cosmetics
These attributes let you customize the font, background, and border cosmetics of the data values on the chart.
Name | Type | Range | Description |
---|---|---|---|
valueFont |
String | Font Name | Sets the font of the values in the chart |
valueFontColor |
Color | Hex Code | Specifies the value font color |
valueFontSize |
Number | 0 - 72 | Specifies the value font size |
valueFontBold |
Boolean | 0/1 | Whether value font should be bold |
valueFontItalic |
Boolean | 0/1 | Whether value font should be italicized |
valueBgColor |
Color | Hex Code | Sets the background color for value text |
valueBorderColor |
Color | Hex Code | Sets the border color around the value text |
valueAlpha |
Number | 0-100 | Sets the value alpha including font and background |
valueFontAlpha |
Number | 0-100 | Sets the value font alpha |
valueBgAlpha |
Number | 0-100 | Sets the value background alpha |
valueBorderAlpha |
Number | 0-100 | Sets the value border alpha |
valueBorderThickness |
Number | In Pixels | Sets the value border thickness |
valueBorderRadius |
Number | In Pixels | Sets the value border radius |
valueBorderDashed |
Boolean | 0/1 | Whether the border around the value should be rendered as a dashed border |
valueBorderDashGap |
Number | In Pixels | Sets the gap between two consecutive dashes. |
valueBorderDashLen |
Number | In Pixels | Sets the length of each dash |
valueHoverAlpha |
Number | 0-100 | Sets the value alpha on hover |
valueFontHoverAlpha |
Number | 0-100 | Sets the value font alpha on hover |
valueBgHoverAlpha |
Number | 0-100 | Sets the value background alpha on hover |
valueBorderHoverAlpha |
Number | 0-100 | Sets the value border alpha on hover |
showValuesOnHover |
Boolean | 0/1 | Displays the value while dataplot on hover |
Pie/Doughnut Properties
These attributes let you configure the functional properties of a pie/doughnut chart.
Name | Type | Range | Description |
---|---|---|---|
pieRadius |
Number | In Pixels | This attribute lets you explicitly set the outer radius of the chart. The chart automatically calculates the best fit pie radius for the chart. This attribute is useful if you want to enforce one of your own values. |
pieBorderColor |
Hex code | Set the border color of the pie. By default, it is set to 'FFFFFF'. |
Number Formatting Properties
FusionCharts XT offers you a lot of options to format your numbers on the chart.
These attributes let you control a myriad of options like:
- Formatting of commas and decimals
- Number prefixes and suffixes
- Decimal places to which the numbers will round to
- Scaling of numbers based on a user defined scale
- Custom number input formats
These attributes let you appropriately format the numbers displayed on the chart.
Name | Type | Range | Description |
---|---|---|---|
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"`. |
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 will become 1.04K (with decimals set to 2 places). Same with numbers in millions - an M will be added at the end. |
defaultNumberScale |
String | The default unit of the numbers that you're providing to the chart. | |
numberScaleUnit |
String | Unit of each block of the scale. | |
numberScaleValue |
String | Range of the various blocks that constitute the scale. | |
scaleRecursively Since 3.2.2 - SR3 |
Boolean | 0/1 | Whether recursive scaling should be applied. |
maxScaleRecursion Since 3.2.2 - SR3 |
Number | How many recursions to complete during recursive scaling? -1 completes the entire set of recursion. | |
scaleSeparator Since 3.2.2 - SR3 |
String | What character to use to separate the scales that are generated after recursion? | |
numberPrefix |
String | Character | 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. |
numberSuffix |
String | Character | Using this attribute, you could add a suffix to all the numbers visible on the graph. For example, to represent all figures quantified as per annum on the chart, you could specify this attribute to ' /a' to show like 40000/a, 50000/a. |
decimalSeparator |
String | Character | This attribute helps you specify the character to be used as the decimal separator in a number. |
thousandSeparator |
String | Character | This attribute helps you specify the character to be used as the thousands separator in a number. |
thousandSeparatorPosition Since 3.2.2 - SR3 |
Number | This option helps you specify the position of the thousand separator. | |
inDecimalSeparator |
String | Character | In some countries, commas are used as decimal separators and dots as thousand separators. In XML, if you specify such values, it will give an error while converting to number. So, FusionCharts XT accepts the input decimal and thousand separator from user, so that it can convert it accordingly into the required format. This attribute lets you input the decimal separator. |
inThousandSeparator |
String | Character | In some countries, commas are used as decimal separators and dots as thousand separators. In XML, if you specify such values, it will give an error while converting to number. So, FusionCharts XT accepts the input decimal and thousand separator from user, so that it can convert it accordingly into the required format. This attribute lets you input the thousand separator. |
decimals |
Number | 0-10 | Number of decimal places to which all numbers on the chart will 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 XT will convert the number to 23.40 (note the extra 0 at the end). |
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 |
String | Font Name | This attribute lets you set the font face (family) of all the text (data labels, values etc.) on chart. If you specify the `outCnvBaseFont` attribute also, then this attribute controls only the font face of text within the chart canvas bounds. |
baseFontSize |
Number | 0-72 | This attribute sets the base font size of the chart, that is, 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 | Hex Code | This attribute sets the base font color of the chart, that is, 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
These attributes let you configure the functional and cosmetic properties of tool-tips.
Name | Type | Range | Description |
---|---|---|---|
showToolTip |
Boolean | 0/1 | Whether to show tool tip on chart. |
toolTipBgColor |
Color | Hex Code | Background color for tool tip. |
toolTipColor |
Color Code | Hex Code | Font color for the tool-tip. |
toolTipBorderColor |
Color | Hex Code | Border color for tool tip. |
toolTipSepChar |
String | The character specified as the value of this attribute separates the name and value displayed in tool tip. | |
useHoverColor |
Boolean | 0/1 | Whether to use the hover fill color for the pies. |
hoverFillColor |
Color | Hex Code | The color which should be used as fill during hover. |
showToolTipShadow |
Boolean | 0/1 | Whether to show shadow for tool-tips on the chart. |
Data Plot Hover Effects
If you wish to show an effect on the data plot (column, line anchor, pie etc.) when the user hovers his mouse over it, you can apply the hover effects to a data plot.
These attributes let you configure the hover effect for all data plots in the chart.
Name | Type | Range | Description |
---|---|---|---|
showHoverEffect |
Boolean | 0/1 | Whether to enable hover effect on charts for all elements |
plotHoverEffect |
Boolean | 0/1 | Whether to enable hover effect on charts for data plots (e.g., column, pie) only |
plotFillHoverColor |
Color | Hex Code | Specifies the hover color for the data plots |
plotFillHoverAlpha |
Number | 1 - 100 | Specifies the hover alpha for data plots |
Chart Paddings and Margins
PowerCharts 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 PowerCharts 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, PowerCharts XT will not plot anything in that space.
It is not necessary for you to specify any padding/margin values. PowerCharts 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 space (in pixels) between the sub-caption and top of the chart canvas. If the sub-caption is not defined, it controls the space between caption and top of chart canvas. If neither caption, nor sub-caption is defined, this padding does not come into play. |
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. |
The <category> Element
Each <category> element represents a pie slice.
These attributes let you configure the functional and cosmetic properties for the pie slices.
Name | Type | Range | Description |
---|---|---|---|
label |
String | Display value for the pie. | |
value |
Number | Numeric Value | If you do not want a symmetrical distribution for all the pies, you can allot numeric values to individual pies. This can be done using the value attribute of each category. You will need to define the value for all the categories (pies) then. The sweep angle of the pie would depend on its value. If you just want a symmetrical multi-level pie chart, you can ignore the value. |
color |
Color | Hex Code | Color for the pie |
alpha |
Number | 0-100 | Alpha for the pie. |
toolText |
String | The tooltip defined in the `<category>` element appears only when the mouse cursor is hovered over the individual slices. However, this will not appear when the cursor is moved over the data labels (except for a situation when long labels are automatically truncated with ellipses. In this situation, if the mouse cursor is hovered over a truncated label, the tooltip will appear with the full label). In case you want to set a short label and show the full label in tooltip, define the full label using this attribute within the `<category>` element. The tooltip with the full label will appear only when the mouse is hovered on the particular slice. | |
link |
String | Link for the pie. |