Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Chart xls/xlsx

 Post Reply Post Reply
Author
Christian Hungbaur View Drop Down
New Member
New Member
Avatar

Joined: 11 Nov 2014
Posts: 29
Post Options Post Options   Quote Christian Hungbaur Quote  Post ReplyReply Direct Link To This Post Topic: Chart xls/xlsx
    Posted: 21 Jul 2017 at 3:51pm
Hello,

does it exist some progress by the chart support in the FlexCel component?

I have tried the version 6.10 but cannot modify the series in the chart. Some forum topics said that it is possible with xls format but in my case the xls format does not work at all.

For example the code (The second sheet is the CHART sheet)

            xls.ActiveSheet = 2;
            int a = xls.ObjectCount; //=1

            try
            { 
                FlexCel.Core.ExcelChart chart1 = xls.GetChart(1, String.Empty);
                FlexCel.Core.ChartSeries seria = new ChartSeries();


 for xls format just throw the exception {"Invalid value for parameter \"ObjectIndex\": 1 There are no elements in the list."} but for the xlsx it shows 0 series.
Back to Top
Adrian Gallero View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 1213
Post Options Post Options   Quote Adrian Gallero Quote  Post ReplyReply Direct Link To This Post Posted: 22 Jul 2017 at 2:11am
Hi,
Chart objects (those embedded inside a sheet) and chart sheets are different things, and even if both are supported, you need to access them by different ways.

For chart sheets you need to use ChartCount, and for chart objects you need ObjectCount. You can find an example here (ProcessCharts) that uses both:

Here you can see an example of adding series to existing charts in both embedded objects or chart sheets: 

As you can see, the main issue with AddSeries is that you can't control the format of the new series, and in xls files they default to "old style" colors and shadings. So it is normally better if possible to add the maximum number of series in the template, and format them with Excel, and then use DeleteSeries to remove the unwanted ones. You can also use SetSeries to change the existing series.

About xlsx support and AddChart, it is being worked on and there have been advances, but they are in a not public branch at the moment. Sadly there is still a lot of work to do yet and there is of course all the ongoing work supporting existing features, so even when we would personally like to have it yesterday, it is still some months away.
Back to Top
Christian Hungbaur View Drop Down
New Member
New Member
Avatar

Joined: 11 Nov 2014
Posts: 29
Post Options Post Options   Quote Christian Hungbaur Quote  Post ReplyReply Direct Link To This Post Posted: 24 Jul 2017 at 10:35am
Thank you for the answer. I will check the solution, seems that it can help us.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down