We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to: two series with different radar types in the same chart

Thread ID:

Created:

Updated:

Platform:

Replies:

101469 Oct 26,2011 01:08 PM Nov 1,2011 12:13 AM ASP.NET Web Forms (Classic) 3
loading
Tags: XlsIO
Dor Rotman
Asked On October 26, 2011 01:08 PM

Hello,
I'm trying to create a chart that contains two series - one is of type Radar and the other of type Radar_Filled.

The output is that both series have the same type.

Here is the code for the console app, I based it on your sample. (also attached if more convenient)
I am using Syncfusion.XlsIO.Web 9.304.0.61

Thanks!
Dor.



using System.IO;
using Syncfusion.XlsIO;

namespace TestingXlsioTwoRadarTypes {
class Program {
static void Main(string[] args) {

//New instance of XlsIO is created.[Equivalent to launching MS Excel with no workbooks open].
//The instantiation process consists of two steps.

//Step 1 : Instantiate the spreadsheet creation engine.
ExcelEngine excelEngine = new ExcelEngine();

//Step 2 : Instantiate the excel application object.
IApplication application = excelEngine.Excel;

//A new workbook is created.[Equivalent to creating a new workbook in MS Excel]
//The new workbook will have 1 worksheet.
IWorkbook workbook = application.Workbooks.Create(1);
//The first worksheet object in the worksheets collection is accessed.
IWorksheet sheet = workbook.Worksheets[0];

// Entering the Datas for the chart
sheet.Range["A1"].Text = "Crescent City, CA";
sheet.Range["A1:D1"].Merge();
sheet.Range["A1"].CellStyle.Font.Bold = true;

sheet.Range["B3"].Text = "Precipitation,in.";
sheet.Range["C3"].Text = "Temperature,deg.F";

sheet.Range["A4"].Text = "Jan";
sheet.Range["A5"].Text = "Feb";
sheet.Range["A6"].Text = "March";
sheet.Range["A7"].Text = "Apr";
sheet.Range["A8"].Text = "May";
sheet.Range["A9"].Text = "June";
sheet.Range["A10"].Text = "July";
sheet.Range["A11"].Text = "Aug";
sheet.Range["A12"].Text = "Sept";
sheet.Range["A13"].Text = "Oct";
sheet.Range["A14"].Text = "Nov";
sheet.Range["A15"].Text = "Dec";

sheet.Range["B4"].Number = 10.9;
sheet.Range["B5"].Number = 8.9;
sheet.Range["B6"].Number = 8.6;
sheet.Range["B7"].Number = 4.8;
sheet.Range["B8"].Number = 3.2;
sheet.Range["B9"].Number = 1.4;
sheet.Range["B10"].Number = 0.6;
sheet.Range["B11"].Number = 0.7;
sheet.Range["B12"].Number = 1.7;
sheet.Range["B13"].Number = 5.4;
sheet.Range["B14"].Number = 9.0;
sheet.Range["B15"].Number = 10.4;

sheet.Range["C4"].Number = 47.5;
sheet.Range["C5"].Number = 48.7;
sheet.Range["C6"].Number = 48.9;
sheet.Range["C7"].Number = 50.2;
sheet.Range["C8"].Number = 53.1;
sheet.Range["C9"].Number = 56.3;
sheet.Range["C10"].Number = 58.1;
sheet.Range["C11"].Number = 59.0;
sheet.Range["C12"].Number = 58.5;
sheet.Range["C13"].Number = 55.4;
sheet.Range["C14"].Number = 51.1;
sheet.Range["C15"].Number = 47.8;
sheet.UsedRange.AutofitColumns();

// Adding a New chart to the Existing Worksheet
IChart chart = workbook.Charts.Add();
chart.DataRange = sheet.Range["A3:C15"];
chart.Name = "CrescentCity,CA";
chart.ChartTitle = "Crescent City, CA";
chart.IsSeriesInRows = false;

chart.PrimaryValueAxis.Title = "Precipitation,in.";
chart.PrimaryValueAxis.TitleArea.TextRotationAngle = 90;

// Format serie
IChartSerie serieOne = chart.Series[0];
serieOne.Name = "Precipitation,in.";
serieOne.SerieType = ExcelChartType.Radar_Filled;

//Show value as data labels
serieOne.DataPoints.DefaultDataPoint.DataLabels.IsValue = true;
serieOne.DataPoints.DefaultDataPoint.DataLabels.Position = ExcelDataLabelPosition.Outside;

//Format the second serie
IChartSerie serieTwo = chart.Series[1];
serieTwo.SerieType = ExcelChartType.Radar_Markers;
serieTwo.Name = "Temperature,deg.F";

sheet.Move(1);
chart.Activate();

//Saving the workbook to disk.
var stream = new FileStream("sample.xls", FileMode.Create);

workbook.SaveAs(stream, ExcelSaveType.SaveAsXLS);

workbook.Close();
excelEngine.Dispose();

stream.Flush();
stream.Close();

}
}
}




TestingXlsioTwoRadarTypes_827b0a1b.zip

Meikanda Nayanar [Syncfusion]
Replied On October 28, 2011 08:48 AM

Hi Dor Rotman,

Thank you for using Syncfusion products.

We are able to reproduce the reported issue at our side and suspect this could be a defect.

So we request you to open a new direct-trac incident with a simple issue reproducing sample for further follow up on this issue.

Direct-Trac Link:
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please, let us know if you require any further clarifications.

Thanks,
Meikanda Nayanar.I


Dor Rotman
Replied On October 30, 2011 04:36 AM

Thanks for the reply, posted it to the Direct-Trac as requested.
Dor.


Meikanda Nayanar [Syncfusion]
Replied On November 1, 2011 12:13 AM

Hi Dor Rotman,

Thank you for update,

Our support engineer will respond to the incident for further follow up on this issue.

Please, let us know if you require any further clarifications.

Thanks,
Meikanda Nayanar.I


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;