Different types of charts
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.example.components;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class AxisChart extends ApexChart {
|
||||
|
||||
protected AxisChart(String chartType) {
|
||||
super(chartType);
|
||||
}
|
||||
|
||||
public void setData(String seriesName, List<Double> values, List<String> categories) {
|
||||
Map<String, Object> options = Map.of(
|
||||
"chart", Map.of("type", getChartType(), "height", "100%"),
|
||||
"series", List.of(Map.of("name", seriesName, "data", values)),
|
||||
"xaxis", Map.of("categories", categories)
|
||||
);
|
||||
|
||||
sendOptions(options);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user