Class ChartUtils


  • public class ChartUtils
    extends Object
    Helper methods for charts.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • ChartUtils

        public ChartUtils()
    • Method Detail

      • addDiagonal

        public static void addDiagonal​(Datasets<XYDataset> dataset,
                                       double min,
                                       double max)
        Adds a diagonal to the dataset in the first position.
        Parameters:
        dataset - the dataset to add the diagonal to
        min - the minimum Y
        max - the maximum Y
      • hasDiagonal

        public static boolean hasDiagonal​(org.knowm.xchart.internal.chartpart.Chart chart)
        Checks the chart whether a diagonal series is present.
        Parameters:
        chart - the chart to check
        Returns:
        true if present
      • hasDiagonal

        public static boolean hasDiagonal​(Datasets<? extends Dataset> datasets)
        Checks the datasets whether a diagonal series is present.
        Parameters:
        datasets - the datasets to check
        Returns:
        true if present
      • isDiagonal

        public static boolean isDiagonal​(Dataset dataset)
        Checks the dataset whether it is the one for the diagonal.
        Parameters:
        dataset - the dataset to check
        Returns:
        true if present
      • isDiagonal

        public static boolean isDiagonal​(org.knowm.xchart.internal.series.Series series)
        Checks the series whether it is the one for the diagonal.
        Parameters:
        series - the series to check
        Returns:
        true if present
      • setMarkers

        public static void setMarkers​(org.knowm.xchart.internal.chartpart.Chart chart,
                                      AbstractMarkerGenerator generator)
        Sets the markers.
        Parameters:
        chart - the chart to update
        generator - the marker generator