Class Chart

java.lang.Object
io.keikai.axyra.sheets.content.Chart

public final class Chart extends Object
A chart (immutable). Specify the chart type, an optional title, a two-cell anchor rectangle, and one or more data series (each a range reference like "Sheet1!$B$2:$B$10"). Add with Sheet.addChart(...).

Types: column, bar, line, pie, area, scatter, doughnut, radar, bubble, surface, stock, combo, waterfall, histogram, funnel, treemap, sunburst, boxWhisker, pareto, map. Appearance the builder can set: legend placement and visibility, axis visibility/titles/scale, per-series and per-point fill colors, data labels, and the Excel auto-title. Deep chart-theme parts (colors1.xml / style1.xml) are not modeled.

  • Method Details

    • column

      public static Chart.Builder column()
    • bar

      public static Chart.Builder bar()
    • line

      public static Chart.Builder line()
    • pie

      public static Chart.Builder pie()
    • area

      public static Chart.Builder area()
    • scatter

      public static Chart.Builder scatter()
    • doughnut

      public static Chart.Builder doughnut()
    • radar

      public static Chart.Builder radar()
    • bubble

      public static Chart.Builder bubble()
    • combo

      public static Chart.Builder combo()
    • surface

      public static Chart.Builder surface()
      A surface chart. The default form is the top-down (contour) view; call threeD(true) for the 3-D surface.
    • stock

      public static Chart.Builder stock()
      A stock chart (high-low-close). Add three series in high, low, close order — or four (open-high-low-close) — as Excel requires 3-4 series for this type.
    • waterfall

      public static Chart.Builder waterfall()
      A waterfall (bridge) chart: running total with positive/negative steps.
    • histogram

      public static Chart.Builder histogram()
      A histogram chart: values bucketed into frequency bins.
    • funnel

      public static Chart.Builder funnel()
      A funnel chart: values as progressively narrowing stages.
    • treemap

      public static Chart.Builder treemap()
      A treemap chart: hierarchical proportions as nested rectangles.
    • sunburst

      public static Chart.Builder sunburst()
      A sunburst chart: hierarchical proportions as concentric rings.
    • boxWhisker

      public static Chart.Builder boxWhisker()
      A box & whisker chart: distribution quartiles with outlier whiskers.
    • pareto

      public static Chart.Builder pareto()
      A pareto chart: sorted histogram with a cumulative-percentage line.
    • map

      public static Chart.Builder map()
      A filled-region map chart: geographic regions colored by value. The category range holds region names; region geometry is resolved by the spreadsheet application when the file is opened.
    • of

      public static Chart.Builder of(String type)
      A chart of any supported type token: column, bar, line, pie, area, scatter, doughnut, radar, bubble, surface, stock, combo, waterfall, histogram, funnel, treemap, sunburst, boxWhisker, pareto, map.
    • toBuilder

      public Chart.Builder toBuilder()
      A builder pre-loaded with this chart spec, for read–modify–write round-trips.
    • toJson

      public String toJson()
    • fromJson

      public static Chart fromJson(String json)
    • type

      public String type()
    • title

      public String title()
    • titleAuto

      public boolean titleAuto()
      Whether this chart carries an Excel "auto" title (derived from the series name).
    • titleFormula

      public String titleFormula()
      The cell reference the title follows (<c:strRef><c:f>), or null for a literal or absent title.
    • style

      public int style()
      The chart's built-in style number (<c:style val>), or -1 when the chart carries none — which is what a chart built here does.
    • barShape

      public String barShape()
      The solid a 3-D bar or column is drawn as; "box" when the chart declares no shape, that being the attribute's default.
    • seriesBubbleSizes

      public String seriesBubbleSizes(int seriesIndex)
      The bubble-size (Z) reference of series seriesIndex, or null when it has none.
    • seriesCount

      public int seriesCount()
    • legendPosition

      public LegendPosition legendPosition()
      Legend placement (defaults to RIGHT when unset).
    • showDataLabels

      public boolean showDataLabels()
      Whether data labels are shown.
    • is3d

      public boolean is3d()
      Whether the chart renders in 3-D.
    • categoryAxisTitle

      public String categoryAxisTitle()
      The category (X) axis title, or null.
    • valueAxisTitle

      public String valueAxisTitle()
      The value (Y) axis title, or null.
    • pivotSource

      public String pivotSource()
      The PivotChart binding this chart is driven by, in Excel's [WorkbookName]SheetName!PivotName form (ECMA-376 §21.2.2.153), or null for a regular chart. Set by Sheet.addPivotChart(int, java.lang.String, int, int, int, int) and preserved from imported files.