Documentation of 'umontreal.iro.lecuyer.charts.MultipleDatasetChart' Java class
MultipleDatasetChart
umontreal.iro.lecuyer.charts

Class MultipleDatasetChart



  • public class MultipleDatasetChart
    extends java.lang.Object
    Provides tools to plot many datasets on the same chart. This class is mainly used to draw plots with different styles. Class XYChart and its subclasses are to be preferred to draw simple charts with one style. Datasets are stored in an ArrayList. The first dataset is called as the primary dataset.
    • Constructor Summary

      Constructors 
      Constructor and Description
      MultipleDatasetChart()
      Initializes a new MultipleDatasetChart.
      MultipleDatasetChart(java.lang.String title, java.lang.String XLabel, java.lang.String YLabel)
      Initializes a new MultipleDatasetChart instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int add(SSJXYSeriesCollection dataset)
      Adds a new dataset to the chart at the end of the list and returns its position.
      void disableGrid()
      Disables the background grid.
      void enableGrid(double xstep, double ystep)
      Puts grid on the background.
      SSJXYSeriesCollection get()
      Gets the primary dataset.
      SSJXYSeriesCollection get(int datasetNum)
      Gets the element at the specified position in the dataset list.
      JFreeChart getJFreeChart()
      Returns the JFreeChart variable associated with this chart.
      java.util.ArrayList<SSJXYSeriesCollection> getList()
      Returns the dataset list.
      java.lang.String getTitle()
      Gets the current chart title.
      Axis getXAxis()
      Returns the chart's domain axis (x-axis) object.
      Axis getYAxis()
      Returns the chart's range axis (y-axis) object.
      void set(int datasetNum, SSJXYSeriesCollection dataset)
      Replaces the element at the specified position in the dataset list with the specified element.
      void set(SSJXYSeriesCollection dataset)
      Sets the primary dataset for the plot, replacing the existing dataset if there is one.
      void setAutoRange()
      Sets chart range to automatic values.
      void setLatexDocFlag(boolean flag)
      Same as in XYChart.
      void setManualRange(double[] axisRange)
      Sets new x-axis and y-axis bounds, with format: axisRange = [xmin, xmax, ymin, ymax].
      void setTitle(java.lang.String title)
      Sets a title to the chart.
      java.lang.String toLatex(double width, double height)
      Same as in XYChart.
      javax.swing.JFrame view(int width, int height)
      Displays chart on the screen using Swing.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultipleDatasetChart

        public MultipleDatasetChart()
        Initializes a new MultipleDatasetChart.
      • MultipleDatasetChart

        public MultipleDatasetChart(java.lang.String title,
                                    java.lang.String XLabel,
                                    java.lang.String YLabel)
        Initializes a new MultipleDatasetChart instance. title sets a title, XLabel is a short description of the x-axis, and YLabel is a short description of the y-axis.
        Parameters:
        title - chart title.
        XLabel - Label on x-axis.
        YLabel - Label on y-axis.
    • Method Detail

      • getJFreeChart

        public JFreeChart getJFreeChart()
        Returns the JFreeChart variable associated with this chart.
        Returns:
        the associated JFreeChart variable.
      • getXAxis

        public Axis getXAxis()
        Returns the chart's domain axis (x-axis) object.
        Returns:
        chart's domain axis (x-axis) object.
      • getYAxis

        public Axis getYAxis()
        Returns the chart's range axis (y-axis) object.
        Returns:
        chart's range axis (y-axis) object.
      • getTitle

        public java.lang.String getTitle()
        Gets the current chart title.
        Returns:
        Chart title.
      • setTitle

        public void setTitle(java.lang.String title)
        Sets a title to the chart. This title will appear on the chart displayed by method view.
        Parameters:
        title - chart title.
      • setAutoRange

        public void setAutoRange()
        Sets chart range to automatic values.
      • setManualRange

        public void setManualRange(double[] axisRange)
        Sets new x-axis and y-axis bounds, with format: axisRange = [xmin, xmax, ymin, ymax].
        Parameters:
        axisRange - new axis ranges.
      • add

        public int add(SSJXYSeriesCollection dataset)
        Adds a new dataset to the chart at the end of the list and returns its position.
        Parameters:
        dataset - dataset to add.
        Returns:
        the dataset position in the list.
      • set

        public void set(SSJXYSeriesCollection dataset)
        Sets the primary dataset for the plot, replacing the existing dataset if there is one.
        Parameters:
        dataset - the new primary dataset.
      • get

        public SSJXYSeriesCollection get(int datasetNum)
        Gets the element at the specified position in the dataset list.
        Parameters:
        datasetNum - position in the dataset list.
        Returns:
        dataset.
      • set

        public void set(int datasetNum,
                        SSJXYSeriesCollection dataset)
        Replaces the element at the specified position in the dataset list with the specified element.
        Parameters:
        datasetNum - position in the dataset list.
        dataset - dataset list.
      • getList

        public java.util.ArrayList<SSJXYSeriesCollection> getList()
        Returns the dataset list.
        Returns:
        dataset list.
      • view

        public javax.swing.JFrame view(int width,
                                       int height)
        Displays chart on the screen using Swing. This method creates an application containing a chart panel displaying the chart. The created frame is positioned on-screen, and displayed before it is returned. The width and the height of the chart are measured in pixels.
        Parameters:
        width - frame width in pixels.
        height - frame height in pixels.
      • enableGrid

        public void enableGrid(double xstep,
                               double ystep)
        Puts grid on the background. It is important to note that the grid is always placed in such a way that it contains the axes. Thus, the grid does not always have an intersection at the corner points; this occurs only if the corner points are multiples of the stepping. xstep and ystep sets the stepping in each direction.
        Parameters:
        xstep - sets the stepping in the x-direction.
        ystep - sets the stepping in the y-direction.
      • disableGrid

        public void disableGrid()
        Disables the background grid.
      • toLatex

        public java.lang.String toLatex(double width,
                                        double height)
        Same as in XYChart.
        Parameters:
        width - Chart's width in centimeters.
        height - Chart's height in centimeters.
      • setLatexDocFlag

        public void setLatexDocFlag(boolean flag)
        Same as in XYChart.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.