Skip to content

Commit

Permalink
update: refine the chart options individually
Browse files Browse the repository at this point in the history
The chart options sub items should not assume their the same
So are the series options, but there is put together as generic for now, TBD
  • Loading branch information
Koooooo-7 committed Jul 7, 2024
1 parent f214bf5 commit 773b45a
Show file tree
Hide file tree
Showing 14 changed files with 404 additions and 195 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.github.koooooo7.echarts4j.option.chart;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.github.koooooo7.echarts4j.option.embedded.chart.AxisLine;
import com.github.koooooo7.echarts4j.option.embedded.chart.SplitArea;
import com.github.koooooo7.echarts4j.option.embedded.chart.SplitLine;
import com.github.koooooo7.echarts4j.option.embedded.series.AxisPointer;
import com.github.koooooo7.echarts4j.option.embedded.series.ItemStyle;
import com.github.koooooo7.echarts4j.type.FuncStr;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.SuperBuilder;

Expand Down Expand Up @@ -38,4 +36,103 @@ public class AngleAxis {
private SplitArea splitArea;
private AxisPointer axisPointer;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class AxisLine {
private Boolean show;
private Boolean onZero;
private Integer onZeroAxisIndex;
private String symbol;
private FuncStr symbolSize;
private FuncStr symbolOffset;
private LineStyle lineStyle;


@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class LineStyle {
private String color;
private Integer width;
private FuncStr type;
}
}

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class SplitLine {
private Boolean show;
private String interval;
private LineStyle lineStyle;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class LineStyle {
private String color;
private Integer width;
private FuncStr type;
}
}

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class SplitArea {
private Boolean show;
private String interval;
private AreaStyle areaStyle;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class AreaStyle {
private String[] color;
}
}

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class AxisPointer {
private String type;
private String axis;
private Boolean snap;
private Integer z;
private Label label;
private LineStyle lineStyle;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class Label {
private Boolean show;
private FuncStr position;
private Integer distance;
private FuncStr rotate;
private List<Integer> offset;
private Integer minMargin;
private FuncStr formatter;
private Integer fontSize;
private ItemStyle itemStyle;
private LineStyle lineStyle;

}

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class LineStyle {
private String color;
private Integer width;
private FuncStr type;
}


}



}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;

import java.util.List;

public class DataZoom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.koooooo7.echarts4j.option.embedded.chart.AxisLine;
import com.github.koooooo7.echarts4j.option.embedded.chart.SplitArea;
import com.github.koooooo7.echarts4j.option.embedded.chart.SplitLine;
import com.github.koooooo7.echarts4j.option.embedded.series.AxisPointer;
import com.github.koooooo7.echarts4j.type.FuncStr;
import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package com.github.koooooo7.echarts4j.option.chart;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.github.koooooo7.echarts4j.option.embedded.chart.AxisLine;
import com.github.koooooo7.echarts4j.option.embedded.chart.SplitArea;
import com.github.koooooo7.echarts4j.option.embedded.chart.SplitLine;
import com.github.koooooo7.echarts4j.option.embedded.series.AxisPointer;
import com.github.koooooo7.echarts4j.option.embedded.series.NameTextStyle;
import com.github.koooooo7.echarts4j.option.embedded.series.NameTruncate;
import com.github.koooooo7.echarts4j.option.embedded.series.ItemStyle;
import com.github.koooooo7.echarts4j.type.FuncStr;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.SuperBuilder;

Expand Down Expand Up @@ -41,4 +37,114 @@ public class RadiusAxis {
private SplitLine splitLine;
private SplitArea splitArea;
private AxisPointer axisPointer;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class NameTextStyle {
}

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class NameTruncate {
}

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class AxisLine {
private Boolean show;
private Boolean onZero;
private Integer onZeroAxisIndex;
private String symbol;
private FuncStr symbolSize;
private FuncStr symbolOffset;
private AngleAxis.AxisLine.LineStyle lineStyle;


@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class LineStyle {
private String color;
private Integer width;
private FuncStr type;
}
}

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class SplitLine {
private Boolean show;
private String interval;
private AngleAxis.SplitLine.LineStyle lineStyle;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class LineStyle {
private String color;
private Integer width;
private FuncStr type;
}
}

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class SplitArea {
private Boolean show;
private String interval;
private AngleAxis.SplitArea.AreaStyle areaStyle;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class AreaStyle {
private String[] color;
}
}

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class AxisPointer {
private String type;
private String axis;
private Boolean snap;
private Integer z;
private Label label;
private LineStyle lineStyle;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class Label {
private Boolean show;
private FuncStr position;
private Integer distance;
private FuncStr rotate;
private List<Integer> offset;
private Integer minMargin;
private FuncStr formatter;
private Integer fontSize;
private ItemStyle itemStyle;
private LineStyle lineStyle;

}

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class LineStyle {
private String color;
private Integer width;
private FuncStr type;
}

}


}
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.github.koooooo7.echarts4j.option.chart;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.github.koooooo7.echarts4j.option.embedded.chart.AxisPointer;
import com.github.koooooo7.echarts4j.option.embedded.series.ItemStyle;
import com.github.koooooo7.echarts4j.type.FuncStr;
import com.github.koooooo7.echarts4j.util.annotation.EmbedScope;
import lombok.Builder;
import lombok.Data;

import java.util.List;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand All @@ -25,4 +28,45 @@ public class Tooltip {
private Integer padding;
private AxisPointer axisPointer;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@EmbedScope(EmbedScope.Scope.Chart)
public static class AxisPointer {
private String type;
private String axis;
private Boolean snap;
private Integer z;
private Label label;
private LineStyle lineStyle;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class Label {
private Boolean show;
private FuncStr position;
private Integer distance;
private FuncStr rotate;
private List<Integer> offset;
private Integer minMargin;
private FuncStr formatter;
private Integer fontSize;
private ItemStyle itemStyle;
private LineStyle lineStyle;

}

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class LineStyle {
private String color;
private Integer width;
private FuncStr type;
}


}

}
Loading

0 comments on commit 773b45a

Please sign in to comment.