|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.smartgwt.client.widgets.BaseWidget
com.smartgwt.client.widgets.Canvas
com.smartgwt.client.widgets.drawing.DrawPane
com.smartgwt.client.widgets.chart.FacetChart
public class FacetChart
HTML5-based charting engine, implementing all chartTypes of the Chart interface.
Can be used directly, or specified as chartConstructor
or
chartConstructor
.
NOTE: you must load the Drawing and Charts
Optional Modules
before you can use FacetChart.
To create a FacetChart, set facets
to an Array of Facet
objects describing the
chart dimensions and valueProperty
to value field
name. For example:
// Creating data Record sprRec = new Record(); sprRec.setAttribute("season", "Spring"); sprRec.setAttribute("temp", "79"); Record sumRec = new Record(); sumRec.setAttribute("season", "Summer"); sumRec.setAttribute("temp", "102"); Record autRec = new Record(); autRec.setAttribute("season", "Autumn"); autRec.setAttribute("temp", "81"); Record winRec = new Record(); winRec.setAttribute("season", "Winter"); winRec.setAttribute("temp", "59"); // Creating chart FacetChart chart = new FacetChart(); chart.setFacets(new Facet("season", "Season")); chart.setValueProperty("temp"); chart.setData(new Record[]{sprRec, sumRec, autRec, winRec}); chart.setTitle("Average temperature in Las Vegas");
Having an "inlined facet" is another method to provide data to the chart. In this case each CellRecord
contains multiple data values; one facet definition is considered "inlined", meaning that
the facetValueIds from this facet appear as properties in each Record, and each such
property holds one data value. In this case the singular valueProperty
is ignored.
For example:
// Creating data CellRecord lvRec = new CellRecord(); lvRec.setAttribute("spring", "79"); lvRec.setAttribute("summer", "102"); lvRec.setAttribute("autumn", "81"); lvRec.setAttribute("winter", "59"); // Creating inlined facet Facet inlinedFacet = new Facet(); inlinedFacet.setInlinedValues(true); inlinedFacet.setValues( new FacetValue("spring", "Spring"), new FacetValue("summer", "Summer"), new FacetValue("autumn", "Autumn"), new FacetValue("winter", "Winter")); // Creating chart FacetChart chart = new FacetChart(); chart.setFacets(inlinedFacet); chart.setData(new Record[]{lvRec}); chart.setTitle("Average temperature in Las Vegas");Example with two facets:
// Creating data CellRecord lvRec = new CellRecord(); lvRec.setAttribute("city", "Las Vegas"); lvRec.setAttribute("spring", "79"); lvRec.setAttribute("summer", "102"); lvRec.setAttribute("autumn", "81"); lvRec.setAttribute("winter", "59"); CellRecord nyRec = new CellRecord(); nyRec.setAttribute("city", "New York"); nyRec.setAttribute("spring", "60"); nyRec.setAttribute("summer", "83"); nyRec.setAttribute("autumn", "66"); nyRec.setAttribute("winter", "40"); // Creating inlined facet Facet inlinedFacet = new Facet(); inlinedFacet.setInlinedValues(true); inlinedFacet.setValues( new FacetValue("spring", "Spring"), new FacetValue("summer", "Summer"), new FacetValue("autumn", "Autumn"), new FacetValue("winter", "Winter")); // Creating chart FacetChart chart = new FacetChart(); chart.setFacets(inlinedFacet, new Facet("city", "City")); chart.setData(new Record[]{lvRec, nyRec}); chart.setStacked(false); chart.setTitle("Average temperatures");
FacetChart supports drawing multiple vertical axes. This is commonly used to show values with different units (for example: sales in dollars, total units shipped) and/or very different ranges (for example: gross revenue, profit) on the same chart. Each set of values, referred to as a "metric", gets its own axis and gradation marks.
To use multiple axes, you add an additional facet called the "metric facet" that specifies
each axis to be plotted as a facetValueId. The metric facet is an inlined facet, so as with
inlined facets in general, each CellRecord has a value for each facetValueId of the metric
facet. You then set extraAxisMetrics
to the
list of
metrics that should be plotted as additional axes.
For example, if you were plotting revenue and profit for each month of the year, you would
have one facet named "metric" with facetValueIds "revenue" and "profit" and a second facet
"month". Each CellRecord would have the revenue and profit for one month, stored under the
properties "revenue" and "profit". Setting extraAxisMetrics
to ["profit"]
would cause plofit to be plotted as the second axis.
You can have multiple extra axes and the additional axes and gradation tics will be drawn at
increasing distances from the chart. By default, the first metric is drawn as a column chart
and subsequent metrics are drawn as lines; you can override this via
extraAxisSettings
.
Multi-axis, multi-facet charts are also allowed. Extending the previous example, you might add a new facet "company", for a total of 3 facets. Each CellRecord would have "revenue" and "profit" for one combination of "company" and "month". The default appearance in this case would show revenue as clustered columns (one cluster per month, one column per company) and would show profit as multiple lines (one per company).
Scatter charts differ from other chart types in that both axes represent continuous numeric
data rather than a discrete set of facet values (like months of the year). For this reason
Scatter charts use the same concept of a "metric" facet as is used by Dual-Axis charts,
where the metric facet is expected to have exactly two metrics: the
xAxisMetric
and yAxisMetric
.
Unlike all other chart types, a scatter plot may be specified with only the metric facet. However one additional facet can be defined, which allows multiple sets of x,y points to be drawn in different colors, analogous to the different colors of a multi-series line chart.
FacetCharts support printing on all supported desktop browsers. With Pro or better,
charts can also be exported to PDF via RPCManager.exportContent
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
---|
config, configOnly, id, isElementSet, nativeObject, scClassName |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
FacetChart()
|
|
FacetChart(JavaScriptObject jsObj)
|
Method Summary | |
---|---|
HandlerRegistration |
addChartBackgroundDrawnHandler(ChartBackgroundDrawnHandler handler)
Add a chartBackgroundDrawn handler. |
HandlerRegistration |
addChartDrawnHandler(ChartDrawnHandler handler)
Add a chartDrawn handler. |
protected JavaScriptObject |
create()
|
Boolean |
getAutoRotateLabels()
Whether to automatically rotate labels if needed in order to make them legible and non-overlapping. |
DrawRect |
getBackgroundBandProperties()
Properties for background band |
Boolean |
getBandedBackground()
Whether to show alternating color bands in the background of chart. |
int |
getBarMargin()
Distance between bars. |
DrawRect |
getBarProperties()
Properties for bar |
Point |
getChartCenter()
Returns the centerpoint for radar charts and pie charts. |
float |
getChartHeight(boolean recalc)
Get the height the central chart area, where data elements appear. |
float |
getChartLeft()
Get the left margin of the central chart area, where data elements appear. |
float |
getChartRadius()
Returns the radius for radar charts and pie charts. |
int |
getChartRectMargin()
Margin around the main chart rect: between title and chart, between chart and axis labels, and chart rect and right edge of chart. |
DrawRect |
getChartRectProperties()
Properties for chart rect |
float |
getChartTop()
Get the top coordinate of the central chart area, where data elements appear. |
ChartType |
getChartType()
See ChartType for a list of known types - Column, Bar, Line, Pie, Doughnut, Area, and
Radar charts are supported. |
float |
getChartWidth(boolean recalc)
Get the width of the central chart area, where data elements appear. |
float |
getClusterMarginRatio()
For clustered charts, ratio between margins between individual bars and margins between clusters. |
RecordList |
getDataAsRecordList()
|
DrawLabel |
getDataAxisLabelProperties()
Properties for labels of data axis. |
String |
getDataColor(int index)
Get a color from the dataColors Array |
String[] |
getDataColors()
An array of colors to use for a series of visual elements representing data (eg columns, bars, pie slices), any of which may be adjacent to any other. |
DrawLabel |
getDataLabelProperties()
Properties for data label |
DrawLine |
getDataLineProperties()
Properties for lines that show data (as opposed to gradations or borders around the data area). |
int |
getDataMargin()
For rectangular charts (bar, column, line), margin around the inside of the main chart area, so that data elements are not flush to edge. |
DrawItem |
getDataOutlineProperties()
Properties for lines that outline a data shape (in filled charts such as area or radar charts). |
DrawItem |
getDataPointProperties()
Common properties to apply for all data points (see showDataPoints ). |
int |
getDataPointSize()
Size in pixels for data points drawn for line, area, radar and other chart types. |
DrawPath |
getDataShapeProperties()
Properties for data shapes (filled areas in area or radar charts). |
int |
getDecimalPrecision()
Default precision used when formatting float numbers for axis labels |
DrawOval |
getDoughnutHoleProperties()
Properties for doughnut hole |
float |
getDoughnutRatio()
If showing a doughnut hole (see showDoughnut ),
ratio of the size of the doughnut hole to the size of the overall pie chart, as a number between 0 to 1. |
DrawnValue |
getDrawnValue(FacetValueMap facetValues)
Returns rendering information for the data value specified by the passed facet values. |
String[] |
getExtraAxisMetrics()
Defines the set of metrics that will be plotted as additional vertical axes. |
MetricSettings[] |
getExtraAxisSettings()
For charts will multiple vertical axes, optionally provides settings for how each extra axis metric is plotted. |
Boolean |
getFilled()
Whether shapes are filled, for example, whether a multi-series line chart appears as a stack of filled regions as opposed to just multiple lines. |
DrawLabel |
getGradationLabelProperties()
Properties for gradation labels |
DrawLine |
getGradationLineProperties()
Properties for gradation lines |
float[] |
getGradations()
Return an array of the gradation values used in the current chart. |
int |
getGradationTickMarkLength()
Length of the tick marks used to denote the gradations of any extra value axes . |
DrawLine |
getGradationZeroLineProperties()
Properties for the gradation line drawn for zero (slightly thicker by default). |
DrawLabel |
getHoverLabelProperties()
Properties for text in a floating label that represents the data value shown whenever the mouse moves withing the main chart area when showValueOnHover is enabled. |
int |
getLegendItemPadding()
Padding between each swatch and label pair. |
DrawLabel |
getLegendLabelProperties()
Properties for labels shown next to legend color swatches. |
int |
getLegendMargin()
Space between the legend and the chart rect or axis labels (whatever the legend is adjacent to. |
int |
getLegendPadding()
Padding around the legend as a whole. |
DrawRect |
getLegendRectProperties()
Properties for rectangle around the legend as a whole. |
DrawRect |
getLegendSwatchProperties()
Properties for the swatches of color shown in the legend. |
int |
getLegendSwatchSize()
Size of individual color swatches in legend. |
int |
getLegendTextPadding()
Padding between color swatch and its label. |
int |
getLogBase()
When useLogGradations , base value for
logarithmic gradation lines. |
Float[] |
getLogGradations()
When useLogGradations is set, gradation lines
to show in between powers,
expressed as a series of integer or float values between 0 and logBase .
|
com.smartgwt.logicalstructure.core.LogicalStructureObject |
getLogicalStructure()
|
Boolean |
getLogScale()
Whether to use logarithmic scaling for values. |
int |
getMaxBarThickness()
Bars will not be drawn over this thickness, instead, margins will be increased. |
int |
getMinBarThickness()
If bars would be smaller than this size, margins are reduced until bars overlap. |
DrawnValue |
getNearestDrawnValue()
Returns rendering information for the data value that is shown nearest to the passed coordinates, as DrawnValue object. |
DrawnValue |
getNearestDrawnValue(Integer x,
Integer y)
Returns rendering information for the data value that is shown nearest to the passed coordinates, as DrawnValue object. |
static FacetChart |
getOrCreateRef(JavaScriptObject jsObj)
|
DrawOval |
getPieBorderProperties()
Properties for the border around a pie chart. |
int |
getPieLabelAngleStart()
Angle where first label is placed in a Pie chart in stacked mode, in degrees. |
int |
getPieLabelLineExtent()
How far label lines stick out of the pie radius in a Pie chart in stacked mode. |
DrawLine |
getPieLabelLineProperties()
Properties for pie label line |
DrawOval |
getPieRingBorderProperties()
Properties for pie ring border |
DrawSector |
getPieSliceProperties()
Properties for pie slices |
DrawOval |
getRadarBackgroundProperties()
Properties for radar background |
int |
getRadialLabelOffset()
Distance in pixels that radial labels are offset from the outside of the circle. |
Record[] |
getRecords()
|
DrawOval |
getShadowProperties()
Properties for shadows. |
Boolean |
getShowChartRect()
Whether to show a rectangular shape around the area of the chart where data is plotted. |
Boolean |
getShowDataAxisLabel()
Whether to show a label for the data axis as a whole (the data axis is where labels for each data point appear). |
Boolean |
getShowDataPoints()
For line charts, whether to show data points for each individual data value. |
Boolean |
getShowDataValues()
If set, data values will be shown as text labels near the shape representing the value, for example, above columns of a column chart, or adjacent to points in a line chart. |
Boolean |
getShowDoughnut()
Whether to show a "doughnut hole" in the middle of pie charts. |
Boolean |
getShowLegend()
The legend is automatically shown for charts that need it (generally, multi-series charts) but can be forced off by setting showLegend to false. |
Boolean |
getShowRadarGradationLabels()
Whether to show gradation labels in radar charts. |
ScatterLineType |
getShowScatterLines()
How to draw lines between adjacent data points of "Scatter" plots. |
Boolean |
getShowShadows()
Whether to automatically show shadows for various charts. |
Boolean |
getShowTitle()
Whether to show a title. |
Boolean |
getShowValueAxisLabel()
Whether to show the valueTitle as a label on the
value axis. |
Boolean |
getShowValueOnHover()
Shows the value of the nearest data value in a floating label whenever the mouse moves within the main chart area. |
Boolean |
getStacked()
Whether to use stacking for charts where this makes sense (column, area, pie, line and radar charts). |
String |
getStyleName()
Default styleName for the chart. |
int |
getTickMarkToValueAxisMargin()
Margin between the tick marks and the labels of the extra value axes . |
String |
getTitle()
Title for the chart as a whole. |
DrawLabel |
getTitleProperties()
Properties for title label. |
Boolean |
getUseAutoGradients()
Causes the chart to use the colors specified in dataColors but specify chart-specific gradients based on the primary data color per chart type. |
Boolean |
getUseLogGradations()
Whether to use classic logarithmic gradations, where each order of magnitude is shown as a gradation as well as a few intervening lines. |
DrawLabel |
getValueAxisLabelProperties()
Properties for labels of value axis. |
int |
getValueAxisMargin()
Margin between multiple value axes . |
DrawLine |
getValueLineProperties()
Properties for a "value line" - a line shows where a particular discrete value is placed, eg, vertical lines connecting points of a line chart to the X axis, or radial lines in a Radar chart. |
String |
getValueProperty()
Property in each record that holds a data value. |
String |
getValueTitle()
A label for the data values, such as "Sales in Thousands", typically used as the label for the value axis. |
String |
getXAxisMetric()
For scatter charts only, the "id" of the metric facet value to use for the x-axis. |
void |
getXCoord()
Returns the X coordination where the passed data value would be drawn. |
String |
getYAxisMetric()
For scatter charts only, the "id" of the metric facet value to use for the y-axis. |
float |
getYCoord(float value)
Returns the Y coordination where the passed data value would be drawn. |
void |
setAutoRotateLabels(Boolean autoRotateLabels)
Whether to automatically rotate labels if needed in order to make them legible and non-overlapping. |
void |
setAxisValueFormatter(ValueFormatter formatter)
Formatter to apply to values displayed in the gradation labels. |
void |
setBackgroundBandProperties(DrawRect backgroundBandProperties)
Properties for background band |
void |
setBandedBackground(Boolean bandedBackground)
Whether to show alternating color bands in the background of chart. |
void |
setBarMargin(int barMargin)
Distance between bars. |
void |
setBarProperties(DrawRect barProperties)
Properties for bar |
void |
setChartRectMargin(int chartRectMargin)
Margin around the main chart rect: between title and chart, between chart and axis labels, and chart rect and right edge of chart. |
void |
setChartRectProperties(DrawRect chartRectProperties)
Properties for chart rect |
void |
setChartType(ChartType chartType)
See ChartType for a list of known types - Column, Bar, Line, Pie, Doughnut, Area, and
Radar charts are supported. |
void |
setClusterMarginRatio(float clusterMarginRatio)
For clustered charts, ratio between margins between individual bars and margins between clusters. |
void |
setData(Record[] records)
Dataset for this chart. |
void |
setData(RecordList records)
|
void |
setDataAxisLabelProperties(DrawLabel dataAxisLabelProperties)
Properties for labels of data axis. |
void |
setDataColors(String... dataColors)
An array of colors to use for a series of visual elements representing data (eg columns, bars, pie slices), any of which may be adjacent to any other. |
void |
setDataLabelProperties(DrawLabel dataLabelProperties)
Properties for data label |
void |
setDataLineProperties(DrawLine dataLineProperties)
Properties for lines that show data (as opposed to gradations or borders around the data area). |
void |
setDataMargin(int dataMargin)
For rectangular charts (bar, column, line), margin around the inside of the main chart area, so that data elements are not flush to edge. |
void |
setDataOutlineProperties(DrawItem dataOutlineProperties)
Properties for lines that outline a data shape (in filled charts such as area or radar charts). |
void |
setDataPointProperties(DrawItem dataPointProperties)
Common properties to apply for all data points (see showDataPoints ). |
void |
setDataPointSize(int dataPointSize)
Size in pixels for data points drawn for line, area, radar and other chart types. |
void |
setDataShapeProperties(DrawPath dataShapeProperties)
Properties for data shapes (filled areas in area or radar charts). |
void |
setDataValueFormatter(ValueFormatter formatter)
Formatter to apply to values displayed in the hover labels and other value labels |
void |
setDecimalPrecision(int decimalPrecision)
Default precision used when formatting float numbers for axis labels |
static void |
setDefaultProperties(FacetChart facetChartProperties)
Class level method to set the default properties of this class. |
void |
setDoughnutHoleProperties(DrawOval doughnutHoleProperties)
Properties for doughnut hole |
void |
setDoughnutRatio(float doughnutRatio)
If showing a doughnut hole (see showDoughnut ),
ratio of the size of the doughnut hole to the size of the overall pie chart, as a number between 0 to 1. |
void |
setExtraAxisMetrics(String... extraAxisMetrics)
Defines the set of metrics that will be plotted as additional vertical axes. |
void |
setExtraAxisSettings(MetricSettings... extraAxisSettings)
For charts will multiple vertical axes, optionally provides settings for how each extra axis metric is plotted. |
void |
setFacets(Facet... facets)
Set the facets for this chart. |
void |
setFilled(Boolean filled)
Whether shapes are filled, for example, whether a multi-series line chart appears as a stack of filled regions as opposed to just multiple lines. |
void |
setGradationLabelProperties(DrawLabel gradationLabelProperties)
Properties for gradation labels |
void |
setGradationLineProperties(DrawLine gradationLineProperties)
Properties for gradation lines |
void |
setGradationTickMarkLength(int gradationTickMarkLength)
Length of the tick marks used to denote the gradations of any extra value axes . |
void |
setGradationZeroLineProperties(DrawLine gradationZeroLineProperties)
Properties for the gradation line drawn for zero (slightly thicker by default). |
void |
setHoverLabelProperties(DrawLabel hoverLabelProperties)
Properties for text in a floating label that represents the data value shown whenever the mouse moves withing the main chart area when showValueOnHover is enabled. |
void |
setJavaScriptObject(JavaScriptObject jsObj)
|
void |
setLegendItemPadding(int legendItemPadding)
Padding between each swatch and label pair. |
void |
setLegendLabelProperties(DrawLabel legendLabelProperties)
Properties for labels shown next to legend color swatches. |
void |
setLegendMargin(int legendMargin)
Space between the legend and the chart rect or axis labels (whatever the legend is adjacent to. |
void |
setLegendPadding(int legendPadding)
Padding around the legend as a whole. |
void |
setLegendRectProperties(DrawRect legendRectProperties)
Properties for rectangle around the legend as a whole. |
void |
setLegendSwatchProperties(DrawRect legendSwatchProperties)
Properties for the swatches of color shown in the legend. |
void |
setLegendSwatchSize(int legendSwatchSize)
Size of individual color swatches in legend. |
void |
setLegendTextPadding(int legendTextPadding)
Padding between color swatch and its label. |
void |
setLogBase(int logBase)
When useLogGradations , base value for
logarithmic gradation lines. |
void |
setLogGradations(Float... logGradations)
When useLogGradations is set, gradation lines
to show in between powers,
expressed as a series of integer or float values between 0 and logBase .
|
com.smartgwt.logicalstructure.core.LogicalStructureObject |
setLogicalStructure(com.smartgwt.logicalstructure.widgets.chart.FacetChartLogicalStructure s)
|
void |
setLogScale(Boolean logScale)
Whether to use logarithmic scaling for values. |
void |
setMaxBarThickness(int maxBarThickness)
Bars will not be drawn over this thickness, instead, margins will be increased. |
void |
setMinBarThickness(int minBarThickness)
If bars would be smaller than this size, margins are reduced until bars overlap. |
void |
setPieBorderProperties(DrawOval pieBorderProperties)
Properties for the border around a pie chart. |
void |
setPieLabelAngleStart(int pieLabelAngleStart)
Angle where first label is placed in a Pie chart in stacked mode, in degrees. |
void |
setPieLabelLineExtent(int pieLabelLineExtent)
How far label lines stick out of the pie radius in a Pie chart in stacked mode. |
void |
setPieLabelLineProperties(DrawLine pieLabelLineProperties)
Properties for pie label line |
void |
setPieRingBorderProperties(DrawOval pieRingBorderProperties)
Properties for pie ring border |
void |
setPieSliceProperties(DrawSector pieSliceProperties)
Properties for pie slices |
void |
setPointClickHandler(ChartPointClickHandler handler)
Apply a handler to fire when showDataPoints is true,
and the user clicks on a point. |
void |
setPointHoverCustomizer(ChartPointHoverCustomizer hoverCustomizer)
Display custom HTML when showDataPoints is true and the mouse hovers
over a point. |
void |
setRadarBackgroundProperties(DrawOval radarBackgroundProperties)
Properties for radar background |
void |
setRadialLabelOffset(int radialLabelOffset)
Distance in pixels that radial labels are offset from the outside of the circle. |
void |
setShadowProperties(DrawOval shadowProperties)
Properties for shadows. |
void |
setShowChartRect(Boolean showChartRect)
Whether to show a rectangular shape around the area of the chart where data is plotted. |
void |
setShowDataAxisLabel(Boolean showDataAxisLabel)
Whether to show a label for the data axis as a whole (the data axis is where labels for each data point appear). |
void |
setShowDataPoints(Boolean showDataPoints)
For line charts, whether to show data points for each individual data value. |
void |
setShowDataValues(Boolean showDataValues)
If set, data values will be shown as text labels near the shape representing the value, for example, above columns of a column chart, or adjacent to points in a line chart. |
void |
setShowDoughnut(Boolean showDoughnut)
Whether to show a "doughnut hole" in the middle of pie charts. |
void |
setShowLegend(Boolean showLegend)
The legend is automatically shown for charts that need it (generally, multi-series charts) but can be forced off by setting showLegend to false. |
void |
setShowRadarGradationLabels(Boolean showRadarGradationLabels)
Whether to show gradation labels in radar charts. |
void |
setShowScatterLines(ScatterLineType showScatterLines)
How to draw lines between adjacent data points of "Scatter" plots. |
void |
setShowShadows(Boolean showShadows)
Whether to automatically show shadows for various charts. |
void |
setShowTitle(Boolean showTitle)
Whether to show a title. |
void |
setShowValueAxisLabel(Boolean showValueAxisLabel)
Whether to show the valueTitle as a label on the
value axis. |
void |
setShowValueOnHover(Boolean showValueOnHover)
Shows the value of the nearest data value in a floating label whenever the mouse moves within the main chart area. |
void |
setStacked(Boolean stacked)
Whether to use stacking for charts where this makes sense (column, area, pie, line and radar charts). |
void |
setStyleName(String styleName)
Default styleName for the chart. |
void |
setTickMarkToValueAxisMargin(int tickMarkToValueAxisMargin)
Margin between the tick marks and the labels of the extra value axes . |
void |
setTitle(String title)
Title for the chart as a whole. |
void |
setTitleProperties(DrawLabel titleProperties)
Properties for title label. |
void |
setUseAutoGradients(Boolean useAutoGradients)
Causes the chart to use the colors specified in dataColors but specify chart-specific gradients based on the primary data color per chart type. |
void |
setUseLogGradations(Boolean useLogGradations)
Whether to use classic logarithmic gradations, where each order of magnitude is shown as a gradation as well as a few intervening lines. |
void |
setValueAxisLabelProperties(DrawLabel valueAxisLabelProperties)
Properties for labels of value axis. |
void |
setValueAxisMargin(int valueAxisMargin)
Margin between multiple value axes . |
void |
setValueLineProperties(DrawLine valueLineProperties)
Properties for a "value line" - a line shows where a particular discrete value is placed, eg, vertical lines connecting points of a line chart to the X axis, or radial lines in a Radar chart. |
void |
setValueProperty(String valueProperty)
Property in each record that holds a data value. |
void |
setValueTitle(String valueTitle)
A label for the data values, such as "Sales in Thousands", typically used as the label for the value axis. |
void |
setXAxisMetric(String xAxisMetric)
For scatter charts only, the "id" of the metric facet value to use for the x-axis. |
void |
setYAxisMetric(String yAxisMetric)
For scatter charts only, the "id" of the metric facet value to use for the y-axis. |
Methods inherited from class com.smartgwt.client.widgets.drawing.DrawPane |
---|
addDrawItem, createLinearGradient, createRadialGradient, createSimpleGradient, destroyItems, erase, getCanDrag, getDrawItems, getRotation, getSvgString, getZoomLevel, setCanDrag, setDefaultProperties, setDrawItems, setLogicalStructure, setRotation, setZoomLevel, zoom |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public FacetChart()
public FacetChart(JavaScriptObject jsObj)
Method Detail |
---|
public static FacetChart getOrCreateRef(JavaScriptObject jsObj)
public void setJavaScriptObject(JavaScriptObject jsObj)
setJavaScriptObject
in class DrawPane
protected JavaScriptObject create()
create
in class DrawPane
public void setAutoRotateLabels(Boolean autoRotateLabels) throws IllegalStateException
autoRotateLabels
- autoRotateLabels Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getAutoRotateLabels()
public void setBackgroundBandProperties(DrawRect backgroundBandProperties) throws IllegalStateException
backgroundBandProperties
- backgroundBandProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawRect getBackgroundBandProperties()
public void setBandedBackground(Boolean bandedBackground) throws IllegalStateException
backgroundBandProperties
.
bandedBackground
- bandedBackground Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getBandedBackground()
backgroundBandProperties
.
public void setBarMargin(int barMargin) throws IllegalStateException
minBarThickness
.
barMargin
- barMargin Default value is 4
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getBarMargin()
minBarThickness
.
public void setBarProperties(DrawRect barProperties)
barProperties
- barProperties Default value is nullpublic DrawRect getBarProperties()
public void setChartRectMargin(int chartRectMargin) throws IllegalStateException
chartRectMargin
- chartRectMargin Default value is 5
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getChartRectMargin()
public void setChartRectProperties(DrawRect chartRectProperties)
chartRectProperties
- chartRectProperties Default value is nullpublic DrawRect getChartRectProperties()
public void setChartType(ChartType chartType)
ChartType
for a list of known types - Column, Bar, Line, Pie, Doughnut, Area, and
Radar charts are supported.
chartType
. Will redraw the chart if drawn. Will use default settings for the new chart type for stacked
and filled
if those values are null.
chartType
- new chart type. Default value is "Column"public ChartType getChartType()
ChartType
for a list of known types - Column, Bar, Line, Pie, Doughnut, Area, and
Radar charts are supported.
public void setClusterMarginRatio(float clusterMarginRatio) throws IllegalStateException
clusterMarginRatio
- clusterMarginRatio Default value is 4
IllegalStateException
- this property cannot be changed after the component has been createdpublic float getClusterMarginRatio()
public void setDataAxisLabelProperties(DrawLabel dataAxisLabelProperties)
dataAxisLabelProperties
- dataAxisLabelProperties Default value is nullpublic DrawLabel getDataAxisLabelProperties()
public void setDataColors(String... dataColors) throws IllegalStateException
Colors must be in the format of a leading hash (#) plus 6 hexadecimal digits, for example, "#FFFFFF" is white, "#FF0000" is pure red.
dataColors
- . See CSSColor
. Default value is see below
IllegalStateException
- this property cannot be changed after the component has been createdpublic String[] getDataColors()
Colors must be in the format of a leading hash (#) plus 6 hexadecimal digits, for example, "#FFFFFF" is white, "#FF0000" is pure red.
CSSColor
public void setDataLabelProperties(DrawLabel dataLabelProperties)
dataLabelProperties
- dataLabelProperties Default value is nullpublic DrawLabel getDataLabelProperties()
public void setDataLineProperties(DrawLine dataLineProperties) throws IllegalStateException
dataLineProperties
- dataLineProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawLine getDataLineProperties()
public void setDataMargin(int dataMargin) throws IllegalStateException
dataMargin
- dataMargin Default value is 10
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getDataMargin()
public void setDataOutlineProperties(DrawItem dataOutlineProperties) throws IllegalStateException
dataOutlineProperties
- dataOutlineProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawItem getDataOutlineProperties()
public void setDataPointProperties(DrawItem dataPointProperties) throws IllegalStateException
showDataPoints
).
dataPointProperties
- dataPointProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawItem getDataPointProperties()
showDataPoints
).
public void setDataPointSize(int dataPointSize) throws IllegalStateException
dataPointSize
- dataPointSize Default value is 5
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getDataPointSize()
public void setDataShapeProperties(DrawPath dataShapeProperties) throws IllegalStateException
dataShapeProperties
- dataShapeProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawPath getDataShapeProperties()
public void setDecimalPrecision(int decimalPrecision) throws IllegalStateException
decimalPrecision
- decimalPrecision Default value is 2
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getDecimalPrecision()
public void setDoughnutHoleProperties(DrawOval doughnutHoleProperties)
doughnutHoleProperties
- doughnutHoleProperties Default value is nullpublic DrawOval getDoughnutHoleProperties()
public void setDoughnutRatio(float doughnutRatio) throws IllegalStateException
showDoughnut
),
ratio of the size of the doughnut hole to the size of the overall pie chart, as a number between 0 to 1.
doughnutRatio
- doughnutRatio Default value is 0.2
IllegalStateException
- this property cannot be changed after the component has been createdpublic float getDoughnutRatio()
showDoughnut
),
ratio of the size of the doughnut hole to the size of the overall pie chart, as a number between 0 to 1.
public void setExtraAxisMetrics(String... extraAxisMetrics) throws IllegalStateException
FacetChart
docs for an overview of how multi-axis charts are used. Each metric
corresponds to different value property of the data records and superimposes its drawn data onto the chart rectangle.
The value properties are called metrics, and they can be either the valueProperty
or the "id" of a FacetValue
of the inlined Facet
(which is
then called the metric facet). Each value axis has its own gradations that are shown as tick marks along the length of
the axis. This property, extraAxisMetrics, specifies the metrics to use for additional value axes to the main value
axis.
The additional value axis may have their own gradations, chart type, log scale, data colors and gradients, and
other chart properties. These properties are specified with the extraAxisSettings
property.
Value axes, including
the main value axis, are labelled in the legend along with representations of the charted data. The labels are taken
from the title
of each metric's FacetValue (or the valueTitle
if the metric is the valueProperty
).
The order of the metrics determines the position of the corresponding axes on the chart as well as the z-ordering of the corresponding data lines. The first and second extra value axes are placed to the right of the chart rectangle, and any remaining extra value axes are placed to the left of the main value axis (and therefore to the left of the chart rectangle).
extraAxisMetrics
- . See String
. Default value is []
IllegalStateException
- this property cannot be changed after the component has been createdpublic String[] getExtraAxisMetrics()
FacetChart
docs for an overview of how multi-axis charts are used. Each metric
corresponds to different value property of the data records and superimposes its drawn data onto the chart rectangle.
The value properties are called metrics, and they can be either the valueProperty
or the "id" of a FacetValue
of the inlined Facet
(which is
then called the metric facet). Each value axis has its own gradations that are shown as tick marks along the length of
the axis. This property, extraAxisMetrics, specifies the metrics to use for additional value axes to the main value
axis.
The additional value axis may have their own gradations, chart type, log scale, data colors and gradients, and
other chart properties. These properties are specified with the extraAxisSettings
property.
Value axes, including
the main value axis, are labelled in the legend along with representations of the charted data. The labels are taken
from the title
of each metric's FacetValue (or the valueTitle
if the metric is the valueProperty
).
The order of the metrics determines the position of the corresponding axes on the chart as well as the z-ordering of the corresponding data lines. The first and second extra value axes are placed to the right of the chart rectangle, and any remaining extra value axes are placed to the left of the main value axis (and therefore to the left of the chart rectangle).
String
public void setExtraAxisSettings(MetricSettings... extraAxisSettings) throws IllegalStateException
extra axis metric
is plotted. See the main FacetChart
docs for an overview of how multi-axis charts are used. The chart of
each metric's values may be of any rectangular chart type that uses a vertical value axis ("Column", "Area", and
"Line"). Because the charts will be superimposed over the same drawing area, there can only be one "Column" chart and
one "Area" chart. The column chart is placed on the bottom followed by the area chart, and then the line charts are
drawn on top in the order of their metric in the extraAxisMetrics
array. If the chartType
s are
left unspecified then by default the first metric will be drawn as columns and the remaining will be drawn as lines.
extraAxisSettings
- extraAxisSettings Default value is []
IllegalStateException
- this property cannot be changed after the component has been createdpublic MetricSettings[] getExtraAxisSettings()
extra axis metric
is plotted. See the main FacetChart
docs for an overview of how multi-axis charts are used. The chart of
each metric's values may be of any rectangular chart type that uses a vertical value axis ("Column", "Area", and
"Line"). Because the charts will be superimposed over the same drawing area, there can only be one "Column" chart and
one "Area" chart. The column chart is placed on the bottom followed by the area chart, and then the line charts are
drawn on top in the order of their metric in the extraAxisMetrics
array. If the chartType
s are
left unspecified then by default the first metric will be drawn as columns and the remaining will be drawn as lines.
public void setFilled(Boolean filled)
If unset, fills will be automatically used when there are multiple facets and stacking is active (so Line and Radar charts will show stacked regions).
You can explicitly set filled:false to
create multi-facet Line or Radar charts where translucent regions overlap, or filled:true to fill in a single-facet Line
or Radar chart.
If this method is called after the component has been drawn/initialized:
Method to change filled
. Use null to apply a default value for the current chartType
.
filled
- new value. Default value is nullpublic Boolean getFilled()
If unset, fills will be automatically used when there are multiple facets and stacking is active (so Line and Radar charts will show stacked regions).
You can explicitly set filled:false to create multi-facet Line or Radar charts where translucent regions overlap, or filled:true to fill in a single-facet Line or Radar chart.
public void setGradationLabelProperties(DrawLabel gradationLabelProperties) throws IllegalStateException
gradationLabelProperties
- gradationLabelProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawLabel getGradationLabelProperties()
public void setGradationLineProperties(DrawLine gradationLineProperties) throws IllegalStateException
gradationLineProperties
- gradationLineProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawLine getGradationLineProperties()
public void setGradationTickMarkLength(int gradationTickMarkLength) throws IllegalStateException
extra value axes
.
gradationTickMarkLength
- gradationTickMarkLength Default value is 5
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getGradationTickMarkLength()
extra value axes
.
public void setGradationZeroLineProperties(DrawLine gradationZeroLineProperties) throws IllegalStateException
gradationZeroLineProperties
- gradationZeroLineProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawLine getGradationZeroLineProperties()
public void setHoverLabelProperties(DrawLabel hoverLabelProperties) throws IllegalStateException
showValueOnHover
is enabled.
hoverLabelProperties
- hoverLabelProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawLabel getHoverLabelProperties()
showValueOnHover
is enabled.
public void setLegendItemPadding(int legendItemPadding) throws IllegalStateException
legendItemPadding
- legendItemPadding Default value is 5
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getLegendItemPadding()
public void setLegendLabelProperties(DrawLabel legendLabelProperties) throws IllegalStateException
legendLabelProperties
- legendLabelProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawLabel getLegendLabelProperties()
public void setLegendMargin(int legendMargin) throws IllegalStateException
legendMargin
- legendMargin Default value is 10
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getLegendMargin()
public void setLegendPadding(int legendPadding) throws IllegalStateException
legendPadding
- legendPadding Default value is 5
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getLegendPadding()
public void setLegendRectProperties(DrawRect legendRectProperties) throws IllegalStateException
legendRectProperties
- legendRectProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawRect getLegendRectProperties()
public void setLegendSwatchProperties(DrawRect legendSwatchProperties) throws IllegalStateException
legendSwatchProperties
- legendSwatchProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawRect getLegendSwatchProperties()
public void setLegendSwatchSize(int legendSwatchSize) throws IllegalStateException
legendSwatchSize
- legendSwatchSize Default value is 16
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getLegendSwatchSize()
public void setLegendTextPadding(int legendTextPadding) throws IllegalStateException
legendTextPadding
- legendTextPadding Default value is 5
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getLegendTextPadding()
public void setLogBase(int logBase) throws IllegalStateException
useLogGradations
, base value for
logarithmic gradation lines. Gradation lines will be shown at every power of this value plus intervening values
specified by logGradations
.
logBase
- logBase Default value is 10
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getLogBase()
useLogGradations
, base value for
logarithmic gradation lines. Gradation lines will be shown at every power of this value plus intervening values
specified by logGradations
.
public void setLogScale(Boolean logScale) throws IllegalStateException
Logarithmic scale charts show an equivalent percentage increase as equivalent distance on the chart. That is, 10 and 100 are the same distance apart as 100 and 1000 (each being a 10 times or 1000% increase).
logScale
- logScale Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getLogScale()
Logarithmic scale charts show an equivalent percentage increase as equivalent distance on the chart. That is, 10 and 100 are the same distance apart as 100 and 1000 (each being a 10 times or 1000% increase).
public void setMaxBarThickness(int maxBarThickness) throws IllegalStateException
maxBarThickness
- maxBarThickness Default value is 150
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getMaxBarThickness()
public void setMinBarThickness(int minBarThickness) throws IllegalStateException
minBarThickness
- minBarThickness Default value is 4
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getMinBarThickness()
public void setPieBorderProperties(DrawOval pieBorderProperties) throws IllegalStateException
pieBorderProperties
- pieBorderProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawOval getPieBorderProperties()
public void setPieLabelAngleStart(int pieLabelAngleStart) throws IllegalStateException
pieLabelAngleStart
- pieLabelAngleStart Default value is 20
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getPieLabelAngleStart()
public void setPieLabelLineExtent(int pieLabelLineExtent) throws IllegalStateException
pieLabelLineExtent
- pieLabelLineExtent Default value is 7
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getPieLabelLineExtent()
public void setPieLabelLineProperties(DrawLine pieLabelLineProperties)
pieLabelLineProperties
- pieLabelLineProperties Default value is nullpublic DrawLine getPieLabelLineProperties()
public void setPieRingBorderProperties(DrawOval pieRingBorderProperties) throws IllegalStateException
pieRingBorderProperties
- pieRingBorderProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawOval getPieRingBorderProperties()
public void setPieSliceProperties(DrawSector pieSliceProperties) throws IllegalStateException
pieSliceProperties
- pieSliceProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawSector getPieSliceProperties()
public void setRadarBackgroundProperties(DrawOval radarBackgroundProperties) throws IllegalStateException
radarBackgroundProperties
- radarBackgroundProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawOval getRadarBackgroundProperties()
public void setRadialLabelOffset(int radialLabelOffset) throws IllegalStateException
radialLabelOffset
- radialLabelOffset Default value is 5
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getRadialLabelOffset()
public void setShadowProperties(DrawOval shadowProperties) throws IllegalStateException
shadowProperties
- shadowProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawOval getShadowProperties()
public void setShowChartRect(Boolean showChartRect) throws IllegalStateException
showChartRect
- showChartRect Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowChartRect()
public void setShowDataAxisLabel(Boolean showDataAxisLabel) throws IllegalStateException
title
for the data label facet will be shown as the label.
Automatically disabled for non-rectangular charts (eg Pie, Radar).
showDataAxisLabel
- showDataAxisLabel Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowDataAxisLabel()
title
for the data label facet will be shown as the label.
Automatically disabled for non-rectangular charts (eg Pie, Radar).
public void setShowDataPoints(Boolean showDataPoints) throws IllegalStateException
If shown, the FacetChart.pointClick
and FacetChart.getPointHoverHTML
APIs can be used to create
interactivity.
showDataPoints
- showDataPoints Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowDataPoints()
If shown, the FacetChart.pointClick
and FacetChart.getPointHoverHTML
APIs can be used to create
interactivity.
public void setShowDataValues(Boolean showDataValues) throws IllegalStateException
By default, if data density is high enough that labels will
potentially overlap, data values will not be shown and showValueOnHover
will be enabled instead.
showDataValues
- showDataValues Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowDataValues()
By default, if data density is high enough that labels will
potentially overlap, data values will not be shown and showValueOnHover
will be enabled instead.
public void setShowDoughnut(Boolean showDoughnut) throws IllegalStateException
showDoughnut
.
showDoughnut
- showDoughnut Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowDoughnut()
showDoughnut
.
public void setShowLegend(Boolean showLegend) throws IllegalStateException
showLegend
- showLegend Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowLegend()
public void setShowRadarGradationLabels(Boolean showRadarGradationLabels) throws IllegalStateException
showRadarGradationLabels
- showRadarGradationLabels Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowRadarGradationLabels()
public void setShowScatterLines(ScatterLineType showScatterLines) throws IllegalStateException
ScatterLineType
.
showScatterLines
- showScatterLines Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic ScatterLineType getShowScatterLines()
ScatterLineType
.
public void setShowShadows(Boolean showShadows) throws IllegalStateException
showShadows
- showShadows Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowShadows()
public void setShowTitle(Boolean showTitle)
showTitle
- showTitle Default value is truepublic Boolean getShowTitle()
public void setShowValueAxisLabel(Boolean showValueAxisLabel) throws IllegalStateException
valueTitle
as a label on the
value axis. Automatically disabled for non-rectangular charts (eg Pie, Radar).
showValueAxisLabel
- showValueAxisLabel Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowValueAxisLabel()
valueTitle
as a label on the
value axis. Automatically disabled for non-rectangular charts (eg Pie, Radar).
public void setShowValueOnHover(Boolean showValueOnHover) throws IllegalStateException
Calculates nearest value based on FacetChart.getNearestDrawnValue
.
The label's
appearance is controlled by hoverLabelProperties
.
showValueOnHover
- showValueOnHover Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowValueOnHover()
Calculates nearest value based on FacetChart.getNearestDrawnValue
.
The label's
appearance is controlled by hoverLabelProperties
.
public void setStacked(Boolean stacked)
stacked
. Use null to apply a default value for the current chartType
.
stacked
- new value. Default value is nullpublic Boolean getStacked()
public void setStyleName(String styleName)
setStyleName
in class Canvas
styleName
- . See CSSStyleName
. Default value is "scChart"Appearance overview and related methods
,
CSS styles Examplepublic String getStyleName()
getStyleName
in class Canvas
CSSStyleName
Appearance overview and related methods
,
CSS styles Examplepublic void setTickMarkToValueAxisMargin(int tickMarkToValueAxisMargin) throws IllegalStateException
extra value axes
.
tickMarkToValueAxisMargin
- tickMarkToValueAxisMargin Default value is 7
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getTickMarkToValueAxisMargin()
extra value axes
.
public void setTitle(String title)
setTitle
in class Canvas
title
- . See String
. Default value is nullpublic String getTitle()
getTitle
in class Canvas
String
public void setTitleProperties(DrawLabel titleProperties)
titleProperties
- titleProperties Default value is nullpublic DrawLabel getTitleProperties()
public void setUseAutoGradients(Boolean useAutoGradients) throws IllegalStateException
dataColors
but specify chart-specific gradients based on the primary data color per chart type.
useAutoGradients
- useAutoGradients Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getUseAutoGradients()
dataColors
but specify chart-specific gradients based on the primary data color per chart type.
public void setUseLogGradations(Boolean useLogGradations) throws IllegalStateException
Default gradations can be overridden via logBase
and
logGradations
.
useLogGradations
- useLogGradations Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getUseLogGradations()
Default gradations can be overridden via logBase
and
logGradations
.
public void setValueAxisLabelProperties(DrawLabel valueAxisLabelProperties)
valueAxisLabelProperties
- valueAxisLabelProperties Default value is nullpublic DrawLabel getValueAxisLabelProperties()
public void setValueAxisMargin(int valueAxisMargin) throws IllegalStateException
multiple value axes
.
valueAxisMargin
- valueAxisMargin Default value is 10
IllegalStateException
- this property cannot be changed after the component has been createdpublic int getValueAxisMargin()
multiple value axes
.
public void setValueLineProperties(DrawLine valueLineProperties) throws IllegalStateException
valueLineProperties
- valueLineProperties Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic DrawLine getValueLineProperties()
public void setValueProperty(String valueProperty) throws IllegalStateException
Not used if there is an inline facet, see data.
valueProperty
- . See String
. Default value is "_value"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getValueProperty()
Not used if there is an inline facet, see data.
String
public void setValueTitle(String valueTitle) throws IllegalStateException
valueTitle
- . See String
. Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getValueTitle()
String
public void setXAxisMetric(String xAxisMetric) throws IllegalStateException
The default x-axis metric is the second value of the metric facet.
xAxisMetric
- . See String
. Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getXAxisMetric()
The default x-axis metric is the second value of the metric facet.
String
public void setYAxisMetric(String yAxisMetric) throws IllegalStateException
The default y-axis metric is the first value of the metric facet.
yAxisMetric
- . See String
. Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getYAxisMetric()
The default y-axis metric is the first value of the metric facet.
String
public HandlerRegistration addChartBackgroundDrawnHandler(ChartBackgroundDrawnHandler handler)
Called when most elements of the chart other than data data have been drawn, including gradations and legend.
This notification will be fired each time the chart is redrawn (due to resize, data change, etc). If you want to draw
additional information on the chart using DrawPane
(FacetChart's superclass)
and various DrawItem
s, you should do in response to this notification. Due
to auto-sizing, APIs that are typically used to position custom DrawItems (such as FacetChart.getChartLeft
) may return bad values if called at
other times.
Additional DrawItems added in this method will appear underneath data elements such as bars or columns.
See FacetChart.chartDrawn
for placing
DrawItems on top of data elements.
addChartBackgroundDrawnHandler
in interface HasChartBackgroundDrawnHandlers
handler
- the chartBackgroundDrawn handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addChartDrawnHandler(ChartDrawnHandler handler)
Called when all elements of the chart (data lines / shapes, gradations, legend, labels etc) have completed drawing.
See FacetChart.chartBackgroundDrawn
for usage information.
addChartDrawnHandler
in interface HasChartDrawnHandlers
handler
- the chartDrawn handler
HandlerRegistration
used to remove this handlerpublic Point getChartCenter()
Note that unstacked pie charts draw multiple pies, each with their own centers.
This is only allowed to be called when FacetChart.chartDrawn
fires.
public float getChartHeight(boolean recalc)
This is only allowed to be called when FacetChart.chartDrawn
fires.
recalc
- if false then cached value will be returned, otherwise will be recalculated.
public float getChartLeft()
This is only allowed to be called when
FacetChart.chartDrawn
fires.
public float getChartRadius()
Note that unstacked pie charts draw multiple pies, each with their own radii.
This is only allowed to be called when
FacetChart.chartDrawn
fires.
public float getChartTop()
This is only allowed to be called
when FacetChart.chartDrawn
fires.
public float getChartWidth(boolean recalc)
This is only allowed to be called when FacetChart.chartDrawn
fires.
recalc
- if false then cached value will be returned, otherwise will be recalculated.
public String getDataColor(int index)
dataColors
Array Override to provide a dynamic color generation scheme.
index
- index of the visual element to be colored
public DrawnValue getDrawnValue(FacetValueMap facetValues)
If called before FacetChart.chartDrawn
, logs a warning and returns
null.
facetValues
- facet values of desired data value
public float[] getGradations()
FacetChart.getXCoord
/ FacetChart.getYCoord
(depending on the orientation of the chart)
to discover the coordinates where gradations are drawn. This is only allowed to be called when FacetChart.chartDrawn
fires.
public DrawnValue getNearestDrawnValue()
DrawnValue
object. Passed X and Y coordinates should be relative to the
FacetChart. If neither an X or Y coordinate is passed, both X and Y will use the current Canvas.getOffsetX
and Canvas.getOffsetY
.
If called before FacetChart.chartDrawn
, logs a warning and returns
null. For a chart with multiple vertical axes, returns the nearest point from the first metric only (see FacetChart overview
).
Behavior for different chart types is as follows:
Returns the centerpoint of the end of the nearest bar or column by considering the Y coordinate (bar) or X coordinate (column) only.
Returns the nearest point based on which data label is nearest to the passed X coordinate. For multi-series charts, if Y coordinate is not passed the data point returned is from the series that has the highest value at the data label. Otherwise it is from the series that has the highest value that is still below the Y coordinate.
Returns the data point nearest the
passed coordinates by straight line distance. Passing only one coordinate will cause a warning to be logged and null to
be returned; passing neither coordinate is allowed (getOffsetX/Y
will be used).
Returns the data point for the segment that would be hit if a line were drawn from the passed coordinates to the center of the pie.
If there are multiple stacked pies, uses the pie that contains the passed coordinates, otherwise the outermost pie.
If there are multiple non-stacked pies, uses the pie that is nearest the passed coordinates by straight-line distance to the center of the pie.
Passing only one coordinate will cause a warning to be logged and
null to be returned; passing neither coordinate is allowed (getOffsetX/Y
will be used).
public DrawnValue getNearestDrawnValue(Integer x, Integer y)
DrawnValue
object. Passed X and Y coordinates should be relative to the
FacetChart. If neither an X or Y coordinate is passed, both X and Y will use the current Canvas.getOffsetX
and Canvas.getOffsetY
.
If called before FacetChart.chartDrawn
, logs a warning and returns
null. For a chart with multiple vertical axes, returns the nearest point from the first metric only (see FacetChart overview
).
Behavior for different chart types is as follows:
Returns the centerpoint of the end of the nearest bar or column by considering the Y coordinate (bar) or X coordinate (column) only.
Returns the nearest point based on which data label is nearest to the passed X coordinate. For multi-series charts, if Y coordinate is not passed the data point returned is from the series that has the highest value at the data label. Otherwise it is from the series that has the highest value that is still below the Y coordinate.
Returns the data point nearest the
passed coordinates by straight line distance. Passing only one coordinate will cause a warning to be logged and null to
be returned; passing neither coordinate is allowed (getOffsetX/Y
will be used).
Returns the data point for the segment that would be hit if a line were drawn from the passed coordinates to the center of the pie.
If there are multiple stacked pies, uses the pie that contains the passed coordinates, otherwise the outermost pie.
If there are multiple non-stacked pies, uses the pie that is nearest the passed coordinates by straight-line distance to the center of the pie.
Passing only one coordinate will cause a warning to be logged and
null to be returned; passing neither coordinate is allowed (getOffsetX/Y
will be used).
x
- X coordinatey
- Y coordinate
public void getXCoord()
This is only allowed to be called when FacetChart.chartDrawn
fires.
public float getYCoord(float value)
This is only allowed to be
called when FacetChart.chartDrawn
fires.
value
- the value to be drawn.
public static void setDefaultProperties(FacetChart facetChartProperties)
Note: This method is intended for setting default attributes only and will effect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead.
facetChartProperties
- properties that should be used as new defaults when instances of this class are createdpublic void setData(Record[] records)
Data should be specified as an array of Records where each record contains one data value. Each record also contains a property named after each facetId whose value is a facetValueId from that facet.
For example, with
a facet with id "regions" and facetValues "west", "north" and "east", and
with valueProperty
with it's default value
"_value", the
data
property
could be:
isc.Chart.create({ facets:[{ id:"regions" }], data : [ {regions:"west", _value:4}, {regions:"north", _value:2}, {regions:"east", _value:5} ] })If there were a second facet with id "product" and facetValues "cars" and "trucks", a Chart with a complete set of values would be:
isc.Chart.create({ facets:[{ id:"regions" }, { id:"product" }], data : [ {product:"cars", regions:"west", _value:4}, {product:"cars", regions:"north", _value:2}, {product:"cars", regions:"east", _value:5}, {product:"trucks", regions:"west", _value:1}, {product:"trucks", regions:"north", _value:9}, {product:"trucks", regions:"east", _value:3} ] })This 2 facet (or "2 dimensional") dataset, if rendered as a bar chart, would use stacked or clustered bars and a legend.
data
- data Default value is nullpublic void setData(RecordList records)
public Record[] getRecords()
public RecordList getDataAsRecordList()
public void setFacets(Facet... facets)
com.smartgwt.client.widgets.cube.CubeGrid#setFacets,CubetGrid facets
except that:
facets
- public void setPointHoverCustomizer(ChartPointHoverCustomizer hoverCustomizer)
showDataPoints
is true and the mouse hovers
over a point.
hoverCustomizer
- public void setPointClickHandler(ChartPointClickHandler handler)
showDataPoints
is true,
and the user clicks on a point.
handler
- public void setLogGradations(Float... logGradations) throws IllegalStateException
useLogGradations
is set, gradation lines
to show in between powers,
expressed as a series of integer or float values between 0 and logBase
.
Some other common possibilities (for base 10):
[ 1, 2, 4, 8 ] [ 5 ] [ 2.5, 5, 7.5 ]Or base 2:
[ 0.5, 1, 1.5 ] [ 1 ]
logGradations
- logGradations Default value is [ 1,2,4,6,8 ]
IllegalStateException
- this property cannot be changed after the component has been createdpublic Float[] getLogGradations()
useLogGradations
is set, gradation lines
to show in between powers,
expressed as a series of integer or float values between 0 and logBase
.
Some other common possibilities (for base 10):
[ 1, 2, 4, 8 ] [ 5 ] [ 2.5, 5, 7.5 ]Or base 2:
[ 0.5, 1, 1.5 ] [ 1 ]
public void setAxisValueFormatter(ValueFormatter formatter)
formatter
- Formatter to apply to values displayed in the gradation labelspublic void setDataValueFormatter(ValueFormatter formatter)
formatter
- Formatter to apply to values displayed in the hover labels and other value labelspublic com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.chart.FacetChartLogicalStructure s)
public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
getLogicalStructure
in interface LogicalStructure
getLogicalStructure
in class DrawPane
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |