Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / VS Tools for Office / January 2007

Tip: Looking for answers? Try searching our database.

Adding a xlXYScatter serie to a chart

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Torben Laursen - 17 Jan 2007 15:42 GMT
Hi

I need to add a chart with a number of xlXYScatter series to a sheet.

I have been able to add the chart with a serie but I cannot find out how to
add the X and Y range the Schatter serie needs.
The range is in 2 columns that are not next to each other.
I have my code below. The serie needs to take the data from RangeX and
RangeY:
However how do I tell the serie where the X Values and the Y Values are in
the sheet?
MSExcel.Range RangeX = Sheet.get_Range(Sheet.Cells[42, 3], Sheet.Cells[100,
3]);

MSExcel.Range RangeY = Sheet.get_Range(Sheet.Cells[42, 5], Sheet.Cells[100,
5]);

MSExcel.ChartObjects ChartObjects =
(MSExcel.ChartObjects)Sheet.ChartObjects(missing);

MSExcel.ChartObject Chart = ChartObjects.Add(1, 20, 250, 250);

Chart.Chart.ChartWizard(RangeX, MSExcel.XlChartType.xlXYScatter, missing,
missing, missing, missing, missing, "Title", missing, missing, issing);

Chart.Activate();

Thanks Torben
Cindy M. - 29 Jan 2007 15:52 GMT
Hi Torben,

> need to add a chart with a number of xlXYScatter series to a sheet.
>  
> I have been able to add the chart with a serie but I cannot find out how to
> add the X and Y range the Schatter serie needs.

This question really deals more with the Excel object model than with VSTO.
Since you haven't gotten a response here, try asking in the excel.programming
newsgroup, where you'll find the specialists.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.