Class WAbstractChartModel

    • Constructor Detail

      • WAbstractChartModel

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

      • 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 java.util.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.

      • 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:
        WDataSeries.setMarker(MarkerType marker)
      • 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:
        WDataSeries.setPen(WPen pen)
      • getMarkerScaleFactor

        public java.lang.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()
      • getRowCount

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

        See Also:
        getColumnCount()
      • 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.