Charts axes in MSO 2010

Dec 21, 2010 at 2:24 PM

Hi

I`ve got strange excel files behaviour in 2010:

 

var chart = tws.Drawings.AddChart("Chart", eChartType.ColumnStacked);
chart.SetPosition(row, 0,  column, 0);
chart.SetSize(ch.XDimension, ch.YDimension);

var serie1 = chart.Series.Add(new ExcelAddress(rowfromchart, item.Key, rowtochart, item.Key).Address, ExcelCellBase.GetAddress(rowfromchart, colXchart, rowtochart, colXchart));
serie1.Header = Tools.LibraText(item.Value);
title = title1

var chartType2 = chart.PlotArea.ChartTypes.Add(eChartType.LineStacked);
chartType2.UseSecondaryAxis = true;
var serie2 = chartType2.Series.Add(new ExcelAddress(rowfromchart, item.Key, rowtochart, item.Key).Address, ExcelCellBase.GetAddress(rowfromchart, colXchart, rowtochart, colXchart));
serie2.Header = title2;
chartType2.XAxis.Deleted = true;

title = dt.DateMin.ToShortDateString() + " - " + dt.DateMax.ToShortDateString();
chart.Title.Text = title;
chart.Title.Font.Size = 8;
chart.PlotArea.Fill.Color = Color.LightGray;
chart.Style = eChartStyle.Style5;


This is newely added to EPPlus chart with two y axes.

In 2003 and 2007 Y axes and X axis are fully visible - I mean there are values on axes, for example 10%, 20%, 30%, ...

In 2010 what I can see is only plotarea with chart - there is no surrounding space with axes values.

Have anyone of you similar problem?

BR

Dec 21, 2010 at 3:13 PM
Hi, are you able to zip and attach that example? I would like to test
and debug it to see for myself.
Thanks
- Michael T.

On 12/21/10, Watcher01 <notifications@codeplex.com> wrote:
> From: Watcher01
>
> HiI`ve got strange excel files behaviour in 2010: var chart =
> tws.Drawings.AddChart("Chart",
> eChartType.ColumnStacked);chart.SetPosition(row, 0, column,
> 0);chart.SetSize(ch.XDimension, ch.YDimension);var serie1 =
> chart.Series.Add(new ExcelAddress(rowfromchart, item.Key, rowtochart,
> item.Key).Address, ExcelCellBase.GetAddress(rowfromchart, colXchart,
> rowtochart, colXchart));serie1.Header = Tools.LibraText(item.Value);title =
> title1var chartType2 =
> chart.PlotArea.ChartTypes.Add(eChartType.LineStacked);chartType2.UseSecondaryAxis
> = true;var serie2 = chartType2.Series.Add(new ExcelAddress(rowfromchart,
> item.Key, rowtochart, item.Key).Address,
> ExcelCellBase.GetAddress(rowfromchart, colXchart, rowtochart,
> colXchart));serie2.Header = title2;chartType2.XAxis.Deleted = true;title =
> dt.DateMin.ToShortDateString() + " - " +
> dt.DateMax.ToShortDateString();chart.Title.Text =
> title;chart.Title.Font.Size = 8;chart.PlotArea.Fill.Color =
> Color.LightGray;chart.Style = eChartStyle.Style5;
>
> This is newely added to EPPlus chart with two y axes.In 2003 and 2007 Y axes
> and X axis are fully visible - I mean there are values on axes, for example
> 10%, 20%, 30%, ...In 2010 what I can see is only plotarea with chart - there
> is no surrounding space with axes values.Have anyone of you similar
> problem?BR
>
>

--
Sent from my mobile device
Coordinator
Dec 22, 2010 at 8:14 AM

Hi,

Apparently graphs are rendered a little bit different in Excel 2010. I'll look in to it after the weekends.

Jan

Dec 23, 2010 at 1:53 PM
akronite wrote:
Hi, are you able to zip and attach that example? I would like to test
and debug it to see for myself.
Thanks
- Michael T.
Hi Michael

You can use EPPlus sample. Good example is sample9.

BR
Dec 23, 2010 at 2:01 PM

Hi Jan,

 

Is there some kind of workaround which might enable proper chart rendering in 2010?

I mean for example property which enforces 2010 to open file in 2007 compatibility level?

Any help are the most welcome.

 

BR

 

 

Coordinator
Dec 27, 2010 at 3:41 PM

Hi again,

Ok, I had a look at the samples and tests in 2010 and it was not very fun.

It turns out MS has changed the behavior when you leave out certain elements in charts.

Heres what i found out so far ...

  • Deleted element in axis (your problem). In 2007 the axis shows. in 2010 it does not.
  • Legend and charttitle overlay. In 2007 checked, in 2010 unchecked.
  • Datalabel properties,most of them . In 2007 unchecked . In 2010 checked.
  • 3D RotY. 2007, defaults to 20. In 2010 to 0
  • VaryColor for some charttypes. 2007 off. 2010 on.

I have no idea why this has been changed, but i'll need to do some more testing before I check in a fix for it. I hope I can do it before the end of this week.

Jan

 

Coordinator
Dec 29, 2010 at 6:55 PM

Hi again,

I have checked in a fix for this problem. Build the library from the tags/2.8.0.1 folder. Try it and give me some feedback if it works as expected for you.

Jan

Dec 30, 2010 at 1:25 AM

Hi Jan,

It seems that now everything is working :)

Thanks Jan once again for your efforts.

BR