Expose one more bit of style information generically (for XSSF). If someone needs all these properties for HSSF charts as well, we can build a new Interface for the various bits and populate it with things like axis line width and color, etc. but for now I think most users are in the XSSF realm like me.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800341 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Greg Woolsey 2017-06-29 23:06:27 +00:00
parent 2cbd15ece2
commit 07a7987a48
4 changed files with 17 additions and 0 deletions

View File

@ -33,6 +33,7 @@ import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumFmt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTScaling; import org.openxmlformats.schemas.drawingml.x2006.chart.CTScaling;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTTickMark; import org.openxmlformats.schemas.drawingml.x2006.chart.CTTickMark;
import org.openxmlformats.schemas.drawingml.x2006.chart.STTickLblPos; import org.openxmlformats.schemas.drawingml.x2006.chart.STTickLblPos;
import org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties;
/** /**
* Category axis type. * Category axis type.
@ -58,6 +59,10 @@ public class XSSFCategoryAxis extends XSSFChartAxis {
return ctCatAx.getAxId().getVal(); return ctCatAx.getAxId().getVal();
} }
public CTShapeProperties getLine() {
return ctCatAx.getSpPr();
}
protected CTAxPos getCTAxPos() { protected CTAxPos getCTAxPos() {
return ctCatAx.getAxPos(); return ctCatAx.getAxPos();
} }

View File

@ -37,6 +37,7 @@ import org.openxmlformats.schemas.drawingml.x2006.chart.STAxPos;
import org.openxmlformats.schemas.drawingml.x2006.chart.STCrosses; import org.openxmlformats.schemas.drawingml.x2006.chart.STCrosses;
import org.openxmlformats.schemas.drawingml.x2006.chart.STOrientation; import org.openxmlformats.schemas.drawingml.x2006.chart.STOrientation;
import org.openxmlformats.schemas.drawingml.x2006.chart.STTickMark; import org.openxmlformats.schemas.drawingml.x2006.chart.STTickMark;
import org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties;
/** /**
* Base class for all axis types. * Base class for all axis types.
@ -195,6 +196,7 @@ public abstract class XSSFChartAxis implements ChartAxis {
protected abstract CTTickMark getMajorCTTickMark(); protected abstract CTTickMark getMajorCTTickMark();
protected abstract CTTickMark getMinorCTTickMark(); protected abstract CTTickMark getMinorCTTickMark();
public abstract CTChartLines getMajorGridLines(); public abstract CTChartLines getMajorGridLines();
public abstract CTShapeProperties getLine();
private static STOrientation.Enum fromAxisOrientation(AxisOrientation orientation) { private static STOrientation.Enum fromAxisOrientation(AxisOrientation orientation) {
switch (orientation) { switch (orientation) {

View File

@ -34,6 +34,7 @@ import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumFmt;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTScaling; import org.openxmlformats.schemas.drawingml.x2006.chart.CTScaling;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTTickMark; import org.openxmlformats.schemas.drawingml.x2006.chart.CTTickMark;
import org.openxmlformats.schemas.drawingml.x2006.chart.STTickLblPos; import org.openxmlformats.schemas.drawingml.x2006.chart.STTickLblPos;
import org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties;
/** /**
* Date axis type. Currently only implements the same values as {@link XSSFCategoryAxis}, since the two are nearly identical. * Date axis type. Currently only implements the same values as {@link XSSFCategoryAxis}, since the two are nearly identical.
@ -66,6 +67,10 @@ public class XSSFDateAxis extends XSSFChartAxis {
return ctDateAx.getAxId().getVal(); return ctDateAx.getAxId().getVal();
} }
public CTShapeProperties getLine() {
return ctDateAx.getSpPr();
}
protected CTAxPos getCTAxPos() { protected CTAxPos getCTAxPos() {
return ctDateAx.getAxPos(); return ctDateAx.getAxPos();
} }

View File

@ -36,6 +36,7 @@ import org.openxmlformats.schemas.drawingml.x2006.chart.CTTickMark;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTValAx; import org.openxmlformats.schemas.drawingml.x2006.chart.CTValAx;
import org.openxmlformats.schemas.drawingml.x2006.chart.STCrossBetween; import org.openxmlformats.schemas.drawingml.x2006.chart.STCrossBetween;
import org.openxmlformats.schemas.drawingml.x2006.chart.STTickLblPos; import org.openxmlformats.schemas.drawingml.x2006.chart.STTickLblPos;
import org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties;
/** /**
* Value axis type. * Value axis type.
@ -61,6 +62,10 @@ public class XSSFValueAxis extends XSSFChartAxis implements ValueAxis {
return ctValAx.getAxId().getVal(); return ctValAx.getAxId().getVal();
} }
public CTShapeProperties getLine() {
return ctValAx.getSpPr();
}
public void setCrossBetween(AxisCrossBetween crossBetween) { public void setCrossBetween(AxisCrossBetween crossBetween) {
ctValAx.getCrossBetween().setVal(fromCrossBetween(crossBetween)); ctValAx.getCrossBetween().setVal(fromCrossBetween(crossBetween));
} }