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.

Thu Mar 26, 2015 7:49 pm

Hi,
I have downloaded Spire Presentation for trial/evaluation purpose. I am trying to use the demo that shows how to insert chart into powerpoint ( Insert-chart-in-PPT-document.html ). Can you please provide me the sample XML file used in this demo so that I know how to format my data table and use it my code. I am specifically looking for "data-schema.xml" and "data.xml".

Also if you have another non-xml example showing how to have data in data table and plot the chart that will be very useful too.

Thanks
Thameez

ethahaj
 
Posts: 14
Joined: Thu Mar 26, 2015 3:23 pm

Fri Mar 27, 2015 9:15 am

Dear Thameez,

Here are the two documents in the attachment you need. And there is a demo loads data from Access, please check it.

Best Regards,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Fri Mar 27, 2015 9:47 pm

Thanks Betsy. I was able to plot my chart now using your samples.

I have two follow-up questions.

- I am trying to set the primary axis title, but it is not getting displayed.
- I am trying to plot a series on the secondary axis but I can't find the "UseSecondAxis" property show up. I have attached the code I am using.

private Sub TestChart
Dim pres As New Presentation()
'insert chart
Dim rect As New RectangleF(pres.SlideSize.Size.Width / 2 - 200, 0, 400, 250)
Dim chart As IChart = pres.Slides(0).Shapes.AppendChart(Spire.Presentation.Charts.ChartType.ColumnClustered, rect)

'add chart Title
chart.ChartTitle.TextProperties.Text = "Report"
chart.ChartTitle.TextProperties.IsCentered = True
chart.ChartTitle.Height = 30
chart.HasTitle = True
chart.PrimaryCategoryAxis.TextRotationAngle = 270
chart.ChartLegend.Position = ChartLegendPositionType.Bottom
chart.PrimaryValueAxis.Title.IsOverlay = False
chart.PrimaryValueAxis.Title.TextProperties.Text = "Primary Axis"

'load data from XML file to datatable
Dim dataTable As System.Data.DataTable = LoadData()

'load data from datatable to chart
InitChartData(chart, dataTable)

chart.Series.SeriesLabel = chart.ChartData("B1", "C1")
chart.Categories.CategoryLabels = chart.ChartData("A2", "A4")
chart.Series(0).Values = chart.ChartData("B2", "B4")
chart.Series(0).Fill.FillType = FillFormatType.Solid
chart.Series(0).Fill.SolidColor.KnownColor = KnownColors.Brown

chart.Series(1).Values = chart.ChartData("C2", "C4")
chart.Series(1).Fill.FillType = FillFormatType.Solid
chart.Series(1).Fill.SolidColor.KnownColor = KnownColors.Green

End Sub


Private Function LoadData() As System.Data.DataTable
Dim dt As System.Data.DataTable
Dim dr As System.Data.DataRow

dt = New System.Data.DataTable

dt.Columns.Add("Date", GetType(String))
dt.Columns.Add("Series 1", GetType(Double))
dt.Columns.Add("Series 2", GetType(Double))

dr = dt.NewRow
dr(0) = "03/23/2015"
dr(1) = 10
dr(2) = 25
dt.Rows.Add(dr)

dr = dt.NewRow
dr(0) = "03/24/2015"
dr(1) = 20
dr(2) = 50
dt.Rows.Add(dr)

dr = dt.NewRow
dr(0) = "03/25/2015"
dr(1) = 30
dr(2) = 75
dt.Rows.Add(dr)

Return dt
End Function

'function to load data from DataTable to IChart
Private Sub InitChartData(ByVal chart As IChart, ByVal dataTable As System.Data.DataTable)
For c As Integer = 0 To dataTable.Columns.Count - 1
chart.ChartData(0, c).Text = dataTable.Columns(c).Caption
Next

For r As Integer = 0 To dataTable.Rows.Count - 1
Dim data As Object() = dataTable.Rows(r).ItemArray
For c As Integer = 0 To data.Length - 1
chart.ChartData(r + 1, c).Value = data(c)
Next
Next
End Sub

ethahaj
 
Posts: 14
Joined: Thu Mar 26, 2015 3:23 pm

Mon Mar 30, 2015 6:07 am

Hello,

Q1 Please refer to following codes:
Code: Select all
chart.PrimaryValueAxis.HasTitle = true;
chart.PrimaryValueAxis.Title.TextProperties.Text = "Primary Axis";

Q2 There is not “UseSecondAxis” property in Free Spire. Presentation. Please download the commercial version from the following link and have a try:
http://www.e-iceblue.com/Download/downl ... t-now.html

If there are any questions, welcome to get it back to us.

Best Regards,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Tue Mar 31, 2015 7:31 am

Hello,

Has your issue been resolved? Could you please give us some feedback at your convenience?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Wed Apr 01, 2015 8:15 pm

Hi Betsy,
I am yet to try with the new dlls. But the axis title now works. Will let you know about the secondary axis.
Thanks for your assistance.
Regards,
Thameez

ethahaj
 
Posts: 14
Joined: Thu Mar 26, 2015 3:23 pm

Wed Apr 01, 2015 9:44 pm

Hi Betsy,
I downloaded the installer from your link and imported the dlls under this folder (C:\Program Files (x86)\e-iceblue\spire.presentation\Bin\NET4.0) to my project.
I am still unable to find the "UseSecondAxis" property. I am using VB.NET and I use the chart.series(0).... command.
Am I still missing something?
Thanks
Thameez

ethahaj
 
Posts: 14
Joined: Thu Mar 26, 2015 3:23 pm

Thu Apr 02, 2015 1:53 am

Hello,

Please download Spire. Presentation Pack Hotfix Version: 2.2.17 from the following link and try again:
http://www.e-iceblue.com/downloads/hot_ ... 2.2.17.zip
If there are any questions, welcome to get it back to us.

Best Regards,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Thu Apr 02, 2015 3:53 pm

Thanks for providing the new dlls. Now, I am able to plot on the second axis.

I noticed that the application crashes when I try to set the title for the secondary axis. I tried using the following commands.

chart.SecondaryValueAxis.HasTitle = True
chart.SecondaryValueAxis.Title.TextProperties.Text = "Secondary Axis"

ethahaj
 
Posts: 14
Joined: Thu Mar 26, 2015 3:23 pm

Fri Apr 03, 2015 6:36 am

Hello,

Sorry that at present the Spire. Presentation can’t support to add the secondary axis title when creat new PPT document. It only supports to add a secondary axis title in an existing one which also has secondary axis. And we have added this feature in our schedule, if there are any processes, we will let you know.

Best Regards,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Fri Apr 03, 2015 2:23 pm

Hi Betsy,
Thanks for your reply. Can you please clarify for me further about your statement that "It only supports to add a secondary axis title in an existing one which also has secondary axis. "
I don't fully understand it.
Regards,
Thameez

ethahaj
 
Posts: 14
Joined: Thu Mar 26, 2015 3:23 pm

Mon Apr 06, 2015 9:22 am

Hello,

Sorry for late reply as weekend. It means that at present we can only add the secondary axis title for the secondary axis which has existed in the chart. It is unable to add when we create new secondry axis. Hope you can get it.
Please contact us if you have any questions or needs.
SIncerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Mon Apr 06, 2015 3:35 pm

Thanks Gary for your response. Do you have a view as to when this feature will be made available as I would like to be notified about its availability.

ethahaj
 
Posts: 14
Joined: Thu Mar 26, 2015 3:23 pm

Tue Apr 07, 2015 2:18 am

Hello,

Sorry that I can’t give you the established time. Our dev team is working on this new feature, once it has been done, we will let you know immediately.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Thu Apr 16, 2015 6:07 am

Hello,

Sorry for keep you waiting.
Now the issue been resolved, the newest version( Spire.Presentation V2.2.22) has been released, please download it from the following link and have a try:
http://www.e-iceblue.com/Download/downl ... t-now.html
Codes for your reference:
Code: Select all
chart.SecondaryValueAxis.HasTitle = true;
chart.SecondaryValueAxis.Title.TextProperties.Text = "Secondary Axis";


Best Regards,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.Presentation