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.

Wed Dec 12, 2018 9:06 am

Hi, can you tell me how to set a chart's DataTable font size in ppt.

dengcao1992
 
Posts: 6
Joined: Thu Dec 06, 2018 6:23 am

Wed Dec 12, 2018 10:15 am

Hi,

Thank you for your inquiry.
Please refer to the code below to reach your goal.
Code: Select all
chart.ChartDataTable.Text.Paragraphs[0].DefaultCharacterProperties.FontHeight = 5;


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Dec 12, 2018 2:09 pm

thank you, but i have another question. i need put a excel into ppt, but the excel's format change when open this excel in ppt。

dengcao1992
 
Posts: 6
Joined: Thu Dec 06, 2018 6:23 am

Thu Dec 13, 2018 2:32 am

Hi,

Thank you for your response.
To help us look into the issue, could you please share your Excel document?
For the privacy, you could send it to us via email(Jane.Bai@e-iceblue.com).

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Thu Dec 13, 2018 3:26 am

this is my ppt and excel

dengcao1992
 
Posts: 6
Joined: Thu Dec 06, 2018 6:23 am

Thu Dec 13, 2018 6:05 am

Hi,

Thank you for providing the files.
I have reproduced the issue and logged it in our bug tracking system.
Once it is fixed, I will let you know.
Sorry for the inconvenience caused!

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Mon Dec 17, 2018 4:04 am

Hi,

After our dev team's further investigation, we found the format change issue was related to the Excel Version.
When opening your sample Excel in MS Excel 2010 or 2007, you would find the result is the same as the one generated by our product. It is because that MS Excel version 2007 and version 2013 have a different processing mechanism for underlying data. The function "ToImage" in our product is based on the opening effect in Excel version 2007. Sorry that the issue could not be resolved in a short time due to the complexity.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Dec 19, 2018 11:05 am

hi,i get this exception when set chartDataTable font size.The paragraphs's count is 0,but the ppt have a chart.

dengcao1992
 
Posts: 6
Joined: Thu Dec 06, 2018 6:23 am

Thu Dec 20, 2018 6:21 am

Hi,

Thank you for your response.
The issue occurs because the data table is in default font style. In this situation, Spire.Presentation could not get the paragraphs.
You need add a paragraph and set the default font style like below.
Code: Select all
Presentation ppt = new Presentation();
ppt.LoadFromFile(diag.FileName);

IChart chart = ppt.Slides[0].Shapes[0] as IChart;
ChartDataTable dataTable= chart.ChartDataTable;
if(dataTable.Text.Paragraphs.Count==0)
{
    TextParagraph para = new TextParagraph();
    para.DefaultCharacterProperties.FontHeight = 4;
    dataTable.Text.Paragraphs.Append(para);
}
 
ppt.SaveToFile("changeDataTableFontSize.pptx",FileFormat.Pptx2010);


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Tue Dec 25, 2018 5:58 am

Hi,

Greetings from e-iceblue!
Have you tried my code? Your feedback would be greatly appreciated!

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.Presentation