Example
new ac.ACPieChartBuilder()
.setData(myData)
.setTitle("Web browser statistics")
.build()
.addToDom('chart');
Summary
Constructors |
ac.ACPieChartBuilder()
|
Methods |
ac.ACPieChartBuilder
|
addLegendText(legendText [, legendTextPosition] ) |
ac.ACPieChartBuilder
|
addThemePartial(themePartial) |
ac.ACPieChartBuilder
|
addValueSet(valueSet) |
ac.ACPieChart
|
build() |
ac.ACPieChartBuilder
|
clearLegendText() |
String
|
getColorScheme() |
String
|
getDefaultPopupText() |
Float
|
getDonutRadius() |
Float
|
getEndAngleDegrees() |
Float
|
getEndAngleRadians() |
String
|
getFooterText() |
ac.HorizontalAlignment
|
getFooterTextAlignment() |
String
|
getLabelText() |
ac.LegendPosition
|
getLegendPosition() |
String
|
getPalette() |
Float
|
getSliceLabelOffset() |
Float
|
getSliceOffset(index) |
Float
|
getStartAngleDegrees() |
Float
|
getStartAngleRadians() |
String
|
getSummarizeLabel() |
Float
|
getSummarizeThresholdAbsolute() |
Float
|
getSummarizeThresholdPercent() |
String
|
getTheme() |
String[]
|
getThemePartials() |
String
|
getTitle() |
String
|
getTitleImageUrl() |
ac.TitlePosition
|
getTitlePosition() |
ac.HorizontalAlignment
|
getTitleTextAlignment() |
Boolean
|
isDebugMode() |
Boolean
|
isHighlightPlotArea() |
Boolean
|
isShowLegend() |
Boolean
|
isShowPopup() |
ac.ACPieChartBuilder
|
resetSliceOffsets() |
ac.ACPieChartBuilder
|
setBackgroundImageUrl(value) |
ACPieChartBuilder
|
setBooleanVariable(variableName, value) |
ac.ACPieChartBuilder
|
setCSVDataOrder(dataOrder) |
ac.ACPieChartBuilder
|
setCSVDataSeriesConfig(rowTitle, dataModel [,pattern] ) |
ac.ACPieChartBuilder
|
setCSVSeparator(separator) |
ac.ACPieChartBuilder
|
setCSVTitleIndex(index) |
ac.ACPieChartBuilder
|
setCSVXValuesIndex(index) |
ac.ACPieChartBuilder
|
setColorScheme(colorScheme [, origin] ) |
|
setColorVariable(variableName, colorString) |
ac.ACPieChartBuilder
|
setData(data) |
ac.ACPieChartBuilder
|
setDataImportType(dataImportType) |
ac.ACPieChartBuilder
|
setDataUrl(dataUrl) |
ac.ACPieChartBuilder
|
setDebugMode(debugMode) |
ac.ACPieChartBuilder
|
setDecimalSeparator(decimalSeparator) |
ac.ACPieChartBuilder
|
setDefaultPopupText(defaultPopupText [, percentFormattingPattern] ) |
ac.ACPieChartBuilder
|
setDonutRadius(donutRadius) |
ac.ACPieChartBuilder
|
setEndAngleDegrees(endAngle) |
ac.ACPieChartBuilder
|
setEndAngleRadians(endAngle) |
ac.ACPieChartBuilder
|
setFooterText(footerText) |
ac.ACPieChartBuilder
|
setFooterTextAlignment(footerAlignment) |
ac.ACPieChartBuilder
|
setHeight(height) |
ac.ACPieChartBuilder
|
setHighlightPlotArea(highlightPlotArea) |
ac.ACPieChartBuilder
|
setImageVariable(variableName, value) |
ac.ACPieChartBuilder
|
setJsonXId(xidentifier) |
ac.ACPieChartBuilder
|
setJsonYId(yidentifier) |
ac.ACPieChartBuilder
|
setLabelText(labelText) |
ac.ACPieChartBuilder
|
setLegendPosition(legendPosition) |
ACPieChartBuilder
|
setNumberVariable(variableName, value) |
ac.ACPieChartBuilder
|
setPalette(palette, colorScheme [,paletteOrigin, colorSchemeOrigin] ) |
ac.ACPieChartBuilder
|
setPopupText(valueSetIdentifier, popupText,percentFormattingPattern) |
ac.ACPieChartBuilder
|
setShowLegend(showLegend) |
ac.ACPieChartBuilder
|
setShowPopup(showPopup) |
ac.ACPieChartBuilder
|
setSizeVariable(variableName, variableValue) |
ac.ACPieChartBuilder
|
setSliceLabelOffset(labelOffset) |
ac.ACPieChartBuilder
|
setSliceOffset(index, sliceOffset) |
ac.ACPieChartBuilder
|
setStartAngleDegrees(startAngle) |
ac.ACPieChartBuilder
|
setStartAngleRadians(startAngle) |
ac.ACPieChartBuilder
|
setStringVariable(variableName, value) |
ac.ACPieChartBuilder
|
setStyleVariable(variableName, styleOptions) |
ac.ACPieChartBuilder
|
setSummarizeLabel(summarizeLabel) |
ac.ACPieChartBuilder
|
setSummarizeThresholdAbsolute(summarizeThresholdAbsolute) |
ac.ACPieChartBuilder
|
setSummarizeThresholdPercent(summarizeThresholdPercent) |
ac.ACPieChartBuilder
|
setTheme(theme [, origin] ) |
ac.ACPieChartBuilder
|
setTitle(title [, titlePosition,titleImageUrl] ) |
ac.ACPieChartBuilder
|
setTitleImageUrl(titleImageUrl) |
ac.ACPieChartBuilder
|
setTitlePosition(titlePosition) |
ac.ACPieChartBuilder
|
setTitleTextAlignment(titleAlignment) |
ac.ACPieChartBuilder
|
setWidth(width) |
Constructor detail
ac.ACPieChartBuilder()
Constructs a new ACPieChartBuilder.
Example
new ac.ACPieChartBuilder()
Method detail
addLegendText(legendText [, legendTextPosition] )
Adds text to the legend specifying the position where it is to be printed.
You can use this method more than once to add text both to the top and the bottom.
Parameters
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
.addLegendText("top text", ac.LegendTextPosition.TOP)
.addLegendText("bottom text", ac.LegendTextPosition.BOTTOM)
Here we use two calls to add text to the top and to the bottom of the legend.
addThemePartial(themePartial)
Insert additional code into the Theme which controls the display of the chart.
Parameters
String -- additional code which should be part of the theme
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
addValueSet(valueSet)
Adds a value set.
Parameters
ac.ValueSet -- the value set
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
build()
Returns
ac.ACPieChart -- constructed pie chart which can be added to
the DOM.
Errors
An exception will be thrown when an error occurs during the build
process.
clearLegendText()
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
getColorScheme()
Returns
String -- color scheme url
getDefaultPopupText()
Returns
String -- the default popup text
getDonutRadius()
Returns
Float -- the radius in percent
getEndAngleDegrees()
Returns
Float -- end angle in degrees.
getEndAngleRadians()
Returns
Float -- the end angle in radians.
getFooterText()
Retrieve the footer text
Returns
String -- the footer text
getFooterTextAlignment()
Returns the footer text alignment
Returns
getLabelText()
Retrieves the label text.
Returns
String -- the label text
getLegendPosition()
Retrieves the legend position.
Returns
getPalette()
getSliceLabelOffset()
Returns
Float -- slice label offset
getSliceOffset(index)
Parameters
Integer -- slice index
Returns
Float -- slice offset for the specific slice
getStartAngleDegrees()
Returns
Float -- start angle in degrees.
getStartAngleRadians()
Returns
Float -- start angle in radians.
getSummarizeLabel()
Retrieves the summarize label.
Returns
String -- the label
getSummarizeThresholdAbsolute()
Returns
Float -- the summarize threshold as an absolute value
getSummarizeThresholdPercent()
Returns
Float -- the summarize threshold as a percentage.
getTheme()
getThemePartials()
getTitle()
Retrieves the title
Returns
String -- title
getTitleImageUrl()
Retrieves the URL of the title image
Returns
String -- url to the title image
getTitlePosition()
Retrieves the current title position.
Returns
getTitleTextAlignment()
Returns the title text alignment.
Returns
isDebugMode()
Checks whether the chart is in debug mode or not.
Returns
Boolean -- whether it is in debug mode or not.
isHighlightPlotArea()
Returns
Boolean -- true indicates that the plot area is highlighted.
isShowLegend()
Checks whether the legend is shown or not.
Returns
Boolean -- whether or not the legend is shown.
isShowPopup()
Indicates whether popups are active or not.
A popup is a little note that "pops up" when the mouse is
moved over a value point in the chart.
See
ac.ACPieChartBuilder.setShowPopup(showPopup) for information on how to activate popups.
Returns
Boolean -- true when popups are active, false otherwise
resetSliceOffsets()
Resets all slice offsets.
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setBackgroundImageUrl(value)
Sets the URL for a background image.
Parameters
String -- the URL to a background image
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setBooleanVariable(variableName, value)
Sets a boolean variable. This is definitive and will overwrite
any settings in a theme or color scheme.
Parameters
String -- the variable name
Boolean -- boolean variable value.
Returns
ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setCSVDataOrder(dataOrder)
Sets the data order. Data order identifies the data structure.
Parameters
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setCSVDataSeriesConfig(rowTitle, dataModel [,pattern] )
This method configures the way the data will be parsed during CSV parsing.
Parameters
String -- the row title
ac.DataModel -- how the data is organized
String --
optional formatting pattern used for the data sets
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setCSVSeparator(separator)
Sets the separator for the CSV data.
By default the semicolon ";" is used as separator for CSV values.
If you wish to use a different separator you can define it here.
Parameters
String -- the CSV separator
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
.setCSVSeparator(",")
Defines the comma to be the separator for CSV values.
setCSVTitleIndex(index)
Sets the column index which should be used as title. The index numbering starts at 0.
Parameters
Integer -- column index which should be used as title
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
.setCSVIndex( 0 )
Specify the first column to be used as title column. Default is 0.
setCSVXValuesIndex(index)
Sets the row index of data which should be shared between value sets.
Parameters
Integer -- the row index
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setColorScheme(colorScheme [, origin] )
Defines a color scheme and explicitly tells ArcadiaCharts where to look for the
color scheme file by ignoring the built-in search order.
The design of a chart is determined by three xml-files:
- Theme
- ColorScheme
- ColorPalette
The Color-Scheme defines the colors that will be used in the chart.
ArcadiaCharts comes with a set of predefined colorSchemes that should serve most needs.
But you can also define your own color scheme in an xml file and use that instead.
Specifying which file to use is necessary if you wanted to use an external color-scheme-file
with a similar name as a built-in file.
Parameters
String -- colorScheme url or name
ac.Origin --
origin of the color scheme, i.e. built in or external
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setColorVariable(variableName, colorString)
Sets a color theme variable. This is definitive and will overwrite
any settings in a theme or color scheme.
Refer to the handbook for a list of color theme variables.
Parameters
String -- color scheme variable name
String -- color string in RGB(A) or hex notation. R, G and B values may be any integer between 0 and 255, A is a floating point number between 0 and 1.
Example
setColorVariable( "BACKGROUND_SHADOW_COLOR", "rgba( 12, 34, 56, 1.0 )" )
Sets the color of the background shadow to a color value of (12, 34, 56) with 100% opacity.
setColorVariable( "BACKGROUND_SHADOW_COLOR", "#abcdef" )
Sets the color of the background shadow to a color value of #abcdef (hexadecimal), which equals rgb(171, 205, 239) with 100% opacity.
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setData(data)
Attach data in CSV format to the chart.
The function expects the CSV data to be in one long string variable.
Parameters
String -- data in CSV format
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
var myData = "Title;Jan;Feb;Mar;Apr;May;Jun\n"+
"Temperature;4;4;7;10;13;16\n"+
"Precipitation;79;56;70;46;59;59";
// ...
.setData( myData )
Fills a string with data in CSV format and attaches it to the chart.
setDataImportType(dataImportType)
Sets the type of content that should be bound to the chart.
Possible values are CSV, JSON, and XML (not yet implemented)
If no import-Type is set, the default value CSV will be assumed.
Please note that only ac.DataImportType.CSV is working currently.
Parameters
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
setDataImportType( ac.DataImportType.CSV )
specifies the import type to be CSV
setDataUrl(dataUrl)
Specifies a file to load data in CSV-format from.
The location of the file can be specified either as URL or as path.
Please note that due to browser restrictions (same origin policy)
only data from the same url as the chart itself can be retrieved.
Parameters
* dataUrl (text)
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
.setDataUrl("mydata/weather.csv")
.setDataUrl('http://127.0.0.1:8888/data.csv')
These two examples show how to specify the file location as path and as URL.
setDebugMode(debugMode)
Turns the debug mode on or off.
In debug-mode the chart will display additional information that might be useful when
designing the chart. It should be turned off in all other cases.
Parameters
Boolean -- true to activate the debug mode
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
.setDebugMode(true)
Activates the debug mode.
setDecimalSeparator(decimalSeparator)
Sets decimal separator for floating point number.
Parameters
String -- the decimal separator
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
For example in Germany decimal numbers are separated by "," (comma)
whereas the "." (period) is widely used in English speaking countries.
If you some data like
1.000,00 then the decimal separator
would be ",".
.setDecimalSeparator(",")
setDefaultPopupText(defaultPopupText [, percentFormattingPattern] )
Sets the default popup text with a formating pattern for $percent.
Parameters
String -- the default popup text for all slices. You can use the
placeholder $percent in this text add dynamically add the
percentage.
String -- optional formatting pattern for the $percent variable
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setDonutRadius(donutRadius)
Sets the donut radius in 100 percent. Possible values go from
0 to 1, e.g. 0.4 for 40%.
Parameters
Float -- donut radius in percent
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setEndAngleDegrees(endAngle)
Sets the end angle degree.
Parameters
Float -- end angle in degrees
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setEndAngleRadians(endAngle)
Parameters
Float -- ending angle in radians.
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setFooterText(footerText)
Parameters
String -- a footer text
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setFooterTextAlignment(footerAlignment)
Parameters
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. Its a fluent interface
setHeight(height)
Sets the height of the chart in pixels
Parameters
Integer -- height of the chart in pixel
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
.setHeight(400)
This will set the height of the chart to 400 pixels
setHighlightPlotArea(highlightPlotArea)
Highlight the plot area or deactivate it.
Parameters
Boolean -- pass true to activate highlighting, false to deactivate it.
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setImageVariable(variableName, value)
Sets an image variable. This is definitive and will overwrite
any settings in a theme or color scheme.
Parameters
String -- the variable name
String -- textual variable value.
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setJsonXId(xidentifier)
This function is used to attach Data in JSON-Objects to the X axis.
JSON is a universal, language-independent format for data. In this way,
it's similar to XML. Whereas XML uses tags, JSON is a subset of YAML
and actually looks like JavaScript's object-literal notation.
Have a look at this example, containing the current stock price and
price change for the stock-symbols "ABC" "DEF" and "GHI".
[
{
"symbol": "ABC",
"price": 87.86,
"change": -0.41
},
{
"symbol": "DEF",
"price": 62.79,
"change": 0.49
},
{
"symbol": "GHI",
"price": 67.64,
"change": 0.05
}
]
In order to process this data ArcadiaCharts needs to know which value to
put on the X and Y axis.
Parameters
String -- key / property of each object
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
.setJsonXId( "symbol" )
.setJsonYId( "price" )
.setJsonYId( "change" )
setJsonYId(yidentifier)
This function is used to attach Data in JSON-Objects to the X axis.
JSON is a universal, language-independent format for data. In this way,
it's similar to XML. Whereas XML uses tags, JSON is a subset of YAML
and actually looks like JavaScript's object-literal notation.
Have a look at this example, containing the current stock price and
price change for the stock-symbols "ABC" "DEF" and "GHI".
[
{
"symbol": "ABC",
"price": 87.86,
"change": -0.41
},
{
"symbol": "DEF",
"price": 62.79,
"change": 0.49
},
{
"symbol": "GHI",
"price": 67.64,
"change": 0.05
}
]
In order to process this data ArcadiaCharts needs to know which value to
put on the X and Y axis.
Parameters
String -- key / property of each object
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
.setJsonXId( "symbol" )
.setJsonYId( "price" )
.setJsonYId( "change" )
setLabelText(labelText)
Sets the label text. This text will be presented on the pie
chart and is always visible.
Example:
$percent
Parameters
String -- the label text
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setLegendPosition(legendPosition)
Parameters
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
.setLegendPosition( ac.LegendPosition.LEFT )
displays the legend at the left side of the chart.
setNumberVariable(variableName, value)
Sets a number variable. This is definitive and will overwrite
any settings in a theme or color scheme.
Parameters
String -- the variable name
Number -- numeric variable value.
Returns
ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setPalette(palette, colorScheme [,paletteOrigin, colorSchemeOrigin] )
Sets the color-palette with origin. An origin describes if a builtin palette should be used or an external palette.
This is useful if you want to use an external palette-file with a similar name as a builtin file.
The color scheme as a second parameter is necessary, because it highly depends on the
palette and if colors are not defined by the palette that are used by the color scheme,
the chart will not look as intended.
ArcadiaCharts can use custom color palettes in XML-format. The format is self-explanatory.
Check out one of the color-palette files that come with ArcadiaCharts to find out more.
By default ArcadiaCharts first tries to find the palette-file in the list of builtin palettes.
If no builtin palette of this name is found, the document-root will be searched.
The consequence is that if you change "palette_css.xml" on your server the changes will not be
"seen" by ArcadiaCharts since "palette_css.xml" is a builtin palette. ArcadiaCharts finds "palette_css.xml"
in the list of the builtin palettes and uses this without looking any further.
You can either use your own palette name or you tell ArcadiaCharts that you explicitly want to use the palette
file from the server by setting the "palette-origin" parameter.
The same applies to the color scheme origin parameter.
Parameters
String -- palette
String -- Url to the color scheme
ac.Origin --
optional whether the palette is internal or external. This parameter is optional. See the description for the resource location strategy.
ac.Origin --
optional whether the color scheme is internal or external. This parameter is optional. See the description for the resource location strategy.
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setPopupText(valueSetIdentifier, popupText,percentFormattingPattern)
Sets the popup text for one value set (pie slice)
Parameters
String -- the textual value set identifier
String -- the popup text for this specific slice. You can use the
placeholder $percent in this text add dynamically add the
percentage.
String -- optional formatting pattern for the $percent variable
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setShowLegend(showLegend)
Turn legend on or off.
A legend shows the names of the value-sets in the chart
aside the colors and symbols that are used for the presentation of the data.
Parameters
Boolean -- whether or the legend shall be shown
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setShowPopup(showPopup)
Turns the display of popups on or off for the whole chart.
A popup is a little note that "pops up" when the mouse is
moved over a value point in the chart.
In the standard-configuration a popup shows the exact value of
the value point under the mouse.
Popups are highly customizable using formatting patterns.
Parameters
Boolean -- true to activate popups. You can deactivate them by passing
false to this method.
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setSizeVariable(variableName, variableValue)
Sets a size theme variable. This is definitive and will overwrite
any settings in a theme or color scheme.
Refer to the handbook for a list of size theme variables.
Parameters
String -- the variable name
String -- textual variable value. You can use the syntax "min: 0; default: 1; max: 2" here.
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
setSizeVariable( "AXIS_SIZE", "min: 10; default: 0.2 * $chartWidth; max: 20" )
Sets the size of the axis to be between 10 and 20 pixels with a default of 20% chart width.
setSliceLabelOffset(labelOffset)
Sets the slice label offset.
It accepts one parameter, which is the position of the label
relative to the diameter of the circle: 60 signifies that the
label should be printed at 60% of the circle's diameter (i.e.
well within the circle), whereas 130 signifies 130% of the pie
chart's diameter, meaning slightly outside the pie chart.
Parameters
Float -- label offset in percent
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setSliceOffset(index, sliceOffset)
Sets a slice offset.
The method setSliceOffset takes two parameters: the first
signifies the number of the slice that you want to drag outwards
(0=first slice, 1=second slice, ...), and the second should be a
value between 0 and 100, signifying the percentage of the
original pie chart's diameter that the slice should be dragged
outwards. In our example above, we are extruding the first pie
slice by 20% of the original pie chart's diameter.
Parameters
Integer -- slice index
Float -- slice offset in percent
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setStartAngleDegrees(startAngle)
Sets the start angle. This is the angle from which on the library
starts drawing pie slices.
Parameters
Float -- the start angle in degrees.
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setStartAngleRadians(startAngle)
Sets the start angle radian. This is the angle from which on the library
starts drawing pie slices.
Parameters
Float -- the start angle in radians.
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setStringVariable(variableName, value)
Sets a string variable. This is definitive and will overwrite
any settings in a theme or color scheme.
Parameters
String -- the variable name
String -- textual variable value.
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setStyleVariable(variableName, styleOptions)
Sets a style theme variable. This is definitive and will overwrite
any settings in a theme or color scheme. You can define any style you like
and use it in any RichTextElement.
Parameters
String -- variable name
Object -- styling options
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
var myTitleStyle = ac.Util.createHashMap( [
[ "fontWeight", "bold" ]},
[ "fontSize", "22px" ]
} ] );
// ...
.setStyleVariable( "TitleElement", myTitleStyle );
Sets the Title to bold and its font size to 22px.
setSummarizeLabel(summarizeLabel)
Sets the summerize label. This label will be used for
aggregated slices that accounted for less than the threshold
which was set.
Parameters
String -- the label
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setSummarizeThresholdAbsolute(summarizeThresholdAbsolute)
Lets say you want to summarize all the small pie slices as one
pie slice named, e.g. other, you can use this method to achieve
this. By settings the value to 5000 all pie slices with a
value of less than 5000 will be aggregated (summarized) to one
slice.
Parameters
Float -- summarize threshold as an absolute value
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setSummarizeThresholdPercent(summarizeThresholdPercent)
You can use this method to set a summary threshold which will
be used to summarize pie slices that account for less than the
summarize threshold.
Example: You have the following data:
a 60%, b 30%, c 10%, d 5%, e 3%
When you set the summarize threshold to 10% item d and e will
be aggregated and presented as one slice which is named, e.g.
other.
Parameters
Float -- the threshold as a percentage
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setTheme(theme [, origin] )
The layout of a chart is determined by the "theme" which is assigned to it.
ArcadiaCharts is shipped with many predefined themes in the form of xml-files.
The standard-Themes have been hardwired into the library for better performance.
The standard-themes are also included as xml files in order to enable you to make changes to them.
If you set a theme with "setTheme()" the library first checks if the theme-file is available as
built-in theme and, if yes, uses the internal theme.
This means that your changes to one of the standard-theme xml
files will not be seen unless
a) you specify a pathname with the file, for example setTheme("myThemes/theme_standard.xml") or
b) you determine which file to use by specifying the theme-origin ( BUILT_IN, EXTERNAL ).
Please note that the colors of a chart are not defined in the theme but in a colorScheme-XML-File
which works in a similar fashion. Please refer to the setColorScheme-Method for further details.
Parameters
String -- theme URL
ac.Origin --
optional whether it is an internal or external theme
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
.setTheme("theme_standard_plain.xml", ac.Origin.EXTERNAL)
specifies the external "theme_standard_plain" to be used instead of the built-in version.
setTitle(title [, titlePosition,titleImageUrl] )
Sets the chart title and specifies title position and an image.
The function expects a URL to the image.
Most browsers will only let you load images from your current server (same origin policy).
The title can include the following tags:
- <strong>
- <em>
- <b>
- <i>
- <h1>, <h2>, <h3>
- <small>
- <pre>
- <br>
-
Parameters
String -- title which may include the above mentioned tags.
ac.TitlePosition --
optional positioning of the title
String --
optional URL of an image that should be part of the title.
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
setTitle( " This is my Chart", ac.TitlePosition.TOP , "images/myimage.png")
Sets the string "This is my Chart" to be the title.
The word "my" will be formatted in italic typesetting.
The title will be displayed at the top of the chart.
The title includes the image "myimage.png" in the subdirectory "/images" on your server.
setTitleImageUrl(titleImageUrl)
Add an image to the chart title by specifying an URL.
Most browsers will only let you load images from your current
server (same origin policy);
Parameters
String -- title image url
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setTitlePosition(titlePosition)
Sets the title position.
A chart title can be placed at the top or bottom of the chart.
For supported values see
ac.TitlePosition.
Parameters
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setTitleTextAlignment(titleAlignment)
Parameters
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
setWidth(width)
Sets the width of the chart in pixels
Parameters
Integer -- width of the chart in pixel
Returns
ac.ACPieChartBuilder -- the builder instance on which this method
was called. It's a fluent interface.
Example
.setWidth(400)
This will set the width of the chart to 400 pixels