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.
Wed Jul 10, 2024 7:19 am
Can you please provide an example of Radar chart creation using Spire.Presentation and I need to know how to fill the plot area of Radar Graph
Last edited by
praveenkasani on Wed Jul 10, 2024 9:29 am, edited 1 time in total.
-

praveenkasani
-
- Posts: 14
- Joined: Mon Mar 04, 2024 11:21 am
Wed Jul 10, 2024 9:11 am
Hi,
Thank you for your inquiry.
Please refer to code below to create the Radar chart in PowerPoint and fill the background of Radar Graph. If there's still any issue, please provide your input file and desired effect file for our further investigation. Thanks in advance!
- Code: Select all
// Create presentation object
Presentation ppt = new Presentation();
ISlide slide = ppt.Slides[0];
RectangleF rect = new RectangleF(90, 100, 550, 320);
IChart chart = slide.Shapes.AppendChart(ChartType.Radar, rect, false);
chart.ChartTitle.TextProperties.Text = "Radar Chart";
chart.ChartTitle.TextProperties.IsCentered = true;
chart.ChartTitle.Height = 20;
chart.HasTitle = true;
// Set background of chart
chart.Fill.FillType = FillFormatType.Solid;
chart.Fill.SolidColor.Color = Color.DarkCyan;
// Set value
chart.ChartData[1, 0].Value = "A";
chart.ChartData[2, 0].Value = "B";
chart.ChartData[3, 0].Value = "C";
chart.ChartData[1, 1].Value = 3;
chart.ChartData[2, 1].Value = 2.5;
chart.ChartData[3, 1].Value = 2.6;
chart.Series.SeriesLabel = chart.ChartData["B1", "B1"];
chart.Categories.CategoryLabels = chart.ChartData["A2", "A5"];
chart.Series[0].Values = chart.ChartData["B2", "B5"];
// Set color of line
chart.Series[0].Line.FillType = FillFormatType.Solid;
chart.Series[0].Line.SolidFillColor.Color = Color.CadetBlue;
// Set the background of graph
chart.PlotArea.Fill.FillType = FillFormatType.Solid;
chart.PlotArea.Fill.SolidColor.Color = Color.Tan;
chart.ChartLegend.DeleteEntry(0);
ppt.SaveToFile("RadarChart.pptx", Spire.Presentation.FileFormat.Pptx2013);
Sincerely,
Doris
E-iceblue support team
-


Doris.Liu
-
- Posts: 460
- Joined: Mon Nov 07, 2022 8:10 am
Wed Jul 10, 2024 9:55 am
Hi Team,
Thanks for your reply. I think I didn't ask you the correct question, I need to fill the plot area within the data points similar to the attached image(within the blue line).
Can you please provide the required example?
Thanks in Advance!!!
Login to view the files attached to this post.
-

praveenkasani
-
- Posts: 14
- Joined: Mon Mar 04, 2024 11:21 am
Thu Jul 11, 2024 6:13 am
Hi,
Please refer to code below to create RadarFilled and set the background of the Radar graph part. If there's still any issue, welcome to contact us again.
- Code: Select all
// Create presentation object
Presentation ppt = new Presentation();
ISlide slide = ppt.Slides[0];
RectangleF rect = new RectangleF(90, 100, 550, 320);
// RadarFilled
IChart chart = slide.Shapes.AppendChart(ChartType.RadarFilled, rect, false);
chart.ChartTitle.TextProperties.Text = "Radar Chart";
chart.ChartTitle.TextProperties.IsCentered = true;
chart.ChartTitle.Height = 20;
chart.HasTitle = true;
// Set background of chart
chart.Fill.FillType = FillFormatType.Solid;
chart.Fill.SolidColor.Color = Color.DarkCyan;
// Set value
chart.ChartData[1, 0].Value = "A";
chart.ChartData[2, 0].Value = "B";
chart.ChartData[3, 0].Value = "C";
chart.ChartData[1, 1].Value = 3;
chart.ChartData[2, 1].Value = 2.5;
chart.ChartData[3, 1].Value = 2.6;
chart.Series.SeriesLabel = chart.ChartData["B1", "B1"];
chart.Categories.CategoryLabels = chart.ChartData["A2", "A5"];
chart.Series[0].Values = chart.ChartData["B2", "B5"];
// Set color of line
chart.Series[0].Line.FillType = FillFormatType.Solid;
chart.Series[0].Line.SolidFillColor.Color = Color.CadetBlue;
// Set the background of graph
chart.PlotArea.Fill.FillType = FillFormatType.Solid;
chart.PlotArea.Fill.SolidColor.Color = Color.Tan;
// Set the graph
chart.Series[0].Fill.FillType = FillFormatType.Solid;
chart.Series[0].Fill.SolidColor.Color = Color.Black;
chart.ChartLegend.DeleteEntry(0);
ppt.SaveToFile("RadarChart.pptx", Spire.Presentation.FileFormat.Pptx2013);
Sincerely,
Doris
E-iceblue support team
-


Doris.Liu
-
- Posts: 460
- Joined: Mon Nov 07, 2022 8:10 am
Fri Jul 12, 2024 5:55 am
Hi Doris,
Thanks for the reply and this works for me. I need to select chartType as RadarFilled instead of Radar.
-

praveenkasani
-
- Posts: 14
- Joined: Mon Mar 04, 2024 11:21 am
Fri Jul 12, 2024 8:02 am
Hi,
Thank you for your feedback. I'm glad my response was helpful to you. If you have any further questions in the future, please feel free to contact us anytime.
Sincerely,
Doris
E-iceblue support team
-


Doris.Liu
-
- Posts: 460
- Joined: Mon Nov 07, 2022 8:10 am
Tue Jul 16, 2024 5:49 am
Hi Doris,
I have a requirement for Radar filled graph with three columns(Series). I'm attaching the image, Please let us know if this is possible using Spire.Presentation and If it is possible, provide example code.
Thanks for your help in Advance !!!.
Login to view the files attached to this post.
-

praveenkasani
-
- Posts: 14
- Joined: Mon Mar 04, 2024 11:21 am
Tue Jul 16, 2024 7:44 am
Hello,
Thanks for your inquiry.
Please refer to the following code to draw a radar chart containing three series. If you have any questions, please feel free to write back.
- Code: Select all
// Create presentation object
Presentation ppt = new Presentation();
ISlide slide = ppt.Slides[0];
RectangleF rect = new RectangleF(90, 100, 550, 320);
// RadarFilled
IChart chart = slide.Shapes.AppendChart(ChartType.RadarFilled, rect, false);
chart.ChartTitle.TextProperties.Text = "Radar Chart";
chart.ChartTitle.TextProperties.IsCentered = true;
chart.ChartTitle.Height = 20;
chart.HasTitle = true;
// Set background of chart
chart.Fill.FillType = FillFormatType.Solid;
chart.Fill.SolidColor.Color = Color.DarkCyan;
// Set value
chart.ChartData[1, 0].Value = "15-24";
chart.ChartData[2, 0].Value = "25-34";
chart.ChartData[3, 0].Value = "35-44";
chart.ChartData[4, 0].Value = "45-54";
chart.ChartData[5, 0].Value = "55-64";
chart.ChartData[6, 0].Value = "65+";
chart.ChartData[1, 1].Value = 16;
chart.ChartData[2, 1].Value = 24;
chart.ChartData[3, 1].Value = 28;
chart.ChartData[4, 1].Value = 12;
chart.ChartData[5, 1].Value = 15;
chart.ChartData[6, 1].Value = 24;
chart.ChartData[1, 2].Value = 20;
chart.ChartData[2, 2].Value = 24;
chart.ChartData[3, 2].Value = 12;
chart.ChartData[4, 2].Value = 21;
chart.ChartData[5, 2].Value = 24;
chart.ChartData[6, 2].Value = 22;
chart.ChartData[1, 3].Value = 28;
chart.ChartData[2, 3].Value = 11;
chart.ChartData[3, 3].Value = 10;
chart.ChartData[4, 3].Value = 10;
chart.ChartData[5, 3].Value = 10;
chart.ChartData[6, 3].Value = 24;
chart.Series.SeriesLabel = chart.ChartData["B1", "D1"];
chart.Categories.CategoryLabels = chart.ChartData["A2", "A7"];
chart.Series[0].Values = chart.ChartData["B2", "B7"];
chart.Series[1].Values = chart.ChartData["C2", "C7"];
chart.Series[2].Values = chart.ChartData["D2", "D7"];
// Set color of line
chart.Series[0].Line.FillType = FillFormatType.Solid;
chart.Series[0].Line.SolidFillColor.Color = Color.CadetBlue;
// Set the background of graph
chart.PlotArea.Fill.FillType = FillFormatType.Solid;
chart.PlotArea.Fill.SolidColor.Color = Color.Tan;
// Set the graph
chart.Series[0].Fill.FillType = FillFormatType.Solid;
chart.Series[0].Fill.SolidColor.Color = Color.Black;
chart.Series[1].Fill.FillType = FillFormatType.Solid;
chart.Series[1].Fill.SolidColor.Color = Color.Gray;
chart.Series[2].Fill.FillType = FillFormatType.Solid;
chart.Series[2].Fill.SolidColor.Color = Color.Red;
ppt.SaveToFile("RadarChart.pptx", Spire.Presentation.FileFormat.Pptx2010);
Sincerely,
William
E-iceblue support team
-


William.Zhang
-
- Posts: 762
- Joined: Mon Dec 27, 2021 2:23 am
Tue Jul 16, 2024 2:04 pm
Hi Williams,
Thanks for this and this made my day(this example works perfect for my data). Could you also please let me know how we can reduce the size, recolor the data labels i.e.
- Code: Select all
chart.ChartData[1, 0].Value = "15-24";
// this is from above example code.
I want to change the font size, color, etc.. of '15-24'
Thanks in Advance!!!
-

praveenkasani
-
- Posts: 14
- Joined: Mon Mar 04, 2024 11:21 am
Wed Jul 17, 2024 7:33 am
Hello,
Thanks for your reply.
Please add the following code to set the font, size and color for "15-24'". If you have any other requirements, please reply to let us know.
- Code: Select all
chart.PrimaryCategoryAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.LatinFont = new TextFont("Arial");
chart.PrimaryCategoryAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.FontHeight = 22;
chart.PrimaryCategoryAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.Fill.FillType = FillFormatType.Solid;
chart.PrimaryCategoryAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.Fill.SolidColor.Color = Color.Red;
Sincerely,
William
E-iceblue support team
-


William.Zhang
-
- Posts: 762
- Joined: Mon Dec 27, 2021 2:23 am