Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Oct 27, 2016 3:44 pm

Hi

I try to create a gauge with Spire XLS.
In interop Excel i arrived to make something like that :
Gauge.rar
(21.32 KiB) Downloaded 282 times


To make the first one (in D2), i need to make a rotation on series.
In interop Excel : shape.Chart.ChartGroups(1).FirstSliceAngle = 225;

I don't find the equivalent on Spire XLS. Could you help me ?

Thanks

VincentB
 
Posts: 120
Joined: Thu Sep 15, 2016 9:44 am

Fri Oct 28, 2016 7:51 am

In the same thing i want to modified chart series points.

Code: Select all
var serie= chart.Series.Add();
serie.EnteredDirectlyValues = new object[] { 20, 25, 25, 25, 25, 20 };
foreach (var dataPoint in serie.DataPoints)
{
     //...
}


My problem is serie.DataPoints is empty.
How can i change color of each points of label ?

Thanks

VincentB
 
Posts: 120
Joined: Thu Sep 15, 2016 9:44 am

Fri Oct 28, 2016 9:50 am

Hi VincentB,

Thanks for your inquiry. You can use the following code to make a rotation on series.
Code: Select all
(ChartSerie)chart.Series[0].DataFormat.Options.FirstSliceAngle = 225;

And use the following codes to change color of each points of label.
Code: Select all
            int i = 0;
            foreach (ChartSerie cs in chart.Series)
            {               
                foreach (CellRange cr in cs.Values)
                {
                    i++;                   
                    cs.DataPoints[i].DataFormat.Fill.FillType = ShapeFillType.SolidColor;
                    cs.DataPoints[i].DataFormat.Fill.BackColor = Color.Red;
                }
            }

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Wed Nov 02, 2016 9:01 am

HI Nina

Thanks for code to make a rotation on series, it is work !

But i have a problem to browse points of series.
I set value of series like that.
Code: Select all
var serie= chart.Series.Add();
serie.EnteredDirectlyValues = new object[] { 20, 25, 25, 25, 25, 20 };
int i = 0;
foreach (ChartSerie cs in chart.Series)
    foreach (CellRange cr in cs.Values)
    {
        i++;
        cs.DataPoints[i].DataFormat.Fill.FillType = ShapeFillType.SolidColor;
        cs.DataPoints[i].DataFormat.Fill.BackColor = Color.Red;
    }


But cs.Values is null.
I have try to browse cs.EnteredDirectlyValues
Code: Select all
int i = 0;
foreach (ChartSerie cs in chart.Series)
    foreach (var cr in cs.EnteredDirectlyValues)
    {
        i++;
        cs.DataPoints[i].DataFormat.Fill.FillType = ShapeFillType.SolidColor;
        cs.DataPoints[i].DataFormat.Fill.BackColor = Color.Red;
    }

And cs.DataPoints[i] (i = 1) throw an ArgumentOutOfRangeException.

Thanks

VincentB
 
Posts: 120
Joined: Thu Sep 15, 2016 9:44 am

Thu Nov 03, 2016 7:23 am

Hi,

I have noticed your issue and posted it to our Dev team.Once it is resolved, I will inform you. Sorry for inconvenience.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Wed Nov 09, 2016 8:51 am

Hi,

Thanks for your waiting. Now the issue has been resolved in Spire.XLS Pack Hotfix Version:7.11.13. Please download it and use the following codes to get the effect you expected.
Code: Select all
foreach (var cs in chart.Series)
{
     int i=0;
     foreach (object cr in cs.EnteredDirectlyValues)
    {
        cs.DataPoints[i].DataFormat.Fill.FillType = ShapeFillType.SolidColor;
        cs.DataPoints[i].DataFormat.Fill.ForeColor = Color.FromKnownColor(KnownColor.Red);
        i++;
     }
}


Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Fri Nov 18, 2016 9:22 am

Dear VincentB,

Have you tried the codes and the latest version? Could you please give us some feedback at your convenience?

Thanks,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Fri Nov 18, 2016 10:03 am

Yes i have tried and it works !!

Thanks

VincentB
 
Posts: 120
Joined: Thu Sep 15, 2016 9:44 am

Tue Nov 22, 2016 9:20 am

Hello,

Thanks for your feedback. Please feel free to contact us for futher question.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.XLS