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.chart.FacetChart
All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, IsWidget, 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 Canvas

HTML5-based charting engine, implementing most chartTypes of the Chart interface.

Can be used directly, or specified as chartConstructor or chartConstructor.

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");
  
"Inlined facet" is another method to provide data to the chart. data is a single CellRecord or Array of CellRecords where each record contains multiple data values. In this case, 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. 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");
  

In order to use this component, you must load the Drawing module (ISC_Drawing.js) before loading the Charts module (ISC_Charts.js).


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, scClassName
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
FacetChart()
           
FacetChart(JavaScriptObject jsObj)
           
 
Method Summary
protected  JavaScriptObject create()
           
 Boolean getAutoRotateLabels()
          Whether to automatically rotate labels if needed in order to make them legible and non-overlapping.
 int getBarMargin()
          Distance between bars.
 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.
 ChartType getChartType()
          See ChartType for a list of known types - Column, Bar, Line, Pie, Doughnut, Area, and Radar charts are supported.
 float getClusterMarginRatio()
          For clustered charts, ratio between margins between individual bars and margins between clusters.
 RecordList getDataAsRecordList()
           
 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.
 int getDataMargin()
          For rectangular charts (bar, column, line), margin around the inside of the chartRect, so that data elements are not flush to edge.
 int getDataPointSize()
          Size in pixels for data points drawn for line, area, radar and other chart types.
 int getDecimalPrecision()
          Default precision used when formatting float numbers for axis labels
 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.
 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.
 int getLegendItemPadding()
          Padding between each swatch and label pair.
 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.
 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.
 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.
static FacetChart getOrCreateRef(JavaScriptObject jsObj)
           
 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.
 int getRadialLabelOffset()
          Distance in pixels that radial labels are offset from the outside of the circle.
 Record[] getRecords()
           
 Boolean getShowChartRect()
          Whether to show a rectangular shape around the area of the chart where data is plotted.
 Boolean getShowDataPoints()
          For line charts, whether to show data points for each individual data value.
 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.
 Boolean getShowShadows()
          Whether to automatically show shadows for various charts.
 String getShowTitle()
          Whether to show a title.
 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.
 String getTitle()
          Title for the chart as a whole.
 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.
 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.
 void setAutoRotateLabels(Boolean autoRotateLabels)
          Whether to automatically rotate labels if needed in order to make them legible and non-overlapping.
 void setBarMargin(int barMargin)
          Distance between bars.
 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 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 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 setDataMargin(int dataMargin)
          For rectangular charts (bar, column, line), margin around the inside of the chartRect, so that data elements are not flush to edge.
 void setDataPointSize(int dataPointSize)
          Size in pixels for data points drawn for line, area, radar and other chart types.
 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 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 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 setLegendItemPadding(int legendItemPadding)
          Padding between each swatch and label pair.
 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 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.
 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 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 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 setRadialLabelOffset(int radialLabelOffset)
          Distance in pixels that radial labels are offset from the outside of the circle.
 void setShowChartRect(Boolean showChartRect)
          Whether to show a rectangular shape around the area of the chart where data is plotted.
 void setShowDataPoints(Boolean showDataPoints)
          For line charts, whether to show data points for each individual data value.
 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 setShowShadows(Boolean showShadows)
          Whether to automatically show shadows for various charts.
 void setShowTitle(String showTitle)
          Whether to show a title.
 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 setTitle(String title)
          Title for the chart as a whole.
 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 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.
 
Methods inherited from class com.smartgwt.client.widgets.Canvas
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, disable, enable, focus, getAbsoluteLeft, getAbsoluteTop, getAccessKey, getAnimateAcceleration, getAnimateFadeTime, getAnimateHideAcceleration, getAnimateHideTime, getAnimateMoveAcceleration, getAnimateMoveTime, getAnimateRectAcceleration, getAnimateRectTime, getAnimateResizeAcceleration, getAnimateResizeTime, getAnimateScrollAcceleration, getAnimateScrollTime, getAnimateShowAcceleration, getAnimateShowEffect, getAnimateShowTime, getAnimateTime, getAppImgDir, getAriaRole, getAutoDraw, getAutoShowParent, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorder, getBottom, getById, getCanAcceptDrop, getCanDrag, getCanDragReposition, getCanDragResize, getCanDragScroll, getCanDrop, getCanDropBefore, getCanFocus, getCanHover, getCanSelectText, getCanvasItem, getChildren, getChildrenSnapResizeToGrid, getChildrenSnapToGrid, getContents, getContextMenu, getCursor, getDataPath, getDefaultHeight, getDefaultWidth, getDestroyed, getDestroying, getDisabled, getDisabledCursor, getDoubleClickDelay, getDragAppearance, getDragIntersectStyle, getDragOpacity, getDragRepositionAppearance, getDragRepositionCursor, getDragResizeAppearance, getDragScrollDelay, getDragStartDistance, getDragTarget, getDragType, getDynamicContents, getEdgeBackgroundColor, getEdgeCenterBackgroundColor, getEdgeImage, getEdgeMarginSize, getEdgeOffset, getEdgeOpacity, getEdgeShowCenter, getEdgeSize, 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, getLeft, getLeftAsString, getLocateChildrenBy, getLocateChildrenType, getLocatePeersBy, getLocatePeersType, getMargin, getMatchElement, getMaxHeight, getMaxWidth, getMenuConstructor, getMinHeight, getMinWidth, getMouseStillDownDelay, getMouseStillDownInitialDelay, getNextZIndex, getNoDoubleClicks, getOffsetHeight, getOffsetWidth, getOffsetX, getOffsetY, getOpacity, getOverflow, getPadding, getPageBottom, getPageLeft, getPageRect, getPageRight, getPageTop, getParentElement, getPercentBox, getPosition, getPrefix, getPrintHTML, getPrintHTML, getPrompt, getRect, getRedrawOnResize, getResizeBarTarget, 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, 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, onInit, parentResized, printComponents, redraw, redraw, removeChild, removeChild, 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, setCanDrag, 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, setLayoutAlign, setLayoutAlign, setLeft, setLeft, setLocateChildrenBy, setLocateChildrenType, setLocatePeersBy, setLocatePeersType, setMargin, setMatchElement, setMaxHeight, setMaxWidth, setMenuConstructor, setMinHeight, setMinWidth, setMouseStillDownDelay, setMouseStillDownInitialDelay, setNeverUseFilters, setNoDoubleClicks, setOpacity, setOverflow, setPadding, setPageLeft, setPageTop, setParentElement, setPercentBox, setPosition, setPrefix, setPrompt, setRect, setRect, setRedrawOnResize, setResizeBarTarget, 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, 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, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getConfig, getDOM, getElement, getElement, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, getScClassName, hashCode, 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, 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, onAttach, onBrowserEvent, onDetach, 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, 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)

create

protected JavaScriptObject create()
Overrides:
create in class Canvas

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

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

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

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

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 - dataColors 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:
String

setDataMargin

public void setDataMargin(int dataMargin)
                   throws IllegalStateException
For rectangular charts (bar, column, line), margin around the inside of the chartRect, 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 chartRect, so that data elements are not flush to edge.

Returns:
int

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 6
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

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

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 true
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

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: Nethod 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

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

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

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

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

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

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

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

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

setShowShadows

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

Parameters:
showShadows - showShadows Default value is false
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(String showTitle)
Whether to show a title.

Parameters:
showTitle - showTitle Default value is true

getShowTitle

public String getShowTitle()
Whether to show a title.

Returns:
String

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 - styleName 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:
String
See Also:
Appearance overview and related methods, CSS styles Example

setTitle

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

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

getTitle

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

Overrides:
getTitle in class Canvas
Returns:
String

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

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 - valueProperty 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:
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 - valueTitle 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:
String

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:

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