spire.presentation 7.2.5已发布。该版本支持创建“地图”图表,还支持修改图表源数据的数字格式。此外还修复了ppt转pdf后,部分内容不正确等已知问题。详情请阅读以下内容。
新功能:
- 支持创建“地图”图表。
presentation ppt = new presentation();
ichart chart = ppt.slides[0].shapes.appendchart(charttype.map, new rectanglef(50, 50, 450, 450), false);
chart.chartdata[0, 1].text = "series";
string[] countries = { "china", "russia", "france", "mexico", "united states", "india", "australia" };
for (int i = 0; i < countries.length; i )
{
chart.chartdata[i 1, 0].text = countries[i];
}
int[] values = { 32, 20, 23, 17, 18, 6, 11 };
for (int i = 0; i < values.length; i )
{
chart.chartdata[i 1, 1].numbervalue = values[i];
}
chart.series.serieslabel = chart.chartdata[0, 1, 0, 1];
chart.categories.categorylabels = chart.chartdata[1, 0, 7, 0];
chart.series[0].values = chart.chartdata[1, 1, 7, 1];
ppt.savetofile("output.pptx", spire.presentation.fileformat.pptx2013);
presentation ppt = new presentation();
ppt.loadfromfile(@"input.pptx");
islide slide = ppt.slides[2];
foreach (ishape shape in slide.shapes)
{
if (shape is ichart)
{
ichart chart = shape as ichart;
if (chart.type.equals(charttype.barclustered))
{
for (int i = 1; i < 5; i )
{
chart.chartdata[i, 1].numberformat = "#,##0.00";
}
}
}
}
ppt.savetofile("result.pptx", spire.presentation.fileformat.pptx2013);
问题修复:
- 修复了修改形状文本后,转换后的pdf文件内容不正确的问题。
- 修复了ppt转pdf后,部分内容不正确的问题。
获取spire.presentation 7.2.5请点击:
https://www.e-iceblue.cn/downloads/spire-presentation-net.html