Class WAbstractChartModel

java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.chart.WAbstractChartModel
Direct Known Subclasses:
WStandardChartProxyModel

public abstract class WAbstractChartModel extends WObject
An abstract model for use with JWt's charts.

This abstract model is used by WAbstractChart as data model.

  • Constructor Details

    • WAbstractChartModel

      public WAbstractChartModel()
      Creates a new chart model.
  • Method Details

    • getData

      public abstract double getData(int row, int column)
      Returns data at a given row and column.

      This value determines the position of a data point on the chart.

    • getDisplayData

      public WString getDisplayData(int row, int column)
      Returns display data at a given row and column.

      This value should be a textual representation of the value returned by getData(). This defaults to the string representation of the double returned by getData().

    • getHeaderData

      public WString getHeaderData(int column)
      Returns the given column's header data.

      This is used as the name in the legend for a data series.

      Defaults to an empty string.

    • getToolTip

      public WString getToolTip(int row, int column)
      Returns the tooltip text to use on a given row and column.

      Defaults to an empty string, signifying that no tooltip should be shown.

    • flags

      public EnumSet<ItemFlag> flags(int row, int column)
      Returns the item flags for the given row and column.

      Only the ItemIsXHTMLText and ItemHasDeferredTooltip flags are supported for charts.

      ItemIsXHTMLText determines whether the tooltip text should be rendered as XHTML or as plain text, and ItemHasDeferredTooltip makes it so that tooltips are only loaded on demand.

      Note: An XHTML text tooltip will be forced to be deferred. Non-deferred XHTML tooltips are not supported.

      Note: When not using deferred tooltips, the HTML <area> tag will be used. If there are many tooltips and the chart is interactive this may cause client-side performance issues. If deferred tooltips are used, this will cause some load on the server, as it calculates server-side what marker or bar the user is hovering over.

      Note: If the chart is interactive, and tooltips are not deferred, they will be scaled according to the first Y axis, and thus multiple Y axes will not be supported in combination with plain tooltips.

    • link

      public WLink link(int row, int column)
      Returns the link for a given row and column.

      Defaults to an empty link, signifying that no link should be shown.

    • getMarkerPenColor

      public WColor getMarkerPenColor(int row, int column)
      Returns the marker pen color to use for a given row and column.

      This is used as the color of the outline of markers when drawing a SeriesType.Point. The default is null, indicating that the default color, as determined by WDataSeries.getMarkerPen(), should be used.

      See Also:
    • getMarkerBrushColor

      public WColor getMarkerBrushColor(int row, int column)
      Returns the marker brush color to use for a given row and column.

      This is used as the color of the brush used when drawing a SeriesType.Point. The default is null, indicating that the default color, as determined by WDataSeries.getMarkerBrush(), should be used.

      See Also:
    • markerType

      public MarkerType markerType(int row, int column)
      Returns the marker type to use for a given row and column.

      This is used as the shape of the marker used when drawing a PointSeries. The default is null, indicating that the default marker, as determined by WDataSeries.getMarker(), should be used.

      See Also:
    • getBarPenColor

      public WColor getBarPenColor(int row, int column)
      Returns the bar pen color to use for a given row and column.

      This is used as the color of the outline of bars when drawing a SeriesType.Bar. The default is null, indicating that the default color, as determined by WDataSeries.getPen(), should be used.

      See Also:
    • getBarBrushColor

      public WColor getBarBrushColor(int row, int column)
      Returns the bar brush color to use for a given row and column.

      This is used as the color of the brush used when drawing a SeriesType.Bar. The default is null, indicating that the default color, as determined by WDataSeries.getBrush(), should be used.

      See Also:
    • getMarkerScaleFactor

      public Double getMarkerScaleFactor(int row, int column)
      Returns the marker scale factor to use for a given row and column.

      This is used to scale the size of the marker when drawing a SeriesType.Point. The default is null, indicating that the default scale should be used.

    • getColumnCount

      public abstract int getColumnCount()
      Returns the number of columns.

      See Also:
    • getRowCount

      public abstract int getRowCount()
      Returns the number of rows.

      See Also:
    • changed

      public Signal changed()
      A signal that notifies of any change to the model.

      Implementations should trigger this signal in order to update the chart.