Skip to content

Commit

Permalink
V2.1.0 Released
Browse files Browse the repository at this point in the history
  • Loading branch information
XceedBoucherS committed Mar 22, 2022
1 parent 8784430 commit 9c431af
Show file tree
Hide file tree
Showing 101 changed files with 3,303 additions and 1,221 deletions.
2 changes: 1 addition & 1 deletion Xceed.Document.NET/AssemblyVersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
internal static class _XceedVersionInfo
{
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string BaseVersion = "2.0";
public const string BaseVersion = "2.1";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion +
".0.0";
Expand Down
1 change: 0 additions & 1 deletion Xceed.Document.NET/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
*************************************************************************************/


using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
Expand Down
Binary file modified Xceed.Document.NET/Resources/default_styles.xml.gz
Binary file not shown.
142 changes: 77 additions & 65 deletions Xceed.Document.NET/Src/Charts/Axis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at

using System;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
Expand All @@ -28,13 +30,11 @@ namespace Xceed.Document.NET
/// </summary>
public abstract class Axis
{

#region Private properties


#endregion


#region Public Properties

/// <summary>
Expand Down Expand Up @@ -75,6 +75,33 @@ public bool IsVisible






























#endregion


Expand Down Expand Up @@ -116,70 +143,55 @@ public Axis( String id )
#endregion
}

/// <summary>
/// Represents Category Axes
/// </summary>
public class CategoryAxis : Axis
{
internal CategoryAxis( XElement xml )
: base( xml )
{
}

public CategoryAxis( String id )
: base( id )
{
Xml = XElement.Parse( String.Format(
@"<c:catAx xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart"">
<c:axId val=""{0}""/>
<c:scaling>
<c:orientation val=""minMax""/>
</c:scaling>
<c:delete val=""0""/>
<c:axPos val=""b""/>
<c:majorTickMark val=""out""/>
<c:minorTickMark val=""none""/>
<c:tickLblPos val=""nextTo""/>
<c:crossAx val=""154227840""/>
<c:crosses val=""autoZero""/>
<c:auto val=""1""/>
<c:lblAlgn val=""ctr""/>
<c:lblOffset val=""100""/>
<c:noMultiLvlLbl val=""0""/>
</c:catAx>", id ) );
}
}

/// <summary>
/// Represents Values Axes
/// </summary>
public class ValueAxis : Axis
{
internal ValueAxis( XElement xml )
: base( xml )
{
}

public ValueAxis( String id )
: base( id )
{
Xml = XElement.Parse( String.Format(
@"<c:valAx xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart"">
<c:axId val=""{0}""/>
<c:scaling>
<c:orientation val=""minMax""/>
</c:scaling>
<c:delete val=""0""/>
<c:axPos val=""l""/>
<c:numFmt sourceLinked=""0"" formatCode=""General""/>
<c:majorGridlines/>
<c:majorTickMark val=""out""/>
<c:minorTickMark val=""none""/>
<c:tickLblPos val=""nextTo""/>
<c:crossAx val=""148921728""/>
<c:crosses val=""autoZero""/>
<c:crossBetween val=""between""/>
</c:valAx>", id ) );
}
}
















































}
45 changes: 34 additions & 11 deletions Xceed.Document.NET/Src/Charts/BarChart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
using System;
using System.Globalization;
using System.IO.Packaging;
using System.Linq;
using System.Xml.Linq;

namespace Xceed.Document.NET
Expand All @@ -36,13 +37,17 @@ public BarDirection BarDirection
{
get
{
var chartXml = GetChartTypeXElement();

return XElementHelpers.GetValueToEnum<BarDirection>(
ChartXml.Element( XName.Get( "barDir", Document.c.NamespaceName ) ) );
chartXml.Element( XName.Get( "barDir", Document.c.NamespaceName ) ) );
}
set
{
var chartXml = GetChartTypeXElement();

XElementHelpers.SetValueFromEnum<BarDirection>(
ChartXml.Element( XName.Get( "barDir", Document.c.NamespaceName ) ), value );
chartXml.Element( XName.Get( "barDir", Document.c.NamespaceName ) ), value );
}
}

Expand All @@ -53,16 +58,20 @@ public BarGrouping BarGrouping
{
get
{
var chartXml = GetChartTypeXElement();

return XElementHelpers.GetValueToEnum<BarGrouping>(
ChartXml.Element( XName.Get( "grouping", Document.c.NamespaceName ) ) );
chartXml.Element( XName.Get( "grouping", Document.c.NamespaceName ) ) );
}
set
{
var chartXml = GetChartTypeXElement();

XElementHelpers.SetValueFromEnum<BarGrouping>(
ChartXml.Element( XName.Get( "grouping", Document.c.NamespaceName ) ), value );
chartXml.Element( XName.Get( "grouping", Document.c.NamespaceName ) ), value );

var overlapVal = ( (value == BarGrouping.Stacked) || ( value == BarGrouping.PercentStacked ) ) ? "100" : "0";
var overlap = ChartXml.Element( XName.Get( "overlap", Document.c.NamespaceName ) );
var overlapVal = ( ( value == BarGrouping.Stacked ) || ( value == BarGrouping.PercentStacked ) ) ? "100" : "0";
var overlap = chartXml.Element( XName.Get( "overlap", Document.c.NamespaceName ) );
if( overlap != null )
{
overlap.Attribute( XName.Get( "val" ) ).Value = overlapVal;
Expand All @@ -77,31 +86,35 @@ public Int32 GapWidth
{
get
{
var chartXml = GetChartTypeXElement();

return Convert.ToInt32(
ChartXml.Element( XName.Get( "gapWidth", Document.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value );
chartXml.Element( XName.Get( "gapWidth", Document.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value );
}
set
{
var chartXml = GetChartTypeXElement();

if( ( value < 1 ) || ( value > 500 ) )
throw new ArgumentException( "GapWidth lay between 0% and 500%!" );
ChartXml.Element( XName.Get( "gapWidth", Document.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value = value.ToString( CultureInfo.InvariantCulture );
chartXml.Element( XName.Get( "gapWidth", Document.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value = value.ToString( CultureInfo.InvariantCulture );
}
}

#endregion

#region Constructors

[Obsolete("BarChart() is obsolete. Use Document.AddChart<BarChart>() instead.")]
public BarChart()
{
}


#endregion
#endregion

#region Overrides

protected override XElement CreateChartXml()
protected override XElement CreateExternalChartXml()
{
return XElement.Parse(
@"<c:barChart xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart"">
Expand All @@ -112,6 +125,16 @@ protected override XElement CreateChartXml()
</c:barChart>" );
}

protected override XElement GetChartTypeXElement()
{
if( this.ExternalXml == null )
return null;

return this.ExternalXml.Descendants().Where( chartElement => ( chartElement.Name.LocalName == "barChart" )
|| ( chartElement.Name.LocalName == "bar3DChart" ) ).SingleOrDefault();

}

#endregion
}

Expand Down
58 changes: 58 additions & 0 deletions Xceed.Document.NET/Src/Charts/CategoryAxis.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/***************************************************************************************
DocX – DocX is the community edition of Xceed Words for .NET
Copyright (C) 2009-2020 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/DocX/blob/master/license.md
For more features and fast professional support,
pick up Xceed Words for .NET at https://xceed.com/xceed-words-for-net/
*************************************************************************************/


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace Xceed.Document.NET
{
/// <summary>
/// Represents Category Axis
/// </summary>
public class CategoryAxis : Axis
{
internal CategoryAxis(XElement xml)
: base(xml)
{
}

public CategoryAxis(String id)
: base(id)
{
Xml = XElement.Parse(String.Format(
@"<c:catAx xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart"">
<c:axId val=""{0}""/>
<c:scaling>
<c:orientation val=""minMax""/>
</c:scaling>
<c:delete val=""0""/>
<c:axPos val=""b""/>
<c:majorTickMark val=""out""/>
<c:minorTickMark val=""none""/>
<c:tickLblPos val=""nextTo""/>
<c:crossAx val=""154227840""/>
<c:crosses val=""autoZero""/>
<c:auto val=""1""/>
<c:lblAlgn val=""ctr""/>
<c:lblOffset val=""100""/>
<c:noMultiLvlLbl val=""0""/>
</c:catAx>", id));
}
}
}
Loading

0 comments on commit 9c431af

Please sign in to comment.