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.
Syncfusion Feedback

Add multiple ranges to the chart datarange

Thread ID:

Created:

Updated:

Platform:

Replies:

58162 Mar 20,2007 09:55 AM UTC Mar 21,2007 01:09 PM UTC ASP.NET Web Forms (Classic) 3
loading
Tags: XlsIO
thuric
Asked On March 20, 2007 09:55 AM UTC

Hi,

I am a beginner with syncfuion tools.

I am trying to build a radar graph in an Excel sheet.
But I do not understand how to add multiple ranges to the chart datarange like it's possible to do in the excel wizard.

For example:
=Sheet1!$B$2:$B$4;Sheet1!$B$6:$B$8;Sheet1!$B$10:$B$12

I tried this :

chart.DataRange = sheet.Range("B2:B4;B6:B8;B10:B12")

But it didn't work.

Can you tell me How to do it please ?

Thanks

Melba Winshia [Syncfusion]
Replied On March 20, 2007 11:04 AM UTC

Hi Thuric,

Thanks for your interest in Essential XlsIO.

You can add multiple ranges to the chart datarange by using the IRanges collection. Please use the following code snippet to achieve this.

[C#]

//Discontiguous range
IRanges rangesOne = sheet.CreateRangesCollection();
rangesOne.Add(sheet.Range["B2:B4"]);
rangesOne.Add(sheet.Range["B6:B8"]);
rangesOne.Add(sheet.Range["B10:B12"]);

//Set DataRange.
chart.DataRange = rangesOne;

Here is a sample for your reference:

http://websamples.syncfusion.com/samples/XlsIO.Web/4.4.0.51/F58162/main.htm

Kindly let me know if you have any other questions.

Thanks,
Melba

Administrator [Syncfusion]
Replied On March 20, 2007 12:01 PM UTC

Hi Melba,

So simple :)

Thanks for your help.

Regards,
- Thuric

Melba Winshia [Syncfusion]
Replied On March 21, 2007 01:09 PM UTC

Hi Thuric,

Thanks for the update.

Kindly let me know if you have any other questions.

Regards,
Melba

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.

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

;