Class LineChart

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

public final class LineChart extends Object implements ChartSpec

折線圖:每個系列一條折線與資料點,null 使線段中斷

Figure figure = LineChart.builder()
        .categories("1月", "2月", "3月", "4月")
        .series("台北", List.of(120d, 98d, 110d, 131d))
        .valueAxis(a -> a.title("萬元"))
        .toFigure(FigureFrame.of("monthly", Length.ofPoint(480), Length.ofPoint(260))
                .altText("各門市月營業額").caption("圖 1 各門市月營業額"));
Since:
4.0.0
  • Method Details

    • builder

      public static LineChart.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