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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Chart XValues YValues of a 2dim chart XLSio Scatter line type

Thread ID:

Created:

Updated:

Platform:

Replies:

52644 Dec 1,2006 09:42 AM UTC Apr 4,2018 10:43 AM UTC WinForms 8
loading
Tags: XlsIO
Werner Plumot
Asked On December 1, 2006 09:42 AM UTC

I can not fill in the values in the series that covers the Xvalues and Yvalues fora ScattetLine Graph:

IChartSerie serie = chart.Series.Add(ExcelChartType.Scatter_Line);

serie.UsePrimaryAxis = false;
serie.Name = "SomeName";

serie.Values = atrExcel.Range[r_start1.Row, r_start1.Column,r_start2.Row-1,r_end2.Column];


excelXvalues.zip

Chella Pandian B [Syncfusion]
Replied On December 1, 2006 06:12 PM UTC

Hi Werner Plumot

I have solved the problem please check the sample and let me know any other modifications.

Sample:
ScattetLine.zip

Thanks for using XlsIO.

With regards,
Chella.

Werner Plumot
Replied On December 4, 2006 08:18 AM UTC

Thank you !

>Hi Werner Plumot

I have solved the problem please check the sample and let me know any other modifications.

Sample:
ScattetLine.zip

Thanks for using XlsIO.

With regards,
Chella.

Werner Plumot
Replied On December 4, 2006 08:34 AM UTC

I get the problem at run time than the name "Austin" in your example already exists.
I have two graphics in youre example, I just need one with the Xaxis values and the YAxisValues. As you can see in my picture. It is for me impossible ti fill in the XValues, no problem for the YValues.

>Hi Werner Plumot

I have solved the problem please check the sample and let me know any other modifications.

Sample:
ScattetLine.zip

Thanks for using XlsIO.

With regards,
Chella.


excel2ex.zip

Chella Pandian B [Syncfusion]
Replied On December 5, 2006 12:15 AM UTC

Hi Werner Plumot

I have found the way for inserting value to the X-axis. Please check the Sample too.

// Setting value for Y-axis;
IChartSerie serie1 = chart.Series[0];
serie1.Name = "Austin";
serie1.Values = sheet.Range[1,1,2,1];

// creating serie1
IChartSerie serie2 = chart.Series[1];
serie2.Name = "Ramco";
serie2.Values = sheet.Range[1,3,2,3];

//chart.IsSeriesInRows = false;

// Setting value for X-axis;
chart.Series[0].CategoryLabels = sheet.Range[1,2,2,2];
chart.Series[1].CategoryLabels = sheet.Range[1,4,2,4];

Let me know any other difficulties.

Sample:

ScattetLine.zip


With regards,
Chella.


Werner Plumot
Replied On December 5, 2006 12:24 PM UTC

THANK YOU, that did it.... I spend some time on it and I could not find it...
The code below makes realy values for the X and Y axis. You need to remove the first datarange like in Excel. Great !

chart.ChartType = ExcelChartType.Scatter_Line;
chart.IsSeriesInRows = true;
// Assigning values to the chart
chart.DataRange = sheet.Range[1,1,2,4];

// Naming X - Axis
chart.PrimaryCategoryAxis.Title = "City";

// Naming Y - Axis
chart.PrimaryValueAxis.Title = "Sales (in Dollars)";

// Chart title
chart.ChartTitle = "Texas Books Unit Sales";

// setting value for Y-axis;
// creating serie1
IChartSerie serie1 = chart.Series[0];
serie1.Name = "Austin";
serie1.Values = sheet.Range[1,1,1,4];
chart.Series[0].CategoryLabels = sheet.Range[2,1,2,4];

chart.Series.RemoveAt(1);

serie1.Name = "Austin";
serie1.Values = sheet.Range[1,1,1,4];
chart.Series[0].CategoryLabels = sheet.Range[2,1,2,4];

Werner Plumot
Replied On December 5, 2006 12:51 PM UTC

all : this is better :


IWorksheet sheet = workbook.Worksheets[0];

// Inserting value to sheet.

sheet.Range[1,1].Value = "15";
sheet.Range[1,2].Value = "35";
sheet.Range[1,3].Value = "70";
sheet.Range[1,4].Value = "90";

sheet.Range[2,1].Value = "10";
sheet.Range[2,2].Value = "20";
sheet.Range[2,3].Value = "30";
sheet.Range[2,4].Value = "70";

sheet.Range[3, 1].Value = "5";
sheet.Range[3, 2].Value = "60";
sheet.Range[3, 3].Value = "70";
sheet.Range[3, 4].Value = "80";

sheet.Range[4, 1].Value = "10";
sheet.Range[4, 2].Value = "50";
sheet.Range[4, 3].Value = "60";
sheet.Range[4, 4].Value = "80";


// adding chart
IChartShape chart= sheet.Charts.Add();

// XlsIO Support more that 70 different types of charts.
chart.ChartType = ExcelChartType.Scatter_Line;
chart.IsSeriesInRows = true;
// Naming X - Axis
chart.PrimaryCategoryAxis.Title = "City";

// Naming Y - Axis
chart.PrimaryValueAxis.Title = "Sales (in Dollars)";

// Chart title
chart.ChartTitle = "Texas Books Unit Sales";

IChartSerie serie1 = chart.Series.Add("Austin");
serie1.Values = sheet.Range[2, 1, 2, 4];
chart.Series[0].CategoryLabels = sheet.Range[1, 1, 1, 4];

IChartSerie serie2 = chart.Series.Add("Jef");
serie2.Values = sheet.Range[4, 1, 4, 4];
chart.Series[1].CategoryLabels = sheet.Range[3, 1, 3, 4];

Chella Pandian B [Syncfusion]
Replied On December 5, 2006 11:01 PM UTC

Hi Werner Plumot,

Thank for the information. Please let me know any other difficulties.

Thanks for your interest in XlsIO.

With regards,
Chella.

Sujeet Kumar Suman
Replied On April 4, 2018 10:43 AM UTC

Hi Werner Plumot,

Thank for the information. Please let me know any other difficulties.

Thanks for your interest in XlsIO.

With regards,
Chella.

Yes.

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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;