Free Support Forum - aspose.com

Bubble Chart Formating

Dear,


I am using the bellow code to generate a bubble chart:

private void CreateSlide()
{
SlideEx sld = pres.Slides[0];
Aspose.Slides.Pptx.ChartEx lChart = sld.Shapes.AddChart(ChartTypeEx.Bubble, 10, 60, 500, 300);

lChart.HasLegend = false;

TextFrameEx tf = lChart.ValueAxis.TextProperties;
PortionFormatEx port = tf.Paragraphs[0].ParagraphFormat.DefaultPortionFormat;
port.LatinFont = new FontDataEx(“Arial”); //Set the Font for the Portion
port.FontBold = NullableBool.True; //Set Bold property of the Font
port.FontItalic = NullableBool.False; //Set Italic property of the Font
port.FontHeight = 10; //Set the Height of the Font
port.FillFormat.FillType = FillTypeEx.Solid;
port.FillFormat.SolidFillColor.Color = Color.Black;

//tf = lChart.CategoryAxis.TextProperties; <-- this line causes error

lChart.HasTitle = true;
lChart.ChartTitle.Text.Text = “test”;

//lChart.ChartData.Series.Clear(); <-- this code causes error

ChartDataCellFactory fact = lChart.ChartData.ChartDataCellFactory;
lChart.ChartData.Series.Add(fact.GetCell(0, 0, 1, “Series 1”), lChart.Type);

ChartSeriesEx series = lChart.ChartData.Series[0];

series.Format.Fill.FillType = FillTypeEx.Solid;
series.Format.Fill.SolidFillColor.Color = Color.Green;

series.Values.Add(fact.GetCell(0, 1, 0, 10));
series.Values.Add(fact.GetCell(0, 1, 1, -20));
series.Values.Add(fact.GetCell(0, 1, 2, 30));
AddLegendToBubbleChart(series, “1”, 0, 10, “”, System.Drawing.Color.Red);

series.Values.Add(fact.GetCell(0, 2, 0, 15));
series.Values.Add(fact.GetCell(0, 2, 1, -25));
series.Values.Add(fact.GetCell(0, 2, 2, 35));
AddLegendToBubbleChart(series, “2”, 1, 10, “”, System.Drawing.Color.Red);

series.Values.Add(fact.GetCell(0, 3, 0, 20));
series.Values.Add(fact.GetCell(0, 3, 1, 30));
series.Values.Add(fact.GetCell(0, 3, 2, 40));
AddLegendToBubbleChart(series, “3”, 2, 10, “”, System.Drawing.Color.Red);

series.Values.Add(fact.GetCell(0, 4, 0, 25));
series.Values.Add(fact.GetCell(0, 4, 1, 35));
series.Values.Add(fact.GetCell(0, 4, 2, 45));
AddLegendToBubbleChart(series, “4”, 3, 10, “”, System.Drawing.Color.Red);
}

public void AddLegendToBubbleChart(ChartSeriesEx series, string text, int id, int height, string fontName, System.Drawing.Color fontColor)
{
DataLabelEx lbl = new DataLabelEx(series);
lbl.TextFrame.Text = text;
lbl.ShowValue = true;

lbl.Position = LegendDataLabelPositionEx.Center;
for (int i = 0; i < lbl.TextFrame.Paragraphs.Count; i++)
{
PortionFormatEx pt = lbl.TextProperties.Paragraphs[0].ParagraphFormat.DefaultPortionFormat;
pt.FontHeight = 8;
pt.LatinFont = new FontDataEx(fontName);
pt.FillFormat.FillType = FillTypeEx.Solid;
pt.FillFormat.SolidFillColor.Color = fontColor;
}
lbl.Id = id;
series.Labels.Add(lbl);
}

I faced a number of issues, kindly find them bellow:
1- Only 3 bubbles are shown in the presentation and not 4. This is due to the fact that only 3 values are selected in the excel when clicking "Editing Data"
2- i was able to format the Horizontal Axis but not the Vertical Axis since “lChart.CategoryAxis” is always null.
3- i was unable to delete the Major Axis Gridlines
4- Formatting the bubbles labels is not working (this might be due to an error in my code “AddLegendToBubbleChart”, if so please provide me with a code snippet that allows me to format the bubbles labels)
5- is it possible to use percentage instead of values in the vertical and horizontal axis as shown in the attached screenshot? (the percentage in the screenshot has been edited manually)
6- Clearing the default values “lChart.ChartData.Series.Clear();” does not cause a runtime error, but when i open the presentation generated by this caude it shows the following message: “Powerpoint was not able to display some of the text, images, or objects on slide …”.
7- using this line: lChart.HasTitle = false; (which is not mentioned in the above code) does not hide the chart title, but the name of the series is added as title. (the same issue has been observed in multiple chart types including Column charts and Bar charts)

Could you please check the above issues and provide me with an estimation on when these issues could be fixed.

Thank you in advance,
Sami Simon

Hi Sami Simon,


I have worked over the issues shared by you in detail using Aspose.Slides for .NET 7.1.0. I have been able to reproduce some and have not been able to reproduce the others. There are some inconsistencies in your code sample as well that I have corrected. I like to share that while setting the bubble or scattered chart values, one need to set series.XValue and series.YValue rather than series.Value. I will try to address your queries individually for clarity.

ybatsh:
1- Only 3 bubbles are shown in the presentation and not 4. This is due to the fact that only 3 values are selected in the excel when clicking "Editing Data"

I have been able to reproduce the issue and and issue with ID SLIDESNET-34036 has been created to further investigate and resolve the issue.

ybatsh:
2- i was able to format the Horizontal Axis but not the Vertical Axis since “lChart.CategoryAxis” is always null.
3- i was unable to delete the Major Axis Gridlines
I have been able to reproduce the issue and and issue with ID SLIDESNET-34038 has been created to further investigate and resolve the issue. The same is the reason that you are unable to remove Major axis lines as they are also related to category axis. When the issue related to lChart.CategoryAxis will be resolved the properties for removing the Major Axis Lines will get enabled.


ybatsh:
4- Formatting the bubbles labels is not working (this might be due to an error in my code “AddLegendToBubbleChart”, if so please provide me with a code snippet that allows me to format the bubbles labels)

I have not been able to reproduce the issue and have shared the modified working code attached in this post.

ybatsh:
5- is it possible to use percentage instead of values in the vertical and horizontal axis as shown in the attached screenshot? (the percentage in the screenshot has been edited manually)
I have been able to set the percentage number format for Value axis. But since, category axis is not being accessible at the moment and with resolution of SLIDESNET-34038 you will be able to set the same format for category axis values as well.

ybatsh:
6- Clearing the default values “lChart.ChartData.Series.Clear();” does not cause a runtime error, but when i open the presentation generated by this caude it shows the following message: “Powerpoint was not able to display some of the text, images, or objects on slide …”.

I have been able to reproduce the issue and and issue with ID SLIDESNET-34037 has been created to further investigate and resolve the issue.


ybatsh:
7- using this line: lChart.HasTitle = false; (which is not mentioned in the above code) does not hide the chart title, but the name of the series is added as title. (the same issue has been observed in multiple chart types including Column charts and Bar charts)

I have not been able to reproduce the issue. You may please observe the generated presentation in the shared sample project.

We are sorry for your inconvenience,

Dear,


Thank you so much for your reply, I have tried the code attached in your previous email and lots of things became clearer to me. Regarding the Title issue I have attached a screenshot of a chart generated using your code. In the code there is the following command:
lChart.HasTitle = false;
As you can see in the screenshot, the chart is still showing the following text in the title: “Series 1”.
My question was: Is there any way to completely remove the chart title?

Thank you in advance
Sami Simon

Hi Sami Simon,


Please observe the shared image and presentation. The presentation has been generated exactly by the same code that I have shared with you over this link. You can see from the image that there is no chart title at all. I have used Aspose.Slides for .NET 7.1.0 on my end. Can you please try using the sample project shared with the mentioned product version as I have not been able to reproduce the issue specified.

I have opened presentation in both PowerPoint 2010 and PowerPoint 2013 to verify the issue.

Many Thanks,

Hi Mudassir,


Thank you for the close follow-up with my collegue Sami Simon on above issue. I would like you to know that we are in tight schedule on the project associated with below bugs (bubble chart)

SLIDESNET-34036 [ Very URGENT as it is a blocking issue]
SLIDESNET-34037
SLIDESNET-34038

I appreciate that your mark these as high priority in the upcoming version. Do you have a date for the next release?

Thank you,

Yasser,

HI Yasser,


I have verified the mentioned issues status from our issue tracking system and regret to share that there are no updates available related to status of issues as they are still in waiting queue.

Actually, as per Aspose policy, the high priority is given to paid support issues added in Aspose.Priority and Aspose.Enterprise forums. First of all the paid support issues are scheduled for investigation and resolution. Then issues added in normal support forums, Aspose.Slides and Aspose.Total are considered for investigation on first come and first serve basis. After investigation of normal support issues, they are scheduled for resolution based on their complexity. Since, your issues are added in normal support forum and also created recently, they are still in waiting queue. As soon as our development team will schedule the issue for investigation and share the information, I will be obliged to pass the information to you.

I also like to add that our new release is expected to be released during next week hopefully.

Many Thanks,

Hi Mudassir,


Thank you for your note.

I believe that blocking issue should be treated with priority as well. The bubble chart is non functional at all in the way it currently works.

I appreciate if you escalate this issue to priority queue.

Thanks again,

Yasser

Hi Yasser,


I have raised the priority of the issue SLIDESNET-34036 to High and have requested our development team to kindly schedule the issue. I will share the further information with you as soon as the issue will be scheduled by our development team.

Many Thanks,

Thanks a lot Mudassir,


Appreciated.

Yasser

Dear,


Could you please provide me an estimation on when each of the bellow issues will be fixed, cause I need to schedule the project with the client based on these estimations:

- SLIDESNET-34036
- SLIDESNET-34037
- SLIDESNET-34038

Thank you for your understanding,
Sami Simon

Hi Sami Simon,


I have discussed the issues status with our development team and the concerned issues are scheduled for investigation during Week 12/2013. We will be able to share the further updates with you as soon as the feedback will be shared by our development team after their investigation.

Many Thanks,

Hi Sami Simon,


I like to share that the issue SLIDESNET-34036 has been resolved in Aspose.Slides for .NET. I have attached the modified sample code and generated presentation that will serve the purpose for you. Please share, if I may help you further in this regard. I will also share the product notification with you as soon as it will be shared online.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-34036;SLIDESNET-34037;SLIDESNET-34038) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Dear,


I have downloaded and added ASPose.Slide version 7.3 to my application and retired the same code provided in my first message. I experienced the bellow problems:

1- tf1 = lChart.CategoryAxis.TextProperties; the following line is still causing the same error since CategoryAxis is still = null
2- Although I am able to see all the bubbles that I added and not only 3, when I right click on the chart and click “Edit Data…” nothing happens, and the excel document to edit the chart values is not opened.

Kindly advise on the above,

Regards,
Sami Simon

Hi Sami Simon,


I have observed the feedback shared by you and like to share that lChart.CategoryAxis.TextProperties returning null for Bubble chart is in fact not issue. For Bubble chart, you can only have ValueAxis. For sake of reference, create a chart with Type ClusteredColumn and you will be observe that TextProperties for CategoryAxis will not return null.

I have been able to observe the issue of chart data failing to get edited in PowerPoint and have added a regression issue with ID SLIDESNET-34179 in our issue tracking system for further investigation and resolution. This thread has been linked with the issue so that you nay be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

Dear Mudassir,


Thank you for your reply. As i understood from your last post that bubble charts can only have ValueAxis and they do not have CategoryAxis, for this cause LChart.CategoryAxis is always null. So here is my question, kindly refer to the attached screenshot in my first post “bubble chart.png” you can see 2 axis, one vertical and one horizontal. The horizontal axis is formatted (FontHeight = 10 and FontBold = true), how can I format the vertical axis to be exactly like the horizontal one. As you can also realize, there are also several horizontal lines (MajorGridLines) that I also need to remove them. Kindly share with me a code snippet that serves my request.

Thank you for you support,
Sami Simon

Hi Sami Simon,


Please try using the following sample code lines in your sample application. I am hopeful things will work on your end.

tf = lChart.SecondValueAxis.TextProperties;
tf.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.FillType = FillTypeEx.Solid;
tf.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.SolidFillColor.Color = Color.Red;


tf = lChart.ValueAxis.TextProperties;
tf.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.FillType = FillTypeEx.Solid;
tf.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.SolidFillColor.Color = Color.Green;


Many Thanks,

The issues you have found earlier (filed as SLIDESNET-34179) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.