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.

Tue Aug 09, 2022 4:25 pm

Hi,

I have a xy scatter chart, how do I set the min and max scale for both x and y axis. If you could share a code snippet that'd be great.

Thanks

majeed_s
 
Posts: 69
Joined: Thu Mar 25, 2021 4:13 pm

Wed Aug 10, 2022 8:41 am

Hello majeed_s,

Thanks for your inquiry.
Please refer to the below sample code to set the min and max scale. If there is any issue when you test your file, please share us with your PPT file for further investigation. You can attach it here or send it to us via email(support@e-iceblue.com).

Code: Select all
//Create a PowerPoint document.
Presentation presentation = new Presentation();
//Load the file from disk.
presentation.LoadFromFile(@"input.pptx");
//Get the chart from the presentation.
IChart chart = presentation.Slides[0].Shapes[0] as IChart;
//Settings
chart.PrimaryValueAxis.IsAutoMax = false;
chart.PrimaryValueAxis.IsAutoMin = false;
chart.SecondaryValueAxis.IsAutoMax = false;
chart.SecondaryValueAxis.IsAutoMin = false;
chart.PrimaryValueAxis.MaxValue = 20;
chart.PrimaryValueAxis.MinValue = 0;
chart.SecondaryValueAxis.MaxValue = 20;
chart.SecondaryValueAxis.MinValue = 0;
//Save to file.
presentation.SaveToFile(@"output.pptx", Spire.Presentation.FileFormat.Pptx2013);


Sincerely,
Simple
E-iceblue support team
Last edited by Simple.Li on Thu Aug 18, 2022 6:36 am, edited 1 time in total.
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Mon Aug 15, 2022 6:42 am

Hello majeed_s,

Could you please let us know how is your issue going? Thanks in advance for your feedback and time.

Sincerely,
Simple
E-iceblue support team
Last edited by Simple.Li on Thu Aug 18, 2022 6:37 am, edited 1 time in total.
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Wed Aug 17, 2022 2:20 pm

This issue is solved. Please remove my full name from your posts. I don't want my personal details highlighted.

Thanks!

majeed_s
 
Posts: 69
Joined: Thu Mar 25, 2021 4:13 pm

Thu Aug 18, 2022 6:37 am

Hello Majeed_s,

Thanks for your message.
We apologize for the inconvenience caused to you. We have changed the name. If you have any further questions, please feel free to contact us.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Return to Spire.Presentation

cron