forked from nissl-lab/npoi
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shiyu Tang
committed
Apr 8, 2018
1 parent
e00a750
commit 3379964
Showing
6 changed files
with
241 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
using NPOI.OpenXmlFormats.Dml.Chart; | ||
using NPOI.SS.UserModel.Charts; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace NPOI.XSSF.UserModel.Charts | ||
{ | ||
public class XSSFDateAxis : XSSFChartAxis | ||
{ | ||
private CT_DateAx ctDateAx; | ||
|
||
public XSSFDateAxis(XSSFChart chart, long id, AxisPosition pos) | ||
: base(chart) | ||
{ | ||
|
||
createAxis(id, pos); | ||
} | ||
|
||
public XSSFDateAxis(XSSFChart chart, CT_DateAx ctDateAx) | ||
: base(chart) | ||
{ | ||
|
||
this.ctDateAx = ctDateAx; | ||
} | ||
|
||
public override long Id | ||
{ | ||
get | ||
{ | ||
return ctDateAx.axId.val; | ||
} | ||
} | ||
|
||
public CT_ShapeProperties Line | ||
{ | ||
get | ||
{ | ||
return ctDateAx.spPr; | ||
} | ||
} | ||
|
||
protected override CT_AxPos GetCTAxPos() | ||
{ | ||
return ctDateAx.axPos; | ||
} | ||
|
||
protected override CT_NumFmt GetCTNumFmt() | ||
{ | ||
if (ctDateAx.IsSetNumFmt()) | ||
{ | ||
return ctDateAx.numFmt; | ||
} | ||
return ctDateAx.AddNewNumFmt(); | ||
} | ||
|
||
protected override CT_Scaling GetCTScaling() | ||
{ | ||
return ctDateAx.scaling; | ||
} | ||
|
||
protected override CT_Crosses GetCTCrosses() | ||
{ | ||
return ctDateAx.crosses; | ||
} | ||
|
||
protected override CT_Boolean GetDelete() | ||
{ | ||
return ctDateAx.delete; | ||
} | ||
|
||
protected override CT_TickMark GetMajorCTTickMark() | ||
{ | ||
return ctDateAx.majorTickMark; | ||
} | ||
|
||
protected override CT_TickMark GetMinorCTTickMark() | ||
{ | ||
return ctDateAx.minorTickMark; | ||
} | ||
|
||
protected CT_ChartLines GetMajorGridLines() | ||
{ | ||
return ctDateAx.majorGridlines; | ||
} | ||
|
||
public override void CrossAxis(IChartAxis axis) | ||
{ | ||
ctDateAx.crossAx.val = (uint)axis.Id; | ||
} | ||
|
||
public CT_TimeUnit GetBaseTimeUnit() | ||
{ | ||
return ctDateAx.baseTimeUnit; | ||
} | ||
|
||
public void SetBaseTimeUnit(CT_TimeUnit unit) | ||
{ | ||
ctDateAx.baseTimeUnit = unit; | ||
} | ||
|
||
private void createAxis(long id, AxisPosition pos) | ||
{ | ||
ctDateAx = chart.GetCTChart().plotArea.AddNewDateAx(); | ||
ctDateAx.AddNewAxId().val = (uint)id; | ||
ctDateAx.AddNewAxPos(); | ||
ctDateAx.AddNewScaling(); | ||
ctDateAx.AddNewCrosses(); | ||
ctDateAx.AddNewCrossAx(); | ||
ctDateAx.AddNewTickLblPos().val = ST_TickLblPos.nextTo; | ||
ctDateAx.AddNewDelete(); | ||
ctDateAx.AddNewMajorTickMark(); | ||
ctDateAx.AddNewMinorTickMark(); | ||
|
||
|
||
this.Position = (pos); | ||
this.Orientation = (AxisOrientation.MinToMax); | ||
this.Crosses = (AxisCrosses.AutoZero); | ||
this.IsVisible = true; | ||
this.MajorTickMark = (AxisTickMark.Cross); | ||
this.MinorTickMark = (AxisTickMark.None); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters