Class CjScatterChart

java.lang.Object
com.oorian.html.Element<CjChart>

public class CjScatterChart extends CjChart
Scatter chart component for Chart.js.

Scatter charts display data as a collection of points, each having x and y coordinates. They are useful for showing the relationship between two variables and identifying correlations.

Basic Usage:


 CjScatterChart chart = new CjScatterChart()
     .addDataset(new CjDataset("Dataset")
         .addPoint(10, 20)
         .addPoint(15, 25)
         .addPoint(20, 30)
         .setBackgroundColor("rgb(255, 99, 132)"))
     .setTitle("Scatter Plot")
     .setXAxisTitle("X Values")
     .setYAxisTitle("Y Values");
 
See Also:
  • Constructor Details

    • CjScatterChart

      public CjScatterChart()
      Creates a new scatter chart.
  • Method Details

    • addScatterData

      public CjScatterChart addScatterData(String label, List<CjDataPoint> points)
      Convenience method to add a dataset with x/y data points.
      Parameters:
      label - The dataset label.
      points - The data points as {x, y} pairs.
      Returns:
      This chart for method chaining.