Class ChartView
Sheet.chart(int) for a
chart on a worksheet, or with Workbook.chartSheetChart(int) for the
chart of a chart-sheet tab. Getters mirror the fields of the
Chart builder.
Getters read a snapshot taken when the view was created or last
refreshed. Changes made elsewhere, for example through another
ChartView or Sheet.replaceChart(int, io.keikai.axyra.sheets.content.Chart), are not seen until
reload(). Each setter sends the whole snapshot to the engine at
once and then reloads. When a setter throws AxyraException, the
rejected value stays in the snapshot; call reload() before the
next setter.
The view addresses the chart by index. After a chart with a lower index is removed, this view addresses a different chart.
A setter marks the host dirty: the sheet's drawing layer, or the chart
sheet. An imported chart is then regenerated from the model on the next
save, so the edit appears in the file. Trendline and error-bar edits are
drawn by Sheet.renderChartToPng(int, int, int) and saved to the workbook. The anchor
accessors have no effect for a chart-sheet chart, which always fills the
page.
Methods that take a seriesIndex use a 0-based index and throw
AxyraException when it is outside [0, seriesCount()).
ChartView chart = sheet.chart(0);
chart.setTitle("Sales 2026").setLegend(LegendPosition.BOTTOM);
-
Method Summary
Modifier and TypeMethodDescriptionaddTrendline(int seriesIndex, Trendline trendline) Adds a trendline to a series, after any it already has.int[]anchor()The two-cell anchor as{fromRow, fromColumn, toRow, toColumn}, all 0-based.int[]{fromColOff, fromRowOff, toColOff, toRowOff}— the sub-cell EMU offsets of the two-cell anchor's corners (914400 EMU = 1 inch).barShape()The solid a 3-D bar or column draws its bars as (<c:shape>, ECMA-376 Part 1 §21.2.2.177):"box","cone","coneToMax","cylinder","pyramid"or"pyramidToMax".The category (X) axis title, ornullwhen the axis has none or the chart has no category axis.booleanWhether the category (X) axis is drawn.The chart-area fill color, ornullwhen none is set and the default white applies.The chart-area border color, ornullwhen none is set.booleanWhether the chart-area background is explicitly TRANSPARENT (<a:noFill/>, ECMA-376 §20.1.8.44) — the sheet shows through.booleanWhether the chart area is set to have no border.clearTrendlines(int seriesIndex) Removes every trendline from a series.errorBars(int seriesIndex) The error bars of a series, ornullwhen it has none.Base64 of the sourcexl/charts/chartEx*.xmlpart for an extended chart, ornullfor a classic chart.Base64 of the extended chart'schartColorStylepart, ornull.Base64 of the extended chart'schartStylepart, ornull.intgapWidth()The gap between bar or column clusters, as a percentage of one bar's width (0–500).grouping()Bar/column/area/line grouping:"clustered"/"stacked"/"percentStacked"/"standard"(Excel default"clustered").intholeSize()The doughnut hole size, as a percentage of the outer radius.intindex()This chart's 0-based index on its sheet, or the chart-sheet index for a chart-sheet chart.booleanis3d()Whether the chart is drawn in 3-D; seeview3D()for its angles.booleanWhether this is a modern extended chart — the ISO/IEC 29500 Transitionalcx:chart-extension schema (waterfall, funnel, histogram, treemap, sunburst, box & whisker, region map).booleanisOfPie()Whether this chart is a pie-of-pie or bar-of-pie (<c:ofPieChart>).double[]The manual legend layout as[x, y, w, h]chart-relative fractions, ornullwhen the legend is placed automatically.Where the legend is placed;LegendPosition.NONEwhen the legend is marked deleted.booleanWhether the legend is shown at all (independent of its position).int[]The zero-based point indices acustsplit puts in the second plot (<c:custSplit>); empty for every other rule.booleanWhether an of-pie chart draws its second plot as a stacked bar (<c:ofPieType val="bar"/>) rather than as a second pie.The second plot's size as a percentage of the first (<c:secondPieSize>), ornullwhen absent.The count or threshold the split rule compares against (<c:splitPos>), ornullwhen absent.The of-pie split rule as the format's own token —auto,cust,percent,posorval— ornullwhen the chart carries no<c:splitType>.intoverlap()How much bars in one cluster overlap, as a percentage from -100 (a full bar-width gap) to 100 (full overlap).The plot-area fill color, ornullwhen none is set.double[]The manual plot-area layout (ECMA-376 §21.2.2.88manualLayout) as[x, y, w, h]in chart-relative fractions, ornullwhen the plot area is laid out automatically.The plot-area border color, ornullwhen none is set.booleanWhether the plot-area background is explicitly transparent (mirrorschartAreaNoFill()).booleanWhether the plot area is set to have no border.voidreload()Re-reads the chart from the engine and replaces this view's snapshot.seriesBubbleSizes(int seriesIndex) The series' bubble-size (Z) range reference (<c:bubbleSize>), ornullon anything but a bubble chart that declares one.seriesCategories(int seriesIndex) The series categories range reference, ornullwhen the series has none.intThe number of series in the chart; series indices run from 0 toseriesCount() - 1.seriesDataLabels(int seriesIndex) The series-level data labels (<c:dLbls>), ornullwhen the series carries none.seriesFill(int seriesIndex) The solid fill color set on a series, ornullwhen the series uses the theme color.seriesHiddenPointLabels(int seriesIndex) The point indices whose label the chart hides while the rest of the series keeps its own (<c:dLbl><c:delete val="1"/>); empty when none is hidden.boolean[]seriesInSecondPlot(int seriesIndex) Which of a series' points a pie-of-pie / bar-of-pie draws in its second plot, one flag per cached value.seriesName(int seriesIndex) The series name: literal text, or a sheet-qualified reference such as"Sheet1!$B$1".seriesPointExplosions(int seriesIndex) The explicit per-slice explosion overrides of a series (pie/doughnut), keyed by 0-based point index (ECMA-376 §21.2.2.62dPt/explosion, percent of radius).seriesPointFills(int seriesIndex) The explicit per-data-point (per-slice / per-bar) fill overrides of a series, keyed by 0-based point index (ECMA-376 §21.2.2.52 dPt).seriesPointLabels(int seriesIndex) The captions of the series' per-point labels (<c:dLbl>), keyed by the point index each names.booleanseriesSecondaryAxis(int seriesIndex) Whether this series is plotted against the secondary value axis of a combination chart;falseon an ordinary chart.seriesType(int seriesIndex) The plot group this series is drawn in on a combination chart — one<c:plotArea>holding several<c:*Chart>groups, the bar-plus-line shape Excel calls a combo (ECMA-376 Part 1 §21.2.2.145):"column","line","area","bar","scatter", or the type of the group an imported combo put it in ("radar","bubble","stock").double[]seriesValueCache(int seriesIndex) The series' cached point values (<c:numCache>), in point order.seriesValues(int seriesIndex) The series values range reference, such as"Sheet1!$B$2:$B$9".setAnchor(int fromRow, int fromColumn, int toRow, int toColumn) Moves or resizes the chart by setting its two-cell anchor (0-based).setAutoTitle(boolean auto) Marks or unmarks the title as an Excel auto title.setCategoryAxisTitle(String title) Sets the category (X) axis title, or removes it withnullor an empty string.setCategoryAxisVisible(boolean visible) Shows or hides the category (X) axis; creates both axes when the chart has none.setErrorBars(int seriesIndex, ErrorBars errorBars) Sets the error bars of a series, replacing any it has, or removes them withnull.setGapWidth(int percent) Sets the gap between bar or column clusters, as a percentage of one bar's width.setHoleSize(int percent) Sets the doughnut hole size as a percentage of the outer radius.setLegend(LegendPosition position) Moves the legend.setLegendVisible(boolean visible) Shows or hides the legend without changing its position.setOverlap(int percent) Sets how much bars in one cluster overlap, as a percentage from -100 (a full bar-width gap) to 100 (full overlap).Replaces the references of one series.setSeriesDataLabels(int seriesIndex, DataLabels labels) Sets the data labels of one series, or removes them withnull.setSeriesFill(int seriesIndex, Color fill) Sets the solid fill of one series, or removes it withnullso the theme color applies.setSeriesSecondaryAxis(int seriesIndex, boolean on) Plot one series of a combo chart against the secondary value axis (on) or the primary one — the counterpart ofChart.Builder.secondaryAxis(boolean).setSeriesType(int seriesIndex, String type) Move one series of a combo chart into the plot group of another type — the counterpart ofChart.Builder.seriesType(String).setShowDataLabels(boolean show) Shows value labels on every series, or withfalseremoves every data label from the chart, series and point labels included.setThreeD(boolean threeD) Turns 3-D drawing on or off.Sets a literal chart title, or removes it withnullor an empty string.setValueAxisGridlines(boolean on) Shows or hides the major gridlines of the value (Y) axis; creates both axes when the chart has none.setValueAxisScale(double min, double max) Fixes the value (Y) axis to the range[min, max].setValueAxisTitle(String title) Sets the value (Y) axis title, or removes it withnullor an empty string.setValueAxisVisible(boolean visible) Shows or hides the value (Y) axis; creates both axes when the chart has none.booleanWhether the chart shows data labels: set through the builder orsetShowDataLabels(boolean), or value labels on every series — the form the setting takes in a file, so it reads back after reopening.intstyle()The chart's built-in style number (<c:style val>), or-1when it carries none.title()The literal chart title, ornullwhen the chart has none or uses an auto title (titleAuto()).booleanWhether the chart title is an Excel "auto" title — a<c:title>present with no explicit text, so the app derives it from the single series name.The cell reference the title follows (<c:strRef><c:f>), ornullfor a literal or absent title.double[]The manual title layout as[x, y, w, h]chart-relative fractions, ornullwhen the title is placed automatically.trendlines(int seriesIndex) The trendlines of a series, in file order; empty when none.type()The chart type token, such as"column","bar","line","pie"or"combo";"column"when the engine reports none.booleanWhether the value (Y) axis draws major gridlines (<c:majorGridlines>).The fixed value-axis maximum, ornullwhen the axis scales automatically.The fixed value-axis minimum, ornullwhen the axis scales automatically.The value (Y) axis title, ornullwhen the axis has none or the chart has no value axis.booleanWhether the value (Y) axis is drawn.int[]view3D()The chart's 3-D view angles (ECMA-376 §21.2.2.228view3D) as[rotX, rotY, depthPercent], ornullwhen the chart is not 3-D.
-
Method Details
-
reload
public void reload()Re-reads the chart from the engine and replaces this view's snapshot.- Throws:
AxyraException- if no chart exists at this index any more, or the chart-sheet chart is an imported chart that the engine does not model
-
index
public int index()This chart's 0-based index on its sheet, or the chart-sheet index for a chart-sheet chart. Fixed when the view was created. -
type
The chart type token, such as"column","bar","line","pie"or"combo";"column"when the engine reports none. SeeChart.of(String)for the full list. -
title
The literal chart title, ornullwhen the chart has none or uses an auto title (titleAuto()). -
legendPosition
Where the legend is placed;LegendPosition.NONEwhen the legend is marked deleted. Independent oflegendVisible(). -
showDataLabels
public boolean showDataLabels()Whether the chart shows data labels: set through the builder orsetShowDataLabels(boolean), or value labels on every series — the form the setting takes in a file, so it reads back after reopening. -
is3d
public boolean is3d()Whether the chart is drawn in 3-D; seeview3D()for its angles. -
barShape
The solid a 3-D bar or column draws its bars as (<c:shape>, ECMA-376 Part 1 §21.2.2.177):"box","cone","coneToMax","cylinder","pyramid"or"pyramidToMax"."box"when the chart declares none, that being the attribute's default. -
style
public int style()The chart's built-in style number (<c:style val>), or-1when it carries none. -
titleFormula
The cell reference the title follows (<c:strRef><c:f>), ornullfor a literal or absent title. -
grouping
Bar/column/area/line grouping:"clustered"/"stacked"/"percentStacked"/"standard"(Excel default"clustered"). A stacked series set renders as one solid bar per category, so this must be reproduced to rebuild a stacked chart. -
gapWidth
public int gapWidth()The gap between bar or column clusters, as a percentage of one bar's width (0–500). A new clustered 2-D column chart reports 219 and a clustered 2-D bar chart 182, which is what Excel writes; stacked, 3-D and other charts report 150. -
overlap
public int overlap()How much bars in one cluster overlap, as a percentage from -100 (a full bar-width gap) to 100 (full overlap). A new clustered 2-D column chart reports -27, which is what Excel writes; other charts report 0. -
holeSize
public int holeSize()The doughnut hole size, as a percentage of the outer radius. Reported for every chart type; only a doughnut chart uses it. -
categoryAxisTitle
The category (X) axis title, ornullwhen the axis has none or the chart has no category axis. -
valueAxisTitle
The value (Y) axis title, ornullwhen the axis has none or the chart has no value axis. -
valueAxisMin
The fixed value-axis minimum, ornullwhen the axis scales automatically. -
valueAxisMax
The fixed value-axis maximum, ornullwhen the axis scales automatically. -
anchor
public int[] anchor()The two-cell anchor as{fromRow, fromColumn, toRow, toColumn}, all 0-based. The bottom-right corner sits at the top-left of cell (toRow,toColumn) plusanchorOffsets(). A new array on each call. Not meaningful for a chart-sheet chart. -
anchorOffsets
public int[] anchorOffsets(){fromColOff, fromRowOff, toColOff, toRowOff}— the sub-cell EMU offsets of the two-cell anchor's corners (914400 EMU = 1 inch). Reproduce them on a rebuild viaChart.Builder.anchorOffsets(int, int, int, int)so the chart keeps its exact fractional placement / size. -
chartAreaFill
The chart-area fill color, ornullwhen none is set and the default white applies. See alsochartAreaNoFill(). -
chartAreaLineColor
The chart-area border color, ornullwhen none is set. -
chartAreaNoLine
public boolean chartAreaNoLine()Whether the chart area is set to have no border. -
chartAreaNoFill
public boolean chartAreaNoFill()Whether the chart-area background is explicitly TRANSPARENT (<a:noFill/>, ECMA-376 §20.1.8.44) — the sheet shows through. Distinct fromchartAreaFill()returningnull, which means "unset" and renders as the application-default opaque white. -
plotAreaFill
The plot-area fill color, ornullwhen none is set. -
plotAreaLineColor
The plot-area border color, ornullwhen none is set. -
plotAreaNoLine
public boolean plotAreaNoLine()Whether the plot area is set to have no border. -
plotAreaNoFill
public boolean plotAreaNoFill()Whether the plot-area background is explicitly transparent (mirrorschartAreaNoFill()). -
seriesCount
public int seriesCount()The number of series in the chart; series indices run from 0 toseriesCount() - 1. -
seriesName
The series name: literal text, or a sheet-qualified reference such as"Sheet1!$B$1".- Parameters:
seriesIndex- 0-based series index- Returns:
- the name, or
nullwhen the series has none - Throws:
AxyraException- ifseriesIndexis out of range
-
seriesValues
The series values range reference, such as"Sheet1!$B$2:$B$9".- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
seriesCategories
The series categories range reference, ornullwhen the series has none. On a scatter chart this holds the X values.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
seriesBubbleSizes
The series' bubble-size (Z) range reference (<c:bubbleSize>), ornullon anything but a bubble chart that declares one.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
seriesType
The plot group this series is drawn in on a combination chart — one<c:plotArea>holding several<c:*Chart>groups, the bar-plus-line shape Excel calls a combo (ECMA-376 Part 1 §21.2.2.145):"column","line","area","bar","scatter", or the type of the group an imported combo put it in ("radar","bubble","stock").nullon an ordinary chart, wheretype()describes every series. Change it withsetSeriesType(int, String).- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
seriesSecondaryAxis
public boolean seriesSecondaryAxis(int seriesIndex) Whether this series is plotted against the secondary value axis of a combination chart;falseon an ordinary chart. Change it withsetSeriesSecondaryAxis(int, boolean).- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
seriesFill
The solid fill color set on a series, ornullwhen the series uses the theme color. Set it withsetSeriesFill(int, Color)orChart.Builder.series(String, String, String, Color).- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
seriesPointFills
The explicit per-data-point (per-slice / per-bar) fill overrides of a series, keyed by 0-based point index (ECMA-376 §21.2.2.52 dPt). Empty when the series carries no<c:dPt>color overrides. A new map on each call.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
seriesPointLabels
The captions of the series' per-point labels (<c:dLbl>), keyed by the point index each names.A series'
<c:dLbls>block sets what every point's label shows; a<c:dLbl>inside it overrides that for one point, most often with a caption of its own. Empty when every point uses the series-level label. Lines within a caption are separated by\n.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
seriesHiddenPointLabels
The point indices whose label the chart hides while the rest of the series keeps its own (<c:dLbl><c:delete val="1"/>); empty when none is hidden.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
seriesValueCache
public double[] seriesValueCache(int seriesIndex) The series' cached point values (<c:numCache>), in point order.These are the numbers the chart was drawn from, as the file recorded them. Empty when the series carries no cache and its range could not be resolved against the cells.
- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
seriesInSecondPlot
public boolean[] seriesInSecondPlot(int seriesIndex) Which of a series' points a pie-of-pie / bar-of-pie draws in its second plot, one flag per cached value.Derived by the engine from the chart's split settings and the series' values, so every caller gets the same answer to a question the file only states indirectly. Empty for a chart with no of-pie split — which is not the same as all-false, and is why this returns a length rather than a per-index lookup.
- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
isOfPie
public boolean isOfPie()Whether this chart is a pie-of-pie or bar-of-pie (<c:ofPieChart>). -
ofPieSecondPlotIsBar
public boolean ofPieSecondPlotIsBar()Whether an of-pie chart draws its second plot as a stacked bar (<c:ofPieType val="bar"/>) rather than as a second pie.falsefor a chart that is not an of-pie at all — test withisOfPie()first. -
ofPieSplitType
The of-pie split rule as the format's own token —auto,cust,percent,posorval— ornullwhen the chart carries no<c:splitType>.An absent rule is kept distinct from an explicit
auto: the first leaves the choice to the application, the second records that the author chose to leave it there. -
ofPieSplitPosition
The count or threshold the split rule compares against (<c:splitPos>), ornullwhen absent. -
ofPieCustomSplit
public int[] ofPieCustomSplit()The zero-based point indices acustsplit puts in the second plot (<c:custSplit>); empty for every other rule. -
ofPieSecondPlotSize
The second plot's size as a percentage of the first (<c:secondPieSize>), ornullwhen absent. -
view3D
public int[] view3D()The chart's 3-D view angles (ECMA-376 §21.2.2.228view3D) as[rotX, rotY, depthPercent], ornullwhen the chart is not 3-D. The read-back counterpart ofChart.Builder.view3D(int, int, int). -
plotAreaLayout
public double[] plotAreaLayout()The manual plot-area layout (ECMA-376 §21.2.2.88manualLayout) as[x, y, w, h]in chart-relative fractions, ornullwhen the plot area is laid out automatically. Read-back ofChart.Builder.plotAreaLayout(double, double, double, double). -
legendLayout
public double[] legendLayout()The manual legend layout as[x, y, w, h]chart-relative fractions, ornullwhen the legend is placed automatically. Read-back ofChart.Builder.legendLayout(double, double, double, double). -
titleLayout
public double[] titleLayout()The manual title layout as[x, y, w, h]chart-relative fractions, ornullwhen the title is placed automatically. Read-back ofChart.Builder.titleLayout(double, double, double, double). -
seriesPointExplosions
The explicit per-slice explosion overrides of a series (pie/doughnut), keyed by 0-based point index (ECMA-376 §21.2.2.62dPt/explosion, percent of radius). Empty when no slice is exploded.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
titleAuto
public boolean titleAuto()Whether the chart title is an Excel "auto" title — a<c:title>present with no explicit text, so the app derives it from the single series name. When true,title()isnulland callers must not re-issue a literal title (that is what turns an auto title into a generic "Chart Title" placeholder on rebuild). -
legendVisible
public boolean legendVisible()Whether the legend is shown at all (independent of its position). -
categoryAxisVisible
public boolean categoryAxisVisible()Whether the category (X) axis is drawn. Defaults totrue. -
valueAxisVisible
public boolean valueAxisVisible()Whether the value (Y) axis is drawn. Defaults totrue. -
valueAxisGridlines
public boolean valueAxisGridlines()Whether the value (Y) axis draws major gridlines (<c:majorGridlines>). Defaults totrue; an imported chart reports what its file says. -
trendlines
The trendlines of a series, in file order; empty when none. A snapshot list.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
seriesDataLabels
The series-level data labels (<c:dLbls>), ornullwhen the series carries none. Reproduce them on a rebuild viaChart.Builder.dataLabels(DataLabels)(ECMA-376 §21.2.2.49).- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
errorBars
The error bars of a series, ornullwhen it has none.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
isExtendedChart
public boolean isExtendedChart()Whether this is a modern extended chart — the ISO/IEC 29500 Transitionalcx:chart-extension schema (waterfall, funnel, histogram, treemap, sunburst, box & whisker, region map). Such a chart carries a byte-exact apparatus (itschartExpart plus thechartColorStyle/chartStyleparts) which Excel requires intact to open the file; re-issue it verbatim throughChart.Builder.extendedApparatus(java.lang.String, java.lang.String, java.lang.String)when rebuilding, since the structured builder fields cannot reconstruct it. -
extendedChartExData
Base64 of the sourcexl/charts/chartEx*.xmlpart for an extended chart, ornullfor a classic chart. Pass toChart.Builder.extendedApparatus(java.lang.String, java.lang.String, java.lang.String). -
extendedColorsData
Base64 of the extended chart'schartColorStylepart, ornull. -
extendedStyleData
Base64 of the extended chart'schartStylepart, ornull. -
setTitle
Sets a literal chart title, or removes it withnullor an empty string. A non-empty title turns off the auto title (titleAuto()). -
setLegend
Moves the legend.LegendPosition.NONEhides it by marking it deleted;setLegendVisible(boolean)hides it without changing the position.- Throws:
NullPointerException- ifpositionis null
-
setLegendVisible
Shows or hides the legend without changing its position. A hidden legend is saved by omitting the legend element, unlikesetLegend(LegendPosition.NONE). -
setCategoryAxisVisible
Shows or hides the category (X) axis; creates both axes when the chart has none. -
setValueAxisVisible
Shows or hides the value (Y) axis; creates both axes when the chart has none. -
setValueAxisGridlines
Shows or hides the major gridlines of the value (Y) axis; creates both axes when the chart has none. -
setAutoTitle
Marks or unmarks the title as an Excel auto title. Withtruethe literal title is removed and Excel shows the name of the single series. -
setSeriesFill
Sets the solid fill of one series, or removes it withnullso the theme color applies. Only RGB colors are accepted; the alpha byte is ignored.- Parameters:
seriesIndex- 0-based series index- Throws:
IllegalStateException- iffillis a theme, indexed or automatic colorAxyraException- ifseriesIndexis out of range
-
setSeriesType
Move one series of a combo chart into the plot group of another type — the counterpart ofChart.Builder.seriesType(String).The series on one axis must share an axis kind, as on the builder: a
"bar"or"scatter"series goes on an axis no other kind is on — move it to the secondary axis first.- Parameters:
seriesIndex- 0-based series indextype-"column","line","area","bar"or"scatter"- Throws:
AxyraException- ifseriesIndexis out of rangeIllegalArgumentException- whentypeis none of thoseIllegalStateException- when the chart is not a combo, or when a series of another axis kind is on the same axis
-
setSeriesSecondaryAxis
Plot one series of a combo chart against the secondary value axis (on) or the primary one — the counterpart ofChart.Builder.secondaryAxis(boolean).- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of rangeIllegalStateException- when the chart is not a combo, when the move would leave no series on the primary axis, or when a series of another axis kind (column/line/area, bar, scatter) is on the axis the series moves to
-
setShowDataLabels
Shows value labels on every series, or withfalseremoves every data label from the chart, series and point labels included. The same as Excel's Data Labels > None. Setting the value the chart already reports changes nothing. -
setThreeD
Turns 3-D drawing on or off. Only bar, column, line, pie, area and surface charts have a 3-D form; other types ignore the flag when saved. -
setGapWidth
Sets the gap between bar or column clusters, as a percentage of one bar's width. Excel accepts 0–500.- Throws:
AxyraException- ifpercentis negative
-
setOverlap
Sets how much bars in one cluster overlap, as a percentage from -100 (a full bar-width gap) to 100 (full overlap). -
setHoleSize
Sets the doughnut hole size as a percentage of the outer radius. Has no effect on other chart types.- Throws:
AxyraException- ifpercentis negative
-
setCategoryAxisTitle
Sets the category (X) axis title, or removes it withnullor an empty string. Creates both axes when the chart has none. -
setValueAxisTitle
Sets the value (Y) axis title, or removes it withnullor an empty string. Creates both axes when the chart has none. -
setValueAxisScale
Fixes the value (Y) axis to the range[min, max]. Creates both axes when the chart has none. This view cannot return the bounds to automatic scaling; rebuild the chart withSheet.replaceChart(int, io.keikai.axyra.sheets.content.Chart)for that. -
setAnchor
Moves or resizes the chart by setting its two-cell anchor (0-based). The bottom-right corner is at the top-left of cell (toRow,toColumn) plus the currentanchorOffsets(), so with zero offsets that cell is not covered. Has no effect on a chart-sheet chart.- Throws:
AxyraException- if an index is negative
-
setSeries
Replaces the references of one series. References are A1 strings such as"Sheet1!$B$2:$B$9". AnullnameorcategoriesRefkeeps the current value; it does not clear it.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
addTrendline
Adds a trendline to a series, after any it already has.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of rangeNullPointerException- iftrendlineis null
-
clearTrendlines
Removes every trendline from a series.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
setErrorBars
Sets the error bars of a series, replacing any it has, or removes them withnull.- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of range
-
setSeriesDataLabels
Sets the data labels of one series, or removes them withnull.labelsreplaces the series' whole label block: the show flags, position, number format and text styling (rotation,textColor,bold,fontSize). A styling field leftnullinherits the chart default, so to change only what the labels show and keep their styling, start fromseriesDataLabels(int).- Parameters:
seriesIndex- 0-based series index- Throws:
AxyraException- ifseriesIndexis out of rangeIllegalStateException- iftextColoris a theme, indexed or automatic color
-