When I load a slide into c# from a premade powerpoint, I seem to not be able to read the formatting of the text in x and y axis, aswell as legend.
I access these fields:
- Code: Select all
foreach (var legend in iChart.ChartLegend.EntryTextProperties)
{
legend.FontHeight = DataHolder.LegendFontSize;
legend.LatinFont = new TextFont(DataHolder.LegendFont);
legend.Fill.SolidColor.Color = DataHolder.LegendColor;
}
if (iChart.PrimaryCategoryAxis == null) return;
iChart.PrimaryCategoryAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.Fill.SolidColor.Color = DataHolder.PrimaryValueAxisColor;
iChart.PrimaryCategoryAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.Fill.FillType = FillFormatType.Solid;
iChart.PrimaryCategoryAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.FontHeight = DataHolder.PrimaryCategoryAxisFontSize;
iChart.PrimaryCategoryAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.LatinFont = new TextFont(DataHolder.PrimaryValueAxisFont);
if (iChart.PrimaryValueAxis == null) return;
iChart.PrimaryValueAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.Fill.SolidColor.Color = DataHolder.PrimaryCategoryAxisColor;
iChart.PrimaryValueAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.Fill.FillType = FillFormatType.Solid;
iChart.PrimaryValueAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.FontHeight = DataHolder.PrimaryValueAxisFontSize;
iChart.PrimaryValueAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.LatinFont = new TextFont(DataHolder.PrimaryCategoryAxisFont);
And they are all either null, NaN or default values. Should I not be able to read the values set in the powerpoint, so I do not need to set these things programmatically?
The goal is to pretty much only insert data from my code, and have a template where the format can be changed freely, without having to change the code.
I have similar issues with formatting of seriesdata, so I'm wondering if I need to set a flag somewhere, to keep the formatting of the loaded shapes, since it seems that atm. everything is reset to the master template.