Skip to content

Commit 9c431af

Browse files
committed
V2.1.0 Released
1 parent 8784430 commit 9c431af

File tree

101 files changed

+3303
-1221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+3303
-1221
lines changed

Xceed.Document.NET/AssemblyVersionInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
2121
internal static class _XceedVersionInfo
2222
{
2323
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
24-
public const string BaseVersion = "2.0";
24+
public const string BaseVersion = "2.1";
2525
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
2626
public const string Version = BaseVersion +
2727
".0.0";

Xceed.Document.NET/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
1414
*************************************************************************************/
1515

1616

17-
using System;
1817
using System.Reflection;
1918
using System.Runtime.CompilerServices;
2019
using System.Runtime.InteropServices;
-6 Bytes
Binary file not shown.

Xceed.Document.NET/Src/Charts/Axis.cs

Lines changed: 77 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
1616

1717
using System;
1818
using System.ComponentModel;
19+
using System.Drawing;
20+
using System.Globalization;
1921
using System.Linq;
2022
using System.Xml;
2123
using System.Xml.Linq;
@@ -28,13 +30,11 @@ namespace Xceed.Document.NET
2830
/// </summary>
2931
public abstract class Axis
3032
{
31-
3233
#region Private properties
3334

3435

3536
#endregion
3637

37-
3838
#region Public Properties
3939

4040
/// <summary>
@@ -75,6 +75,33 @@ public bool IsVisible
7575

7676

7777

78+
79+
80+
81+
82+
83+
84+
85+
86+
87+
88+
89+
90+
91+
92+
93+
94+
95+
96+
97+
98+
99+
100+
101+
102+
103+
104+
78105
#endregion
79106

80107

@@ -116,70 +143,55 @@ public Axis( String id )
116143
#endregion
117144
}
118145

119-
/// <summary>
120-
/// Represents Category Axes
121-
/// </summary>
122-
public class CategoryAxis : Axis
123-
{
124-
internal CategoryAxis( XElement xml )
125-
: base( xml )
126-
{
127-
}
128146

129-
public CategoryAxis( String id )
130-
: base( id )
131-
{
132-
Xml = XElement.Parse( String.Format(
133-
@"<c:catAx xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart"">
134-
<c:axId val=""{0}""/>
135-
<c:scaling>
136-
<c:orientation val=""minMax""/>
137-
</c:scaling>
138-
<c:delete val=""0""/>
139-
<c:axPos val=""b""/>
140-
<c:majorTickMark val=""out""/>
141-
<c:minorTickMark val=""none""/>
142-
<c:tickLblPos val=""nextTo""/>
143-
<c:crossAx val=""154227840""/>
144-
<c:crosses val=""autoZero""/>
145-
<c:auto val=""1""/>
146-
<c:lblAlgn val=""ctr""/>
147-
<c:lblOffset val=""100""/>
148-
<c:noMultiLvlLbl val=""0""/>
149-
</c:catAx>", id ) );
150-
}
151-
}
152147

153-
/// <summary>
154-
/// Represents Values Axes
155-
/// </summary>
156-
public class ValueAxis : Axis
157-
{
158-
internal ValueAxis( XElement xml )
159-
: base( xml )
160-
{
161-
}
162148

163-
public ValueAxis( String id )
164-
: base( id )
165-
{
166-
Xml = XElement.Parse( String.Format(
167-
@"<c:valAx xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart"">
168-
<c:axId val=""{0}""/>
169-
<c:scaling>
170-
<c:orientation val=""minMax""/>
171-
</c:scaling>
172-
<c:delete val=""0""/>
173-
<c:axPos val=""l""/>
174-
<c:numFmt sourceLinked=""0"" formatCode=""General""/>
175-
<c:majorGridlines/>
176-
<c:majorTickMark val=""out""/>
177-
<c:minorTickMark val=""none""/>
178-
<c:tickLblPos val=""nextTo""/>
179-
<c:crossAx val=""148921728""/>
180-
<c:crosses val=""autoZero""/>
181-
<c:crossBetween val=""between""/>
182-
</c:valAx>", id ) );
183-
}
184-
}
149+
150+
151+
152+
153+
154+
155+
156+
157+
158+
159+
160+
161+
162+
163+
164+
165+
166+
167+
168+
169+
170+
171+
172+
173+
174+
175+
176+
177+
178+
179+
180+
181+
182+
183+
184+
185+
186+
187+
188+
189+
190+
191+
192+
193+
194+
195+
196+
185197
}

Xceed.Document.NET/Src/Charts/BarChart.cs

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
1717
using System;
1818
using System.Globalization;
1919
using System.IO.Packaging;
20+
using System.Linq;
2021
using System.Xml.Linq;
2122

2223
namespace Xceed.Document.NET
@@ -36,13 +37,17 @@ public BarDirection BarDirection
3637
{
3738
get
3839
{
40+
var chartXml = GetChartTypeXElement();
41+
3942
return XElementHelpers.GetValueToEnum<BarDirection>(
40-
ChartXml.Element( XName.Get( "barDir", Document.c.NamespaceName ) ) );
43+
chartXml.Element( XName.Get( "barDir", Document.c.NamespaceName ) ) );
4144
}
4245
set
4346
{
47+
var chartXml = GetChartTypeXElement();
48+
4449
XElementHelpers.SetValueFromEnum<BarDirection>(
45-
ChartXml.Element( XName.Get( "barDir", Document.c.NamespaceName ) ), value );
50+
chartXml.Element( XName.Get( "barDir", Document.c.NamespaceName ) ), value );
4651
}
4752
}
4853

@@ -53,16 +58,20 @@ public BarGrouping BarGrouping
5358
{
5459
get
5560
{
61+
var chartXml = GetChartTypeXElement();
62+
5663
return XElementHelpers.GetValueToEnum<BarGrouping>(
57-
ChartXml.Element( XName.Get( "grouping", Document.c.NamespaceName ) ) );
64+
chartXml.Element( XName.Get( "grouping", Document.c.NamespaceName ) ) );
5865
}
5966
set
6067
{
68+
var chartXml = GetChartTypeXElement();
69+
6170
XElementHelpers.SetValueFromEnum<BarGrouping>(
62-
ChartXml.Element( XName.Get( "grouping", Document.c.NamespaceName ) ), value );
71+
chartXml.Element( XName.Get( "grouping", Document.c.NamespaceName ) ), value );
6372

64-
var overlapVal = ( (value == BarGrouping.Stacked) || ( value == BarGrouping.PercentStacked ) ) ? "100" : "0";
65-
var overlap = ChartXml.Element( XName.Get( "overlap", Document.c.NamespaceName ) );
73+
var overlapVal = ( ( value == BarGrouping.Stacked ) || ( value == BarGrouping.PercentStacked ) ) ? "100" : "0";
74+
var overlap = chartXml.Element( XName.Get( "overlap", Document.c.NamespaceName ) );
6675
if( overlap != null )
6776
{
6877
overlap.Attribute( XName.Get( "val" ) ).Value = overlapVal;
@@ -77,31 +86,35 @@ public Int32 GapWidth
7786
{
7887
get
7988
{
89+
var chartXml = GetChartTypeXElement();
90+
8091
return Convert.ToInt32(
81-
ChartXml.Element( XName.Get( "gapWidth", Document.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value );
92+
chartXml.Element( XName.Get( "gapWidth", Document.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value );
8293
}
8394
set
8495
{
96+
var chartXml = GetChartTypeXElement();
97+
8598
if( ( value < 1 ) || ( value > 500 ) )
8699
throw new ArgumentException( "GapWidth lay between 0% and 500%!" );
87-
ChartXml.Element( XName.Get( "gapWidth", Document.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value = value.ToString( CultureInfo.InvariantCulture );
100+
chartXml.Element( XName.Get( "gapWidth", Document.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value = value.ToString( CultureInfo.InvariantCulture );
88101
}
89102
}
90103

91104
#endregion
92105

93106
#region Constructors
94-
107+
[Obsolete("BarChart() is obsolete. Use Document.AddChart<BarChart>() instead.")]
95108
public BarChart()
96109
{
97110
}
98111

99112

100-
#endregion
113+
#endregion
101114

102115
#region Overrides
103116

104-
protected override XElement CreateChartXml()
117+
protected override XElement CreateExternalChartXml()
105118
{
106119
return XElement.Parse(
107120
@"<c:barChart xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart"">
@@ -112,6 +125,16 @@ protected override XElement CreateChartXml()
112125
</c:barChart>" );
113126
}
114127

128+
protected override XElement GetChartTypeXElement()
129+
{
130+
if( this.ExternalXml == null )
131+
return null;
132+
133+
return this.ExternalXml.Descendants().Where( chartElement => ( chartElement.Name.LocalName == "barChart" )
134+
|| ( chartElement.Name.LocalName == "bar3DChart" ) ).SingleOrDefault();
135+
136+
}
137+
115138
#endregion
116139
}
117140

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/***************************************************************************************
2+
3+
DocX – DocX is the community edition of Xceed Words for .NET
4+
5+
Copyright (C) 2009-2020 Xceed Software Inc.
6+
7+
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
8+
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
9+
https://github.com/xceedsoftware/DocX/blob/master/license.md
10+
11+
For more features and fast professional support,
12+
pick up Xceed Words for .NET at https://xceed.com/xceed-words-for-net/
13+
14+
*************************************************************************************/
15+
16+
17+
using System;
18+
using System.Collections.Generic;
19+
using System.Linq;
20+
using System.Text;
21+
using System.Xml.Linq;
22+
23+
namespace Xceed.Document.NET
24+
{
25+
/// <summary>
26+
/// Represents Category Axis
27+
/// </summary>
28+
public class CategoryAxis : Axis
29+
{
30+
internal CategoryAxis(XElement xml)
31+
: base(xml)
32+
{
33+
}
34+
35+
public CategoryAxis(String id)
36+
: base(id)
37+
{
38+
Xml = XElement.Parse(String.Format(
39+
@"<c:catAx xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart"">
40+
<c:axId val=""{0}""/>
41+
<c:scaling>
42+
<c:orientation val=""minMax""/>
43+
</c:scaling>
44+
<c:delete val=""0""/>
45+
<c:axPos val=""b""/>
46+
<c:majorTickMark val=""out""/>
47+
<c:minorTickMark val=""none""/>
48+
<c:tickLblPos val=""nextTo""/>
49+
<c:crossAx val=""154227840""/>
50+
<c:crosses val=""autoZero""/>
51+
<c:auto val=""1""/>
52+
<c:lblAlgn val=""ctr""/>
53+
<c:lblOffset val=""100""/>
54+
<c:noMultiLvlLbl val=""0""/>
55+
</c:catAx>", id));
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)