Class AbstractChartGenerator<C extends org.knowm.xchart.internal.chartpart.Chart,​D extends Dataset>

    • Field Detail

      • m_Title

        protected String m_Title
        the title of the chart.
      • m_Legend

        protected boolean m_Legend
        whether to show the legend.
      • m_LegendPosition

        protected org.knowm.xchart.style.Styler.LegendPosition m_LegendPosition
        the position of the legend.
    • Constructor Detail

      • AbstractChartGenerator

        public AbstractChartGenerator()
    • Method Detail

      • setTitle

        public void setTitle​(String value)
        Sets the title for the plot.
        Parameters:
        value - the title
      • getTitle

        public String getTitle()
        Returns the title for the plot.
        Returns:
        the title
      • titleTipText

        public String titleTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setLegend

        public void setLegend​(boolean value)
        Sets whether the legend is displayed..
        Parameters:
        value - true if displayed
      • getLegend

        public boolean getLegend()
        Returns whether the legend is displayed.
        Returns:
        true if displayed
      • legendTipText

        public String legendTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setLegendPosition

        public void setLegendPosition​(org.knowm.xchart.style.Styler.LegendPosition value)
        Sets the position for the legend.
        Parameters:
        value - the position
      • getLegendPosition

        public org.knowm.xchart.style.Styler.LegendPosition getLegendPosition()
        Returns the position for the legend.
        Returns:
        the position
      • legendPositionTipText

        public String legendPositionTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the object, which can be displayed in the GUI.
        Specified by:
        getQuickInfo in interface QuickInfoSupporter
        Returns:
        null if no info available, otherwise short string
      • check

        protected String check​(List<D> data)
        Hook method for checks before generating the chart.
        Parameters:
        data - the data to use
        Returns:
        null if checks passed, otherwise error message
      • buildChart

        protected abstract C buildChart()
        Builds the chart.
        Returns:
        the chart
      • styleChart

        protected abstract void styleChart​(C chart,
                                           Datasets<D> data)
        Applies styling to the chart.
        Parameters:
        data - the data to will be added
        chart - the chart to style
      • addData

        protected abstract void addData​(C chart,
                                        Datasets<D> data)
        Adds the data to the chart.
        Parameters:
        chart - the chart to add the data to
        data - the data to add
      • postGenerate

        protected void postGenerate​(C chart,
                                    Datasets<D> data)
        Hook method for after the chart has been generated.
        Default implementation does nothing.
        Parameters:
        chart - the chart to add the data to
        data - the data to add
      • doGenerate

        protected C doGenerate​(Datasets<D> data)
        Performs the actual generation of the chart.
        Parameters:
        data - the data to use
        Returns:
        the chart
      • generate

        public C generate​(Datasets<D> data)
        Generates the chart.
        Parameters:
        data - the data to use
        Returns:
        the chart