Free Support Forum - aspose.com

How to generate BoxandWhisker chart using ppt template in mvc technology?

Hi Aspose Team,

I got notification that now latest version of aspose.slide is support boxandwhisker chart. Can i have sample code to generete boxandwhisker chart using ppt template in mvc technology using c#?

Thanks.

@sdtechsupport.sirius,

I have observed your requirements and suggest you to please try using sample example provided over this documentation link.

Thanks for giving documentation link.

I have gone through documentation link code and found that box and whisker is being plotted by passing data(row data) instead of Calculated data i.e Q1, median, Q3, min, max. Can you please provide sample code for calculated data.

@sdtechsupport.sirius,

I have observed your comments and have not been able to completely understand your requirements. Can you please share the sample presentation and snapshot exhibiting your requirements. I shall investigate the issue further on my end to help you.

Hi Mudassir,

Link of sample code that you have given earlier was plotting box and whisker by internally calculating Q1, Median, Q3, Min, Max value and according to generate box and whisker. But what if i want to generate box and whisker from calculated data ( Q1, Median, Q3, Min, Max) that i have attached here. Please find attachment. Attachment contain two sheet. First is sample code data that is provided by you and second is calculated data from which i want to generate box and whisker.
BoxAndWhisker.zip (7.5 KB)

@sdtechsupport.sirius,

I have observed your comments. Can you please share your requirements in form of presentation so that we may further investigate to help you out.

Hi Adnan,

I have attached chart image and data sheet. I want to plot box and whisker chart as per attached chart from the attached data sheet. Please suggest.
BoxAndWhisker.zip (40.9 KB)

@sdtechsupport.sirius,

I have observed your comments. I like to inform that we have investigated your requirements on our end and Since Aspose.Slides 18.4 we are supporting ChartType.BoxAndWhisker and it calсulates all that (Q1, Median, Q3, Min, Max) values itself. if data already calculated you can built BoxAndWhiskerChart by combining different series types and elements like: bar series, error bars, markers etc. In this case just google how to build BoxAndWhisker chart in Excel and do the same things in Slides. Also please check this link for your kind reference.

Hi Aspose Team,

I have try to generate box and whisker chart using attached image code that is given by you in documentation link and it’s working fine. When i try to generate same chart by commenting highlighted code in attached image, it’s giving me “Index was out of range. Must be non-negative and less than the size of the collection.” error. Can you please suggest me how to generate box and whisker chart when you have less data range.
BoxAndWhisker.png (41.8 KB)

@sdtechsupport.sirius,

I have observed the image shared by you and request you to please share the working sample project that is reproducing issue on your end. Please do highlight in your .CS file that commenting which portion of code throw issue on your end.

I have attach sample application and also added comment into Program.cs file to know which part of code will throw error. To run sample application you require to install Aspose.Slides.NET 18.4.0 version. Please find attachment.
Also i want to know how to change color of mean markers.
Please suggest.
ConsoleApp.zip (263.1 KB)

@sdtechsupport.sirius,

Thank you for sharing the information with us. I have been able to reproduce the issue on my end and an issue with ID SLIDESNET-40141 has been created in our issue tracking system for further investigation and resolution. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed. For the time being, if you use atleast 3 categories in chart there is no issue.

Right Now, Aspose.Slide doesn’t plot any thing into chart if i try to generate box and whisker chart having same value to all category. I want to indicate line and marker when having same value as it does if having different value. Please find attached sample application and image of expected result.
ConsoleApp.zip (305.1 KB)
ExpectedResult.png (16.5 KB)

@sdtechsupport.sirius,

I have worked with the sample project shared by you and have tried to understand your requirements from image as well. I have also observed your following requirements as well.

For your kind reference, I have attached a sample presentation that is representing a chart on slide generated using your code and on slide 2, a similar chart generated using PowerPoint 2016 and conforming your requirements. You can see that even chart generated using PowerPoint 2016 exhibits same behavior and show nothing when all values are similar. If you are able to achieve your requirements in PowerPoint then please share a sample presentation conforming to your requirements and we shall investigate that further on our end.

BoxAndWhisker.zip (45.6 KB)

Hi mudassir,

By setting maximum of axis bound to greater than our max value we can achieve this. i.e our value is 15 so we set maximum bound to 20 and it’s showing line indicator as per pointed in left side chart.

Please find attached image for same.
BoxAndWhisker.png (35.4 KB)

@sdtechsupport.sirius,

I suggest you to please add following sample code in your application.

            // Setting chart maximum, minimum values
            chart.Axes.VerticalAxis.IsAutomaticMajorUnit = false;
            chart.Axes.VerticalAxis.IsAutomaticMaxValue = false;
            chart.Axes.VerticalAxis.IsAutomaticMinorUnit = false;
            chart.Axes.VerticalAxis.IsAutomaticMinValue = false;

            chart.Axes.VerticalAxis.MaxValue = 20;
            chart.Axes.VerticalAxis.MinValue = 0f;
            chart.Axes.VerticalAxis.MinorUnit = 1.0f;
            chart.Axes.VerticalAxis.MajorUnit = 2.0f;

Hi Mudassir,

I have generated box and whisker PPT using latest version of aspose.slide. Issue is it not plotting third series properly. when I open it in powerpoint and reselect data range it’s work properly. can you me suggest how to resolve this issue. I have attached template PPT(Frist Slide) and generated PPT(Second Slide) you can see data of generated PPT by using edit data option.
BoxAndWhisker.zip (65.1 KB)

@sdtechsupport.sirius,

I have observed the information shared by you and request you to please share the working sample project reproducing the issue on your end so that we may log investigation in our issue tracking system for resolution.

The issues you have found earlier (filed as SLIDESNET-40141) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by mudassir.fayyaz