Class BarChart

java.lang.Object
io.leandev.appfuse.report.chart.BarChart
All Implemented Interfaces:
ChartSpec

public final class BarChart extends Object implements ChartSpec

並排長條圖:同一類別內的系列並排,負值往下長

Figure figure = BarChart.builder()
        .categories("Q1", "Q2", "Q3", "Q4")
        .series("台北", List.of(120d, 98d, 110d, 131d))
        .valueAxis(a -> a.title("萬元"))
        .toFigure(FigureFrame.of("quarterly", Length.ofPoint(480), Length.ofPoint(260))
                .altText("各門市季度營業額").caption("圖 1 各門市季度營業額"));
Since:
4.0.0
  • Method Details

    • builder

      public static BarChart.Builder builder()
    • toFigure

      public Figure toFigure(FigureFrame frame)
      Description copied from interface: ChartSpec
      產生含 SVG 的 Figure;圖表以 Figure 的寬高為座標系(1 單位 = 1pt)
      Specified by:
      toFigure in interface ChartSpec
      Parameters:
      frame - Figure 的識別、尺寸、替代文字與圖說
      Returns:
      Figure