Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Mon Dec 13, 2021 2:39 am

Hello,

To help us resolve your issue quickly and efficiently, please provide us with the file which has the existing chart, and point out the style you want to copy, and where you want to copy it to.

Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Thu Dec 23, 2021 9:15 pm

Dear Marcia,

I added the file and you can check datalabel that value is 38.58 I want copy that styles to middleText because I dont change middle one I only add values to its left,right,above and below.

numankizil
 
Posts: 26
Joined: Tue Nov 09, 2021 8:00 pm

Fri Dec 24, 2021 2:15 am

Hello,

Thanks for your reply!

Sorry that I did not see your attachment, could you please attach it again? Or you can send it to us via email(support@e-iceblue.com). Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Sat Dec 25, 2021 7:54 am

Hello,

sorry, that was my mistake I added it.

numankizil
 
Posts: 26
Joined: Tue Nov 09, 2021 8:00 pm

Mon Dec 27, 2021 3:44 am

Hello,

Thanks for sharing more information!

Kindly note that in your chart, you did not set a specific format for the data "38.58", but use the default format of the data label. And the default format actually is using the format of the slide theme, our product cannot get it by DefaultCharacterProperties since this will get a null value.

Please refer to the following code to get the format from the slide theme, and apply it to the middleText.

Code: Select all
                    TextRange middleTextRange = new TextRange(" ↑ ");
                    middleTextRange.LatinFont = chart.Slide.Theme.FontScheme.MajorFont.LatinFont;
                    middleTextRange.FontHeight = 10;
                    middleTextRange.Fill.FillType = chart.Slide.Theme.FormatScheme.FillStyles[0].FillType;
                    middleTextRange.Fill.SolidColor.Color = chart.Slide.Theme.FormatScheme.FillStyles[0].SolidColor.Color;


Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Tue Jan 04, 2022 6:27 am

Hello,

Hope you are doing well!

Has the issue been solved now? Could you please give us some feedback at your convenience?

Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Mon Jan 10, 2022 5:40 pm

Hello,

I have changed code and my colleague will try it, after that I will inform you.
But I wonder is there any reason to set FontHeight to 10 ?

numankizil
 
Posts: 26
Joined: Tue Nov 09, 2021 8:00 pm

Tue Jan 11, 2022 1:52 am

Hello,

Thanks for your feedback.

Since there is no default FontHeight in the theme of the slide, I just set the font height to the value the code set before. You can also use a global value to change it.

If there is any question during your testing, please feel free to contact us.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Thu Jan 13, 2022 6:32 pm

Hello,

thanks for your answers.

sorry I dont know how to set global font size can you please help?

also
Code: Select all
chart.Slide.Theme.FontScheme.MajorFont.LatinFont
sets Calibri Light but in the template file it is Calibri body .

numankizil
 
Posts: 26
Joined: Tue Nov 09, 2021 8:00 pm

Fri Jan 14, 2022 2:42 am

Hello,

For the first question: Please refer to the following code to set the global value.
Code: Select all
namespace yourprojectname
{

    public enum DefaultProperties
    {
        CharFontSize = 10
    }
public class Program
    {
       
        static void Main(string[] args)
        {
                    ... ...
                    middleTextRange.FontHeight = (float)DefaultProperties.CharFontSize;
                    ... ...
        }
}
}


For the issue about "Calibri Light" font: Please refer to the "middleTextRange.LatinFont = chart.Slide.Theme.FontScheme.MinorFont.LatinFont;" to get the corresponding font.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Sun Jan 16, 2022 10:19 am

Hello,

I supposud global is a feature of powerpoint. I just want to take the font of datavalue in the template? if there is no font I can set a value.
For the second one I will try and infrom you.

numankizil
 
Posts: 26
Joined: Tue Nov 09, 2021 8:00 pm

Mon Jan 17, 2022 6:22 am

Hello,

Sorry that there is not any better way than setting the font height individually for a specific textrange now, since there is no global properties for presentation, either the font height setting for Slide.Theme. Hope you can understand.

If you have any other question during your testing. Just feel free to contact us.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Mon Jan 17, 2022 5:56 pm

Hello,

I think I misunderstand something. I just want to set the datalabel font size of chart in the template.How can I get it?

numankizil
 
Posts: 26
Joined: Tue Nov 09, 2021 8:00 pm

Tue Jan 18, 2022 1:09 am

Hello,

Please use middleTextRange.FontHeight = 10; to set the font size.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Fri Jan 21, 2022 8:51 am

Hello,
you set a constant value, how can I set it when other templates have value 11,12,45 ... ?

numankizil
 
Posts: 26
Joined: Tue Nov 09, 2021 8:00 pm

Return to Spire.Presentation