com.smartgwt.client.widgets.chart
Class FacetChart

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.smartgwt.client.widgets.BaseWidget
              extended by com.smartgwt.client.widgets.Canvas
                  extended by com.smartgwt.client.widgets.drawing.DrawPane
                      extended by com.smartgwt.client.widgets.chart.FacetChart
All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasChartBackgroundDrawnHandlers, HasChartDrawnHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers

public class FacetChart
extends DrawPane
implements HasChartDrawnHandlers, HasChartBackgroundDrawnHandlers

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");
  

the Inlined Facet

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");
  

Dual axis or multi-axis charts

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

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.

Notes on printing

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.smartgwt.client.widgets.Canvas
addChild, addChild, addChild, addChild, addClickHandler, addDoubleClickHandler, addDragMoveHandler, addDragRepositionMoveHandler, addDragRepositionStartHandler, addDragRepositionStopHandler, addDragResizeMoveHandler, addDragResizeStartHandler, addDragResizeStopHandler, addDragStartHandler, addDragStopHandler, addDropHandler, addDropMoveHandler, addDropOutHandler, addDropOverHandler, addFocusChangedHandler, addHoverHandler, addHoverHiddenHandler, addKeyDownHandler, addKeyPressHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseStillDownHandler, addMouseUpHandler, addMouseWheelHandler, addMovedHandler, addParentMovedHandler, addPeer, addPeer, addResizedHandler, addRightMouseDownHandler, addScrolledHandler, addShowContextMenuHandler, addStyleName, addVisibilityChangedHandler, adjustForContent, animateFade, animateFade, animateFade, animateHide, animateHide, animateHide, animateMove, animateMove, animateMove, animateMove, animateRect, animateRect, animateRect, animateResize, animateResize, animateResize, animateScroll, animateScroll, animateScroll, animateShow, animateShow, animateShow, blur, bringToFront, clear, clickMaskUp, clickMaskUp, contains, contains, containsEvent, containsFocus, containsPoint, containsPoint, convertToCanvasArray, deparent, depeer, disable, enable, focus, getAbsoluteLeft, getAbsoluteTop, getAccessKey, getAnimateAcceleration, getAnimateFadeTime, getAnimateHideAcceleration, getAnimateHideTime, getAnimateMoveAcceleration, getAnimateMoveTime, getAnimateRectAcceleration, getAnimateRectTime, getAnimateResizeAcceleration, getAnimateResizeTime, getAnimateScrollAcceleration, getAnimateScrollTime, getAnimateShowAcceleration, getAnimateShowEffect, getAnimateShowTime, getAnimateTime, getAppImgDir, getAriaRole, getAttribute, getAutoDraw, getAutoShowParent, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorder, getBottom, getById, getCanAcceptDrop, getCanDragReposition, getCanDragResize, getCanDragScroll, getCanDrop, getCanDropBefore, getCanFocus, getCanHover, getCanSelectText, getCanvasItem, getChildren, getChildrenSnapResizeToGrid, getChildrenSnapToGrid, getClassName, getContents, getContextMenu, getCursor, getDataPath, getDefaultHeight, getDefaultWidth, getDestroyed, getDestroying, getDisabled, getDisabledCursor, getDoubleClickDelay, getDragAppearance, getDragIntersectStyle, getDragOpacity, getDragRepositionAppearance, getDragRepositionCursor, getDragResizeAppearance, getDragScrollDelay, getDragStartDistance, getDragTarget, getDragType, getDropTypes, getDynamicContents, getEdgeBackgroundColor, getEdgeCenterBackgroundColor, getEdgeImage, getEdgeMarginSize, getEdgeOffset, getEdgeOpacity, getEdgeShowCenter, getEdgeSize, getEventEdge, getEventEdge, getExtraSpace, getFacetId, getFullDataPath, getGroupTitle, getHeight, getHeightAsString, getHoverAlign, getHoverAutoDestroy, getHoverComponent, getHoverDelay, getHoverHeight, getHoverHTML, getHoverMoveWithMouse, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getHoverWrap, getHSnapOrigin, getHSnapOrigin, getHSnapPosition, getHSnapPosition, getHtmlPosition, getImgURL, getImgURL, getInnerContentHeight, getInnerContentWidth, getInnerHeight, getInnerWidth, getIsGroup, getKeepInParentRect, getLayoutAlign, getLeft, getLeftAsString, getLocateChildrenBy, getLocateChildrenType, getLocatePeersBy, getLocatePeersType, getMargin, getMasterElement, getMatchElement, getMaxHeight, getMaxWidth, getMenuConstructor, getMinHeight, getMinWidth, getMouseStillDownDelay, getMouseStillDownInitialDelay, getNextZIndex, getNoDoubleClicks, getOffsetHeight, getOffsetWidth, getOffsetX, getOffsetY, getOpacity, getOverflow, getPadding, getPageBottom, getPageLeft, getPageRect, getPageRight, getPageTop, getParentElement, getParentElements, getPeers, getPercentBox, getPercentSource, getPosition, getPrefix, getPrintChildrenAbsolutelyPositioned, getPrintHTML, getPrintHTML, getPrompt, getRect, getRedrawOnResize, getResizeBarTarget, getResizeFrom, getRight, getScrollbarSize, getScrollBottom, getScrollHeight, getScrollLeft, getScrollRight, getScrollTop, getScrollWidth, getShadowDepth, getShadowImage, getShadowOffset, getShadowSoftness, getShouldPrint, getShowCustomScrollbars, getShowDragShadow, getShowEdges, getShowHover, getShowHoverComponents, getShowResizeBar, getShowShadow, getSkinImgDir, getSnapAxis, getSnapEdge, getSnapHDirection, getSnapHGap, getSnapOffsetLeft, getSnapOffsetTop, getSnapOnDrop, getSnapResizeToGrid, getSnapTo, getSnapToGrid, getSnapVDirection, getSnapVGap, getTabIndex, getTooltip, getTop, getTopAsString, getTopElement, getUseBackMask, getUseOpacityFilter, getValuesManager, getViewportHeight, getViewportWidth, getVisibility, getVisibleHeight, getVisibleWidth, getVSnapOrigin, getVSnapOrigin, getVSnapPosition, getVSnapPosition, getWidth, getWidthAsString, getZIndex, handleHover, hide, hideClickMask, hideClickMask, hideContextMenu, imgHTML, imgHTML, imgHTML, intersects, isDirty, isDisabled, isDrawn, isVisible, keyUp, layoutChildren, linkHTML, linkHTML, markForDestroy, markForRedraw, markForRedraw, moveAbove, moveBelow, moveBy, moveTo, onAttach, onDetach, onInit, parentResized, printComponents, redraw, redraw, removeChild, removeChild, removePeer, removePeer, resizeBy, resizeTo, resizeTo, scrollBy, scrollByPercent, scrollTo, scrollTo, scrollToBottom, scrollToLeft, scrollToPercent, scrollToRight, scrollToTop, sendToBack, setAccessKey, setAlign, setAllowExternalFilters, setAnimateAcceleration, setAnimateFadeTime, setAnimateHideAcceleration, setAnimateHideTime, setAnimateMoveAcceleration, setAnimateMoveTime, setAnimateRectAcceleration, setAnimateRectTime, setAnimateResizeAcceleration, setAnimateResizeTime, setAnimateScrollAcceleration, setAnimateScrollTime, setAnimateShowAcceleration, setAnimateShowEffect, setAnimateShowTime, setAnimateTime, setAppImgDir, setAriaRole, setAutoDraw, setAutoHeight, setAutoShowParent, setAutoWidth, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBottom, setCanAcceptDrop, setCanDragReposition, setCanDragResize, setCanDragScroll, setCanDrop, setCanDropBefore, setCanFocus, setCanHover, setCanSelectText, setCanvasItem, setChildren, setChildrenSnapResizeToGrid, setChildrenSnapToGrid, setContents, setContextMenu, setCursor, setDataPath, setDefaultHeight, setDefaultProperties, setDefaultWidth, setDisabled, setDisabledCursor, setDoubleClickDelay, setDragAppearance, setDragIntersectStyle, setDragOpacity, setDragRepositionAppearance, setDragRepositionCursor, setDragResizeAppearance, setDragScrollDelay, setDragStartDistance, setDragTarget, setDragType, setDropTypes, setDynamicContents, setEdgeBackgroundColor, setEdgeCenterBackgroundColor, setEdgeImage, setEdgeMarginSize, setEdgeOffset, setEdgeOpacity, setEdgeShowCenter, setEdgeSize, setExtraSpace, setFacetId, setGroupTitle, setHeight, setHeight, setHeight100, setHoverAlign, setHoverAutoDestroy, setHoverDelay, setHoverHeight, setHoverMoveWithMouse, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWrap, setHtmlPosition, setImage, setImage, setIsGroup, setKeepInParentRect, setKeepInParentRect, setKeepInParentRect, setLayoutAlign, setLayoutAlign, setLeft, setLeft, setLocateChildrenBy, setLocateChildrenType, setLocatePeersBy, setLocatePeersType, setLogicalStructure, setMargin, setMatchElement, setMaxHeight, setMaxWidth, setMenuConstructor, setMinHeight, setMinWidth, setMouseStillDownDelay, setMouseStillDownInitialDelay, setNeverUseFilters, setNoDoubleClicks, setOpacity, setOverflow, setPadding, setPageLeft, setPageTop, setParentElement, setPeers, setPercentBox, setPercentSource, setPosition, setPrefix, setPrintChildrenAbsolutelyPositioned, setPrompt, setRect, setRect, setRedrawOnResize, setResizeBarTarget, setResizeFrom, setResizeFrom, setRight, setScrollbarSize, setShadowDepth, setShadowImage, setShadowOffset, setShadowSoftness, setShouldPrint, setShowCustomScrollbars, setShowDragShadow, setShowEdges, setShowHover, setShowHoverComponents, setShowResizeBar, setShowShadow, setSkinImgDir, setSmoothFade, setSnapAxis, setSnapEdge, setSnapHDirection, setSnapHGap, setSnapOffsetLeft, setSnapOffsetTop, setSnapOnDrop, setSnapResizeToGrid, setSnapTo, setSnapToGrid, setSnapVDirection, setSnapVGap, setTabIndex, setTooltip, setTop, setTop, setUseBackMask, setUseOpacityFilter, setValuesManager, setVisibility, setVisible, setWidth, setWidth, setWidth100, setZIndex, shouldDragScroll, show, showClickMask, showNextTo, showNextTo, showPrintPreview, showPrintPreview, showPrintPreview, showPrintPreview, showRecursively, updateHover, updateHover, updateShadow, visibleAtPoint, willAcceptDrop
 
Methods inherited from class com.smartgwt.client.widgets.BaseWidget
addDrawHandler, destroy, doAddHandler, doInit, doOnRender, draw, equals, error, errorIfNotCreated, fireEvent, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDateArray, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getConfig, getDOM, getElement, getElement, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, getScClassName, hashCode, initNativeObject, isConfigOnly, isCreated, onDestroy, onDraw, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setDragTracker, setElement, setHtmlElement, setID, setLogicalStructure, setNullProperty, setPosition, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setScClassName, toString
 
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

FacetChart

public FacetChart()

FacetChart

public FacetChart(JavaScriptObject jsObj)
Method Detail

getOrCreateRef

public static FacetChart getOrCreateRef(JavaScriptObject jsObj)

setJavaScriptObject

public void setJavaScriptObject(JavaScriptObject jsObj)
Overrides:
setJavaScriptObject in class DrawPane

create

protected JavaScriptObject create()
Overrides:
create in class DrawPane

setAutoRotateLabels

public void setAutoRotateLabels(Boolean autoRotateLabels)
                         throws IllegalStateException
Whether to automatically rotate labels if needed in order to make them legible and non-overlapping.

Parameters:
autoRotateLabels - autoRotateLabels Default value is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getAutoRotateLabels

public Boolean getAutoRotateLabels()
Whether to automatically rotate labels if needed in order to make them legible and non-overlapping.

Returns:
Boolean

setBackgroundBandProperties

public void setBackgroundBandProperties(DrawRect backgroundBandProperties)
                                 throws IllegalStateException
Properties for background band

Parameters:
backgroundBandProperties - backgroundBandProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getBackgroundBandProperties

public DrawRect getBackgroundBandProperties()
Properties for background band

Returns:
DrawRect

setBandedBackground

public void setBandedBackground(Boolean bandedBackground)
                         throws IllegalStateException
Whether to show alternating color bands in the background of chart. See backgroundBandProperties.

Parameters:
bandedBackground - bandedBackground Default value is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getBandedBackground

public Boolean getBandedBackground()
Whether to show alternating color bands in the background of chart. See backgroundBandProperties.

Returns:
Boolean

setBarMargin

public void setBarMargin(int barMargin)
                  throws IllegalStateException
Distance between bars. May be reduced if bars would be smaller than minBarThickness.

Parameters:
barMargin - barMargin Default value is 4
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getBarMargin

public int getBarMargin()
Distance between bars. May be reduced if bars would be smaller than minBarThickness.

Returns:
int

setBarProperties

public void setBarProperties(DrawRect barProperties)
Properties for bar

Parameters:
barProperties - barProperties Default value is null

getBarProperties

public DrawRect getBarProperties()
Properties for bar

Returns:
DrawRect

setChartRectMargin

public void setChartRectMargin(int chartRectMargin)
                        throws IllegalStateException
Margin around the main chart rect: between title and chart, between chart and axis labels, and chart rect and right edge of chart.

Parameters:
chartRectMargin - chartRectMargin Default value is 5
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getChartRectMargin

public 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.

Returns:
int

setChartRectProperties

public void setChartRectProperties(DrawRect chartRectProperties)
Properties for chart rect

Parameters:
chartRectProperties - chartRectProperties Default value is null

getChartRectProperties

public DrawRect getChartRectProperties()
Properties for chart rect

Returns:
DrawRect

setChartType

public void setChartType(ChartType chartType)
See ChartType for a list of known types - Column, Bar, Line, Pie, Doughnut, Area, and Radar charts are supported.

If this method is called after the component has been drawn/initialized: Method to change the current 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.

Parameters:
chartType - new chart type. Default value is "Column"

getChartType

public ChartType getChartType()
See ChartType for a list of known types - Column, Bar, Line, Pie, Doughnut, Area, and Radar charts are supported.

Returns:
ChartType

setClusterMarginRatio

public void setClusterMarginRatio(float clusterMarginRatio)
                           throws IllegalStateException
For clustered charts, ratio between margins between individual bars and margins between clusters.

Parameters:
clusterMarginRatio - clusterMarginRatio Default value is 4
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getClusterMarginRatio

public float getClusterMarginRatio()
For clustered charts, ratio between margins between individual bars and margins between clusters.

Returns:
float

setDataAxisLabelProperties

public void setDataAxisLabelProperties(DrawLabel dataAxisLabelProperties)
Properties for labels of data axis.

Parameters:
dataAxisLabelProperties - dataAxisLabelProperties Default value is null

getDataAxisLabelProperties

public DrawLabel getDataAxisLabelProperties()
Properties for labels of data axis.

Returns:
DrawLabel

setDataColors

public void setDataColors(String... dataColors)
                   throws IllegalStateException
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.

Colors must be in the format of a leading hash (#) plus 6 hexadecimal digits, for example, "#FFFFFF" is white, "#FF0000" is pure red.

Parameters:
dataColors - . See CSSColor. Default value is see below
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getDataColors

public 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.

Colors must be in the format of a leading hash (#) plus 6 hexadecimal digits, for example, "#FFFFFF" is white, "#FF0000" is pure red.

Returns:
. See CSSColor

setDataLabelProperties

public void setDataLabelProperties(DrawLabel dataLabelProperties)
Properties for data label

Parameters:
dataLabelProperties - dataLabelProperties Default value is null

getDataLabelProperties

public DrawLabel getDataLabelProperties()
Properties for data label

Returns:
DrawLabel

setDataLineProperties

public void setDataLineProperties(DrawLine dataLineProperties)
                           throws IllegalStateException
Properties for lines that show data (as opposed to gradations or borders around the data area).

Parameters:
dataLineProperties - dataLineProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getDataLineProperties

public DrawLine getDataLineProperties()
Properties for lines that show data (as opposed to gradations or borders around the data area).

Returns:
DrawLine

setDataMargin

public void setDataMargin(int dataMargin)
                   throws IllegalStateException
For rectangular charts (bar, column, line), margin around the inside of the main chart area, so that data elements are not flush to edge.

Parameters:
dataMargin - dataMargin Default value is 10
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getDataMargin

public 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.

Returns:
int

setDataOutlineProperties

public void setDataOutlineProperties(DrawItem dataOutlineProperties)
                              throws IllegalStateException
Properties for lines that outline a data shape (in filled charts such as area or radar charts).

Parameters:
dataOutlineProperties - dataOutlineProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getDataOutlineProperties

public DrawItem getDataOutlineProperties()
Properties for lines that outline a data shape (in filled charts such as area or radar charts).

Returns:
DrawItem

setDataPointProperties

public void setDataPointProperties(DrawItem dataPointProperties)
                            throws IllegalStateException
Common properties to apply for all data points (see showDataPoints).

Parameters:
dataPointProperties - dataPointProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getDataPointProperties

public DrawItem getDataPointProperties()
Common properties to apply for all data points (see showDataPoints).

Returns:
DrawItem

setDataPointSize

public void setDataPointSize(int dataPointSize)
                      throws IllegalStateException
Size in pixels for data points drawn for line, area, radar and other chart types.

Parameters:
dataPointSize - dataPointSize Default value is 5
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getDataPointSize

public int getDataPointSize()
Size in pixels for data points drawn for line, area, radar and other chart types.

Returns:
int

setDataShapeProperties

public void setDataShapeProperties(DrawPath dataShapeProperties)
                            throws IllegalStateException
Properties for data shapes (filled areas in area or radar charts).

Parameters:
dataShapeProperties - dataShapeProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getDataShapeProperties

public DrawPath getDataShapeProperties()
Properties for data shapes (filled areas in area or radar charts).

Returns:
DrawPath

setDecimalPrecision

public void setDecimalPrecision(int decimalPrecision)
                         throws IllegalStateException
Default precision used when formatting float numbers for axis labels

Parameters:
decimalPrecision - decimalPrecision Default value is 2
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getDecimalPrecision

public int getDecimalPrecision()
Default precision used when formatting float numbers for axis labels

Returns:
int

setDoughnutHoleProperties

public void setDoughnutHoleProperties(DrawOval doughnutHoleProperties)
Properties for doughnut hole

Parameters:
doughnutHoleProperties - doughnutHoleProperties Default value is null

getDoughnutHoleProperties

public DrawOval getDoughnutHoleProperties()
Properties for doughnut hole

Returns:
DrawOval

setDoughnutRatio

public void setDoughnutRatio(float doughnutRatio)
                      throws IllegalStateException
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.

Parameters:
doughnutRatio - doughnutRatio Default value is 0.2
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getDoughnutRatio

public 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.

Returns:
float

setExtraAxisMetrics

public void setExtraAxisMetrics(String... extraAxisMetrics)
                         throws IllegalStateException
Defines the set of metrics that will be plotted as additional vertical axes. See the main 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).

Parameters:
extraAxisMetrics - . See String. Default value is []
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getExtraAxisMetrics

public String[] getExtraAxisMetrics()
Defines the set of metrics that will be plotted as additional vertical axes. See the main 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).

Returns:
. See String

setExtraAxisSettings

public void setExtraAxisSettings(MetricSettings... extraAxisSettings)
                          throws IllegalStateException
For charts will multiple vertical axes, optionally provides settings for how each 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 chartTypes are left unspecified then by default the first metric will be drawn as columns and the remaining will be drawn as lines.

Parameters:
extraAxisSettings - extraAxisSettings Default value is []
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getExtraAxisSettings

public MetricSettings[] getExtraAxisSettings()
For charts will multiple vertical axes, optionally provides settings for how each 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 chartTypes are left unspecified then by default the first metric will be drawn as columns and the remaining will be drawn as lines.

Returns:
MetricSettings

setFilled

public 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.

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.

Parameters:
filled - new value. Default value is null

getFilled

public 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.

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.

Returns:
Boolean

setGradationLabelProperties

public void setGradationLabelProperties(DrawLabel gradationLabelProperties)
                                 throws IllegalStateException
Properties for gradation labels

Parameters:
gradationLabelProperties - gradationLabelProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getGradationLabelProperties

public DrawLabel getGradationLabelProperties()
Properties for gradation labels

Returns:
DrawLabel

setGradationLineProperties

public void setGradationLineProperties(DrawLine gradationLineProperties)
                                throws IllegalStateException
Properties for gradation lines

Parameters:
gradationLineProperties - gradationLineProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getGradationLineProperties

public DrawLine getGradationLineProperties()
Properties for gradation lines

Returns:
DrawLine

setGradationTickMarkLength

public void setGradationTickMarkLength(int gradationTickMarkLength)
                                throws IllegalStateException
Length of the tick marks used to denote the gradations of any extra value axes.

Parameters:
gradationTickMarkLength - gradationTickMarkLength Default value is 5
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getGradationTickMarkLength

public int getGradationTickMarkLength()
Length of the tick marks used to denote the gradations of any extra value axes.

Returns:
int

setGradationZeroLineProperties

public void setGradationZeroLineProperties(DrawLine gradationZeroLineProperties)
                                    throws IllegalStateException
Properties for the gradation line drawn for zero (slightly thicker by default).

Parameters:
gradationZeroLineProperties - gradationZeroLineProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getGradationZeroLineProperties

public DrawLine getGradationZeroLineProperties()
Properties for the gradation line drawn for zero (slightly thicker by default).

Returns:
DrawLine

setHoverLabelProperties

public void setHoverLabelProperties(DrawLabel hoverLabelProperties)
                             throws IllegalStateException
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.

Parameters:
hoverLabelProperties - hoverLabelProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getHoverLabelProperties

public 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.

Returns:
DrawLabel

setLegendItemPadding

public void setLegendItemPadding(int legendItemPadding)
                          throws IllegalStateException
Padding between each swatch and label pair.

Parameters:
legendItemPadding - legendItemPadding Default value is 5
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getLegendItemPadding

public int getLegendItemPadding()
Padding between each swatch and label pair.

Returns:
int

setLegendLabelProperties

public void setLegendLabelProperties(DrawLabel legendLabelProperties)
                              throws IllegalStateException
Properties for labels shown next to legend color swatches.

Parameters:
legendLabelProperties - legendLabelProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getLegendLabelProperties

public DrawLabel getLegendLabelProperties()
Properties for labels shown next to legend color swatches.

Returns:
DrawLabel

setLegendMargin

public void setLegendMargin(int legendMargin)
                     throws IllegalStateException
Space between the legend and the chart rect or axis labels (whatever the legend is adjacent to.

Parameters:
legendMargin - legendMargin Default value is 10
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getLegendMargin

public int getLegendMargin()
Space between the legend and the chart rect or axis labels (whatever the legend is adjacent to.

Returns:
int

setLegendPadding

public void setLegendPadding(int legendPadding)
                      throws IllegalStateException
Padding around the legend as a whole.

Parameters:
legendPadding - legendPadding Default value is 5
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getLegendPadding

public int getLegendPadding()
Padding around the legend as a whole.

Returns:
int

setLegendRectProperties

public void setLegendRectProperties(DrawRect legendRectProperties)
                             throws IllegalStateException
Properties for rectangle around the legend as a whole.

Parameters:
legendRectProperties - legendRectProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getLegendRectProperties

public DrawRect getLegendRectProperties()
Properties for rectangle around the legend as a whole.

Returns:
DrawRect

setLegendSwatchProperties

public void setLegendSwatchProperties(DrawRect legendSwatchProperties)
                               throws IllegalStateException
Properties for the swatches of color shown in the legend.

Parameters:
legendSwatchProperties - legendSwatchProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getLegendSwatchProperties

public DrawRect getLegendSwatchProperties()
Properties for the swatches of color shown in the legend.

Returns:
DrawRect

setLegendSwatchSize

public void setLegendSwatchSize(int legendSwatchSize)
                         throws IllegalStateException
Size of individual color swatches in legend.

Parameters:
legendSwatchSize - legendSwatchSize Default value is 16
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getLegendSwatchSize

public int getLegendSwatchSize()
Size of individual color swatches in legend.

Returns:
int

setLegendTextPadding

public void setLegendTextPadding(int legendTextPadding)
                          throws IllegalStateException
Padding between color swatch and its label.

Parameters:
legendTextPadding - legendTextPadding Default value is 5
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getLegendTextPadding

public int getLegendTextPadding()
Padding between color swatch and its label.

Returns:
int

setLogBase

public void setLogBase(int logBase)
                throws IllegalStateException
When useLogGradations, base value for logarithmic gradation lines. Gradation lines will be shown at every power of this value plus intervening values specified by logGradations.

Parameters:
logBase - logBase Default value is 10
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getLogBase

public int getLogBase()
When useLogGradations, base value for logarithmic gradation lines. Gradation lines will be shown at every power of this value plus intervening values specified by logGradations.

Returns:
int

setLogScale

public void setLogScale(Boolean logScale)
                 throws IllegalStateException
Whether to use logarithmic scaling for values.

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).

Parameters:
logScale - logScale Default value is false
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getLogScale

public Boolean getLogScale()
Whether to use logarithmic scaling for values.

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).

Returns:
Boolean

setMaxBarThickness

public void setMaxBarThickness(int maxBarThickness)
                        throws IllegalStateException
Bars will not be drawn over this thickness, instead, margins will be increased.

Parameters:
maxBarThickness - maxBarThickness Default value is 150
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getMaxBarThickness

public int getMaxBarThickness()
Bars will not be drawn over this thickness, instead, margins will be increased.

Returns:
int

setMinBarThickness

public void setMinBarThickness(int minBarThickness)
                        throws IllegalStateException
If bars would be smaller than this size, margins are reduced until bars overlap.

Parameters:
minBarThickness - minBarThickness Default value is 4
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getMinBarThickness

public int getMinBarThickness()
If bars would be smaller than this size, margins are reduced until bars overlap.

Returns:
int

setPieBorderProperties

public void setPieBorderProperties(DrawOval pieBorderProperties)
                            throws IllegalStateException
Properties for the border around a pie chart.

Parameters:
pieBorderProperties - pieBorderProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getPieBorderProperties

public DrawOval getPieBorderProperties()
Properties for the border around a pie chart.

Returns:
DrawOval

setPieLabelAngleStart

public void setPieLabelAngleStart(int pieLabelAngleStart)
                           throws IllegalStateException
Angle where first label is placed in a Pie chart in stacked mode, in degrees.

Parameters:
pieLabelAngleStart - pieLabelAngleStart Default value is 20
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getPieLabelAngleStart

public int getPieLabelAngleStart()
Angle where first label is placed in a Pie chart in stacked mode, in degrees.

Returns:
int

setPieLabelLineExtent

public void setPieLabelLineExtent(int pieLabelLineExtent)
                           throws IllegalStateException
How far label lines stick out of the pie radius in a Pie chart in stacked mode.

Parameters:
pieLabelLineExtent - pieLabelLineExtent Default value is 7
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getPieLabelLineExtent

public int getPieLabelLineExtent()
How far label lines stick out of the pie radius in a Pie chart in stacked mode.

Returns:
int

setPieLabelLineProperties

public void setPieLabelLineProperties(DrawLine pieLabelLineProperties)
Properties for pie label line

Parameters:
pieLabelLineProperties - pieLabelLineProperties Default value is null

getPieLabelLineProperties

public DrawLine getPieLabelLineProperties()
Properties for pie label line

Returns:
DrawLine

setPieRingBorderProperties

public void setPieRingBorderProperties(DrawOval pieRingBorderProperties)
                                throws IllegalStateException
Properties for pie ring border

Parameters:
pieRingBorderProperties - pieRingBorderProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getPieRingBorderProperties

public DrawOval getPieRingBorderProperties()
Properties for pie ring border

Returns:
DrawOval

setPieSliceProperties

public void setPieSliceProperties(DrawSector pieSliceProperties)
                           throws IllegalStateException
Properties for pie slices

Parameters:
pieSliceProperties - pieSliceProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getPieSliceProperties

public DrawSector getPieSliceProperties()
Properties for pie slices

Returns:
DrawSector

setRadarBackgroundProperties

public void setRadarBackgroundProperties(DrawOval radarBackgroundProperties)
                                  throws IllegalStateException
Properties for radar background

Parameters:
radarBackgroundProperties - radarBackgroundProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getRadarBackgroundProperties

public DrawOval getRadarBackgroundProperties()
Properties for radar background

Returns:
DrawOval

setRadialLabelOffset

public void setRadialLabelOffset(int radialLabelOffset)
                          throws IllegalStateException
Distance in pixels that radial labels are offset from the outside of the circle.

Parameters:
radialLabelOffset - radialLabelOffset Default value is 5
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getRadialLabelOffset

public int getRadialLabelOffset()
Distance in pixels that radial labels are offset from the outside of the circle.

Returns:
int

setShadowProperties

public void setShadowProperties(DrawOval shadowProperties)
                         throws IllegalStateException
Properties for shadows.

Parameters:
shadowProperties - shadowProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShadowProperties

public DrawOval getShadowProperties()
Properties for shadows.

Returns:
DrawOval

setShowChartRect

public void setShowChartRect(Boolean showChartRect)
                      throws IllegalStateException
Whether to show a rectangular shape around the area of the chart where data is plotted.

Parameters:
showChartRect - showChartRect Default value is false
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowChartRect

public Boolean getShowChartRect()
Whether to show a rectangular shape around the area of the chart where data is plotted.

Returns:
Boolean

setShowDataAxisLabel

public void setShowDataAxisLabel(Boolean showDataAxisLabel)
                          throws IllegalStateException
Whether to show a label for the data axis as a whole (the data axis is where labels for each data point appear). If true, title for the data label facet will be shown as the label.

Automatically disabled for non-rectangular charts (eg Pie, Radar).

Parameters:
showDataAxisLabel - showDataAxisLabel Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowDataAxisLabel

public 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). If true, title for the data label facet will be shown as the label.

Automatically disabled for non-rectangular charts (eg Pie, Radar).

Returns:
Boolean

setShowDataPoints

public void setShowDataPoints(Boolean showDataPoints)
                       throws IllegalStateException
For line charts, whether to show data points for each individual data value.

If shown, the FacetChart.pointClick and FacetChart.getPointHoverHTML APIs can be used to create interactivity.

Parameters:
showDataPoints - showDataPoints Default value is false
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowDataPoints

public Boolean getShowDataPoints()
For line charts, whether to show data points for each individual data value.

If shown, the FacetChart.pointClick and FacetChart.getPointHoverHTML APIs can be used to create interactivity.

Returns:
Boolean

setShowDataValues

public void setShowDataValues(Boolean showDataValues)
                       throws IllegalStateException
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.

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.

Parameters:
showDataValues - showDataValues Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowDataValues

public 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.

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.

Returns:
Boolean

setShowDoughnut

public void setShowDoughnut(Boolean showDoughnut)
                     throws IllegalStateException
Whether to show a "doughnut hole" in the middle of pie charts. Defaults to whether chartType is set to "Doughnut" (shown) vs "Pie" (not shown) but can be forced on or off via showDoughnut.

Parameters:
showDoughnut - showDoughnut Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowDoughnut

public Boolean getShowDoughnut()
Whether to show a "doughnut hole" in the middle of pie charts. Defaults to whether chartType is set to "Doughnut" (shown) vs "Pie" (not shown) but can be forced on or off via showDoughnut.

Returns:
Boolean

setShowLegend

public void setShowLegend(Boolean showLegend)
                   throws IllegalStateException
The legend is automatically shown for charts that need it (generally, multi-series charts) but can be forced off by setting showLegend to false.

Parameters:
showLegend - showLegend Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowLegend

public 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.

Returns:
Boolean

setShowRadarGradationLabels

public void setShowRadarGradationLabels(Boolean showRadarGradationLabels)
                                 throws IllegalStateException
Whether to show gradation labels in radar charts.

Parameters:
showRadarGradationLabels - showRadarGradationLabels Default value is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowRadarGradationLabels

public Boolean getShowRadarGradationLabels()
Whether to show gradation labels in radar charts.

Returns:
Boolean

setShowScatterLines

public void setShowScatterLines(ScatterLineType showScatterLines)
                         throws IllegalStateException
How to draw lines between adjacent data points of "Scatter" plots. See ScatterLineType.

Parameters:
showScatterLines - showScatterLines Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowScatterLines

public ScatterLineType getShowScatterLines()
How to draw lines between adjacent data points of "Scatter" plots. See ScatterLineType.

Returns:
ScatterLineType

setShowShadows

public void setShowShadows(Boolean showShadows)
                    throws IllegalStateException
Whether to automatically show shadows for various charts.

Parameters:
showShadows - showShadows Default value is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowShadows

public Boolean getShowShadows()
Whether to automatically show shadows for various charts.

Returns:
Boolean

setShowTitle

public void setShowTitle(Boolean showTitle)
Whether to show a title.

Parameters:
showTitle - showTitle Default value is true

getShowTitle

public Boolean getShowTitle()
Whether to show a title.

Returns:
Boolean

setShowValueAxisLabel

public void setShowValueAxisLabel(Boolean showValueAxisLabel)
                           throws IllegalStateException
Whether to show the valueTitle as a label on the value axis.

Automatically disabled for non-rectangular charts (eg Pie, Radar).

Parameters:
showValueAxisLabel - showValueAxisLabel Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowValueAxisLabel

public Boolean getShowValueAxisLabel()
Whether to show the valueTitle as a label on the value axis.

Automatically disabled for non-rectangular charts (eg Pie, Radar).

Returns:
Boolean

setShowValueOnHover

public void setShowValueOnHover(Boolean showValueOnHover)
                         throws IllegalStateException
Shows the value of the nearest data value in a floating label whenever the mouse moves within the main chart area. The visual element representing the data value will also be emphasized by brightening or highlighting it (appearance differs by chart type).

Calculates nearest value based on FacetChart.getNearestDrawnValue.

The label's appearance is controlled by hoverLabelProperties.

Parameters:
showValueOnHover - showValueOnHover Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowValueOnHover

public Boolean getShowValueOnHover()
Shows the value of the nearest data value in a floating label whenever the mouse moves within the main chart area. The visual element representing the data value will also be emphasized by brightening or highlighting it (appearance differs by chart type).

Calculates nearest value based on FacetChart.getNearestDrawnValue.

The label's appearance is controlled by hoverLabelProperties.

Returns:
Boolean

setStacked

public void setStacked(Boolean stacked)
Whether to use stacking for charts where this makes sense (column, area, pie, line and radar charts). If stacked is not set and two facets are supplied, clustering is assumed. If null (the default), line charts will be unstacked, and others will be stacked.

If this method is called after the component has been drawn/initialized: Method to change stacked. Use null to apply a default value for the current chartType.

Parameters:
stacked - new value. Default value is null

getStacked

public Boolean getStacked()
Whether to use stacking for charts where this makes sense (column, area, pie, line and radar charts). If stacked is not set and two facets are supplied, clustering is assumed. If null (the default), line charts will be unstacked, and others will be stacked.

Returns:
Boolean

setStyleName

public void setStyleName(String styleName)
Default styleName for the chart.

Overrides:
setStyleName in class Canvas
Parameters:
styleName - . See CSSStyleName. Default value is "scChart"
See Also:
Appearance overview and related methods, CSS styles Example

getStyleName

public String getStyleName()
Default styleName for the chart.

Overrides:
getStyleName in class Canvas
Returns:
. See CSSStyleName
See Also:
Appearance overview and related methods, CSS styles Example

setTickMarkToValueAxisMargin

public void setTickMarkToValueAxisMargin(int tickMarkToValueAxisMargin)
                                  throws IllegalStateException
Margin between the tick marks and the labels of the extra value axes.

Parameters:
tickMarkToValueAxisMargin - tickMarkToValueAxisMargin Default value is 7
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getTickMarkToValueAxisMargin

public int getTickMarkToValueAxisMargin()
Margin between the tick marks and the labels of the extra value axes.

Returns:
int

setTitle

public void setTitle(String title)
Title for the chart as a whole.

Overrides:
setTitle in class Canvas
Parameters:
title - . See String. Default value is null

getTitle

public String getTitle()
Title for the chart as a whole.

Overrides:
getTitle in class Canvas
Returns:
. See String

setTitleProperties

public void setTitleProperties(DrawLabel titleProperties)
Properties for title label.

Parameters:
titleProperties - titleProperties Default value is null

getTitleProperties

public DrawLabel getTitleProperties()
Properties for title label.

Returns:
DrawLabel

setUseAutoGradients

public void setUseAutoGradients(Boolean useAutoGradients)
                         throws IllegalStateException
Causes the chart to use the colors specified in dataColors but specify chart-specific gradients based on the primary data color per chart type.

Parameters:
useAutoGradients - useAutoGradients Default value is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getUseAutoGradients

public 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.

Returns:
Boolean

setUseLogGradations

public void setUseLogGradations(Boolean useLogGradations)
                         throws IllegalStateException
Whether to use classic logarithmic gradations, where each order of magnitude is shown as a gradation as well as a few intervening lines. Gradations also begin and end on an order of magnitude. For example, 1,2,4,6,8,10,20,40,60,80,100.

Default gradations can be overridden via logBase and logGradations.

Parameters:
useLogGradations - useLogGradations Default value is false
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getUseLogGradations

public 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. Gradations also begin and end on an order of magnitude. For example, 1,2,4,6,8,10,20,40,60,80,100.

Default gradations can be overridden via logBase and logGradations.

Returns:
Boolean

setValueAxisLabelProperties

public void setValueAxisLabelProperties(DrawLabel valueAxisLabelProperties)
Properties for labels of value axis.

Parameters:
valueAxisLabelProperties - valueAxisLabelProperties Default value is null

getValueAxisLabelProperties

public DrawLabel getValueAxisLabelProperties()
Properties for labels of value axis.

Returns:
DrawLabel

setValueAxisMargin

public void setValueAxisMargin(int valueAxisMargin)
                        throws IllegalStateException
Margin between multiple value axes.

Parameters:
valueAxisMargin - valueAxisMargin Default value is 10
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getValueAxisMargin

public int getValueAxisMargin()
Margin between multiple value axes.

Returns:
int

setValueLineProperties

public void setValueLineProperties(DrawLine valueLineProperties)
                            throws IllegalStateException
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.

Parameters:
valueLineProperties - valueLineProperties Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getValueLineProperties

public 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.

Returns:
DrawLine

setValueProperty

public void setValueProperty(String valueProperty)
                      throws IllegalStateException
Property in each record that holds a data value.

Not used if there is an inline facet, see data.

Parameters:
valueProperty - . See String. Default value is "_value"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getValueProperty

public String getValueProperty()
Property in each record that holds a data value.

Not used if there is an inline facet, see data.

Returns:
. See String

setValueTitle

public void setValueTitle(String valueTitle)
                   throws IllegalStateException
A label for the data values, such as "Sales in Thousands", typically used as the label for the value axis.

Parameters:
valueTitle - . See String. Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getValueTitle

public String getValueTitle()
A label for the data values, such as "Sales in Thousands", typically used as the label for the value axis.

Returns:
. See String

setXAxisMetric

public void setXAxisMetric(String xAxisMetric)
                    throws IllegalStateException
For scatter charts only, the "id" of the metric facet value to use for the x-axis.

The default x-axis metric is the second value of the metric facet.

Parameters:
xAxisMetric - . See String. Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getXAxisMetric

public String getXAxisMetric()
For scatter charts only, the "id" of the metric facet value to use for the x-axis.

The default x-axis metric is the second value of the metric facet.

Returns:
. See String

setYAxisMetric

public void setYAxisMetric(String yAxisMetric)
                    throws IllegalStateException
For scatter charts only, the "id" of the metric facet value to use for the y-axis.

The default y-axis metric is the first value of the metric facet.

Parameters:
yAxisMetric - . See String. Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getYAxisMetric

public String getYAxisMetric()
For scatter charts only, the "id" of the metric facet value to use for the y-axis.

The default y-axis metric is the first value of the metric facet.

Returns:
. See String

addChartBackgroundDrawnHandler

public HandlerRegistration addChartBackgroundDrawnHandler(ChartBackgroundDrawnHandler handler)
Add a chartBackgroundDrawn 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 DrawItems, 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.

Specified by:
addChartBackgroundDrawnHandler in interface HasChartBackgroundDrawnHandlers
Parameters:
handler - the chartBackgroundDrawn handler
Returns:
HandlerRegistration used to remove this handler

addChartDrawnHandler

public HandlerRegistration addChartDrawnHandler(ChartDrawnHandler handler)
Add a chartDrawn handler.

Called when all elements of the chart (data lines / shapes, gradations, legend, labels etc) have completed drawing.

See FacetChart.chartBackgroundDrawn for usage information.

Specified by:
addChartDrawnHandler in interface HasChartDrawnHandlers
Parameters:
handler - the chartDrawn handler
Returns:
HandlerRegistration used to remove this handler

getChartCenter

public Point getChartCenter()
Returns the centerpoint for radar charts and pie charts.

Note that unstacked pie charts draw multiple pies, each with their own centers.

This is only allowed to be called when FacetChart.chartDrawn fires.

Returns:
the centerpoint for radar charts and pie charts.

getChartHeight

public float getChartHeight(boolean recalc)
Get the height the central chart area, where data elements appear.

This is only allowed to be called when FacetChart.chartDrawn fires.

Parameters:
recalc - if false then cached value will be returned, otherwise will be recalculated.
Returns:
the width of the central chart area.

getChartLeft

public float getChartLeft()
Get the left margin of the central chart area, where data elements appear.

This is only allowed to be called when FacetChart.chartDrawn fires.

Returns:
left margin of the central chart area

getChartRadius

public float getChartRadius()
Returns the radius for radar charts and pie charts. For stacked pie charts this is radius of the outermost pie.

Note that unstacked pie charts draw multiple pies, each with their own radii.

This is only allowed to be called when FacetChart.chartDrawn fires.

Returns:
the radius for radar charts and pie charts.

getChartTop

public float getChartTop()
Get the top coordinate of the central chart area, where data elements appear.

This is only allowed to be called when FacetChart.chartDrawn fires.

Returns:
The top coordinate of the central chart area

getChartWidth

public float getChartWidth(boolean recalc)
Get the width of the central chart area, where data elements appear.

This is only allowed to be called when FacetChart.chartDrawn fires.

Parameters:
recalc - if false then cached value will be returned, otherwise will be recalculated.
Returns:
the width of the central chart area.

getDataColor

public String getDataColor(int index)
Get a color from the dataColors Array

Override to provide a dynamic color generation scheme.

Parameters:
index - index of the visual element to be colored
Returns:

getDrawnValue

public DrawnValue getDrawnValue(FacetValueMap facetValues)
Returns rendering information for the data value specified by the passed facet values.

If called before FacetChart.chartDrawn, logs a warning and returns null.

Parameters:
facetValues - facet values of desired data value
Returns:
the drawn value, or null for invalid arguments / incorrect timing of call

getGradations

public float[] getGradations()
Return an array of the gradation values used in the current chart. Pass these values to 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.

Returns:
an array of gradation values used in the current chart.

getNearestDrawnValue

public DrawnValue getNearestDrawnValue()
Returns rendering information for the data value that is shown nearest to the passed coordinates, as 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:

Bar / Column

Returns the centerpoint of the end of the nearest bar or column by considering the Y coordinate (bar) or X coordinate (column) only.

Line / Area

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.

Radar

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).

Pie

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).

Returns:
the nearest drawn value, or null for invalid arguments / incorrect timing of call

getNearestDrawnValue

public DrawnValue getNearestDrawnValue(Integer x,
                                       Integer y)
Returns rendering information for the data value that is shown nearest to the passed coordinates, as 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:

Bar / Column

Returns the centerpoint of the end of the nearest bar or column by considering the Y coordinate (bar) or X coordinate (column) only.

Line / Area

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.

Radar

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).

Pie

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).

Parameters:
x - X coordinate
y - Y coordinate
Returns:
the nearest drawn value, or null for invalid arguments / incorrect timing of call

getXCoord

public void getXCoord()
Returns the X coordination where the passed data value would be drawn. For example, this would be the X coordinate where a bar would end in a bar chart.

This is only allowed to be called when FacetChart.chartDrawn fires.


getYCoord

public float getYCoord(float value)
Returns the Y coordination where the passed data value would be drawn. For example, this would be the X coordinate that a line would pass through on a line chart, or the top of a column on a column chart.

This is only allowed to be called when FacetChart.chartDrawn fires.

Parameters:
value - the value to be drawn.
Returns:
the Y coordinate where the passed data value would be drawn.

setDefaultProperties

public static void setDefaultProperties(FacetChart facetChartProperties)
Class level method to set the default properties of this class. If set, then all subsequent instances of this class will automatically have the default properties that were set when this method was called. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

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.

Parameters:
facetChartProperties - properties that should be used as new defaults when instances of this class are created

setData

public void setData(Record[] records)
Dataset for this chart.

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.

Parameters:
data - data Default value is null

setData

public void setData(RecordList records)

getRecords

public Record[] getRecords()

getDataAsRecordList

public RecordList getDataAsRecordList()

setFacets

public void setFacets(Facet... facets)
Set the facets for this chart. These are exactly analgous to com.smartgwt.client.widgets.cube.CubeGrid#setFacets,CubetGrid facets except that:

Parameters:
facets -

setPointHoverCustomizer

public void setPointHoverCustomizer(ChartPointHoverCustomizer hoverCustomizer)
Display custom HTML when showDataPoints is true and the mouse hovers over a point.

Parameters:
hoverCustomizer -

setPointClickHandler

public void setPointClickHandler(ChartPointClickHandler handler)
Apply a handler to fire when showDataPoints is true, and the user clicks on a point.

Parameters:
handler -

setLogGradations

public void setLogGradations(Float... logGradations)
                      throws IllegalStateException
When 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 ]
 

Parameters:
logGradations - logGradations Default value is [ 1,2,4,6,8 ]
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getLogGradations

public 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.

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 ]
 

Returns:
float

setAxisValueFormatter

public void setAxisValueFormatter(ValueFormatter formatter)
Formatter to apply to values displayed in the gradation labels.

Parameters:
formatter - Formatter to apply to values displayed in the gradation labels

setDataValueFormatter

public void setDataValueFormatter(ValueFormatter formatter)
Formatter to apply to values displayed in the hover labels and other value labels

Parameters:
formatter - Formatter to apply to values displayed in the hover labels and other value labels

setLogicalStructure

public com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.chart.FacetChartLogicalStructure s)

getLogicalStructure

public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
Specified by:
getLogicalStructure in interface LogicalStructure
Overrides:
getLogicalStructure in class DrawPane