Scatter with markers label help

As can be seen on slide 1 of the presentation is the output graph which is returned to me from the code and slide two is the graph that is the output wanted… If you left click on the graph in slide one the labels are present on in the graph data but not being displayed. the code that i have used is below would like to know why this would be the case.


int catIndex = 1;
ChartDataCellFactory fact = chart.ChartData.ChartDataCellFactory;
ChartSeriesEx series = chart.ChartData.Series[0];

for (int i = 0; i < 10; i++)
{
string insertedValueair = extractedData.Rows[i][valuesUsed[2]].ToString();
string insertedValue = extractedData.Rows[i][valuesUsed[5]].ToString();
string[] catName = extractedData.Rows[i][valuesUsed[0]].ToString().Split(’[’, ‘]’);
string cat = catName[1];

if (insertedValue.Equals("-") || insertedValue.Equals(""))
{
insertedValue = “0”;
}

if (insertedValueair.Equals("-") || insertedValueair.Equals(""))
{
insertedValueair = “0”;
}
fact.GetCell(0, catIndex, 0, cat);
catIndex++;

fact.GetCell(0, 0, 1, “AIR”);
fact.GetCell(0, 0, 2, “Index”);

series.XValues.Add(fact.GetCell(0, i + 1, 1, Math.Round(Convert.ToDouble(insertedValueair), MidpointRounding.AwayFromZero)));
series.YValues.Add(fact.GetCell(0, i + 1, 2, Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero)));
}
catIndex = 0;

Hi Jimmy,


I have observed your requirements and like to share that the labels for charts points the way you are trying to set is not even possible with PowerPoint. You need to add the labels in custom manner. I have created a sample application for your convenience. There is one minor issue that I have observed is that while setting custom labels, the showLegendKey property remains set in generated chart even if I set that to false in code. I have created an issue with ID SLIDESNET-33884 to further investigate and resolve this issue. We will share the notification with you as soon as the the issue will be resolved.

Many Thanks,

so can you give me an example of how to set it though the use of code

Hi Jimmy,


I have shared the sample example with you in my previous post with name ScatterChart.zip. Please use the application for your convenience.

Many Thanks,

can u give me the link to it because i cant find it

it still doenot work with the code that i have got…


Hi Jimmy,


Can you please share in the form of the presentation that what is not working. In my understanding your requirement was to add custom labels to scatter chart points. I have shared the solution with you along with generated presentation. Can you please share explicitly what is missing and also share the generated presentation.

Many Thanks,

when i run the code that you have given in my code with my data all i see on the page is an emtpy square once it has been run

Hi Jimmy,


As you may have observed in my shared sample project, the generated presentation produced the chart as per your requirements. If you are getting some chart rendering issue on your end with your data in my code then I may suggest you to please try modifying the data injected in the format I have added the data in my sample table. You can debug that on your end. Otherwise, please share a sample application with your data sample filled in table and I may try on my end. Without provision of your data it is unfortunately not possible for me to help you further.

Many Thanks,

hi,


I am trying to run the code that u have got and every time i try running this program it fails

Hi Harish,


Thanks for inquiring Aspose.Slides.

Can you please share that what issue you are having on your end and using which code. Please share the issue details with us so that I may help you further in this regard. I have shared the sample project in this thread that you can use on your end. Please share if I may help you further in this regard.

Many Thanks,

no chart is being displyed in the out put

Hi Harish,


Please observe the shared snapshot and generated presentation for your kind reference that I have generated using Aspose.Slides for .NET 7.0.0 with sample code shared here. You can observe from image and generated presentation that there is chart in output. If there is still an issue on your end then please share the complete information along with generated presentation, snapshot and any source presentation used on your end. I will try to help you further in this regard.

Many Thanks,
this is the code that i am using

ChartDataEx data = chart.ChartData;
ChartDataCellFactory fact = chart.ChartData.ChartDataCellFactory;
ChartSeriesEx series = chart.ChartData.Series[0];
int catIndex = 1;

for (int i = 0; i < 10; i++)
{
string insertedValueair = extractedData.Rows[i][valuesUsed[2]].ToString();
string insertedValue = extractedData.Rows[i][valuesUsed[5]].ToString();
string[] catName = extractedData.Rows[i][valuesUsed[0]].ToString().Split('[', ']');
string label = catName[1];

fact.GetCell(0, 0, 1, "AIR");
fact.GetCell(0, 0, 2, "Index");


fact.GetCell(0, catIndex, 0, label);
// series.NameCells.Add(fact.GetCell(0, catIndex, 0, label));

series.Labels[i].Equals(label);
catIndex++;
series.XValues.Add(fact.GetCell(0, i + 1, 1, Math.Round(Convert.ToDouble(insertedValueair), MidpointRounding.AwayFromZero)));
series.YValues.Add(fact.GetCell(0, i + 1, 2, Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero)));
DataLabelEx temLab = new DataLabelEx(series);
temLab.TextFrame.Text = "";
PortionFormatEx format = temLab.TextFrame.Paragraphs[0].ParagraphFormat.DefaultPortionFormat;
format.FontHeight = 10;
temLab.TextFrame.Paragraphs[0].Portions[0].Text = label;
temLab.Id = i;
//series.Labels.ShowCategoryName.Equals(label);

series.Labels.Add(temLab);
series.Labels[i].LinkedSource = false;
series.Labels[i].ShowLegendKey = false;
series.Labels[i].ShowBubbleSize = false;
series.Labels[i].ShowCategoryName = false;
series.Labels[i].ShowPercentage = false;
series.Labels[i].ShowSeriesName = false;
series.Labels[i].ShowValue = false;
}
series.Labels.ShowLegendKey = false;
series.Labels.ShowBubbleSize = false;
series.Labels.ShowCategoryName = false;
series.Labels.ShowPercentage = false;
series.Labels.ShowSeriesName = false;
series.Labels.ShowValue = false;
series.Labels.LinkedSource = false;


and the output that i get with the code provided is shown on the pgn file.
Once i set one of the flases to true the page works fine but there is no tags being added

Hi Harish,


I have observed the sample code and image file shared by you. Unfortunately, I am unable to use the sample code shared by you as it is representing some part of code but not complete. Please share a working sample project along with source presentation and generated presentation. Please also share the target presentation by creating in PowerPoint that you want to generate using Aspose.Slides. Once you will share the requested information, I will try my best to help you further.

Many Thanks,

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