5,696,576 members and growing! (16,237 online)
Email Password   helpLost your password?
Multimedia » General Graphics » Graphics     Intermediate

Simple Charts Using OWC (Office Web Component)

By Andrews Raj

An article on Simple Chart Representation Using OWC
C#, Windows, .NET, Visual Studio, Dev

Posted: 1 Feb 2006
Updated: 1 Feb 2006
Views: 47,827
Bookmarked: 15 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
8 votes for this Article.
Popularity: 3.49 Rating: 3.87 out of 5
2 votes, 25.0%
1
0 votes, 0.0%
2
1 vote, 12.5%
3
1 vote, 12.5%
4
4 votes, 50.0%
5

Sample Image

Introduction

This is a simple project for beginners to get some knowledge about using OWC in a C#.NET application for chart representation.

Background

Office 2003 Web Components do not provide event handling by default. We need to do some alterations. Kindly follow this link to get more information: Handle Events for the Office 2003 Web Components in Visual Studio .NET.

Using the code

After we convert OWC for event handling, we can add a reference to our project.

Steps

  1. Create a OWC Chart.
  2. Add the required number of chart series in it.
  3. Give the values for each chart series.
  4. Customize your chart to display it in the format you wish.
string strSeriesName = "My Series";
string strCategory = "1,2,3,4,5";
string strValue = "3,8,2,8,4";
//Add a series to the chart’s series collection

ChSeries series = chchart.SeriesCollection.Add(0);
//Give the name of the series

chchart.SeriesCollection[0].SetData(
  OWC10.ChartDimensionsEnum.chDimSeriesNames, 
  (int)OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, 
  strSeriesName);
//Give the Categories

chchart.SeriesCollection[0].SetData(
  OWC10.ChartDimensionsEnum.chDimCategories, 
  (int)OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, 
  strCategory);
//Give The values

chchart.SeriesCollection[0].SetData(
  OWC10.ChartDimensionsEnum.chDimValues, 
  (int)OWC10.ChartSpecialDataSourcesEnum.chDataLiteral, 
  strValue); 
series.Line.set_Weight(
  OWC10.LineWeightEnum.owcLineWeightHairline);

Points of Interest

I hope you've enjoyed this little tutorial. In future, I will provide you lot more stuff. And I am expecting your valuable suggestions.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Andrews Raj


I am a software engineer working in Blr, india.
working in c++, vc++, mfc, c#.Net, COM/ATL.


Occupation: Software Developer (Senior)
Location: India India

Other popular General Graphics articles:

  • A flexible charting library for .NET
    Looking for a way to draw 2D line graphs with C#? Here's yet another charting class library with a high degree of configurability, that is also easy to use.
  • CxImage
    CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images.
  • 3D Pie Chart
    A class library for drawing 3D pie charts.
  • Really cool visual FX
    A set of classes for doing stunning visual effects, including water, plasma and fire.
  • ImageStone
    An article on a library for image manipulation.
Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 7 of 7 (Total in Forum: 7) (Refresh)FirstPrevNext
GeneralCode Unavailablemembersysengineer0:47 15 Mar '08  
GeneralOWC scatter chart errormemberganesh_india4:24 13 Jun '07  
Generaldynamically addmembersuperda22:16 15 Apr '07  
GeneralOpenOffice (Chart)membertimbits21411:58 14 Apr '07  
QuestionHandling click events on the chartmembernasubh2:56 19 Dec '06  
QuestionHow to draw series from 0,0 origine.memberHimadri Majumdar19:00 23 Nov '06  
GeneralUsing with ASP.NetmemberMohamed El Gohary0:31 24 May '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 1 Feb 2006
Editor: Smitha Vijayan
Copyright 2006 by Andrews Raj
Everything else Copyright © CodeProject, 1999-2008
Web15 | Advertise on the Code Project