Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
Simon Simon is offline
external usenet poster
 
Posts: 33
Default How to configure the MSGraph.Chart.8?

I am trying to insert a Graph.Chart into a word document using VS2005 C#. I
have got two series of test data for specimens one and two, respectively. The
data are about load-deflection pairs. Now I want to plot these two series of
test results on a chart to compare the difference between them; load in
x-axis and deflection in y-axis. I have filled four data series into
Chart.Datasheet as follows:
=======================
Curve for Specimen one:
Load: 0 1 2 3 4 5 6 7 8 9
Defl: 0 3 5 7 9 11 13 15 17
----------------------------------
Curve for Specimen two:
Load: 0 2 2.5 3 5 6.5 8 10
Def: 0 4.5 7 8 10 ...
=================
The codes I have completed look like this:

//Insert a chart.
Word.InlineShape oShape;
object oClassType = "MSGraph.Chart.8";
wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
oShape = wrdRng.InlineShapes.AddOLEObject(ref oClassType, ref
oMissing,
ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing);

//Set the width of the chart.
oShape.Width = oWord.InchesToPoints(6.25f);
oShape.Height = oWord.InchesToPoints(3.57f);

object myChart = oShape.OLEFormat.Object;
(myChart as Graph.Chart).Application.DataSheet.Columns.Clear() ;
...(filling data series from here)
...

The first data row is the X_values by default. However, in this case, I need
to use different data series for the Deflection series.
Can anybody teach me how to do? In addition, how to show the caption of
x-axis in the chart?

Thanks!
  #2   Report Post  
Posted to microsoft.public.word.newusers
Simon Simon is offline
external usenet poster
 
Posts: 33
Default How to configure the MSGraph.Chart.8?

no answer?

"Simon" wrote:

I am trying to insert a Graph.Chart into a word document using VS2005 C#. I
have got two series of test data for specimens one and two, respectively. The
data are about load-deflection pairs. Now I want to plot these two series of
test results on a chart to compare the difference between them; load in
x-axis and deflection in y-axis. I have filled four data series into
Chart.Datasheet as follows:
=======================
Curve for Specimen one:
Load: 0 1 2 3 4 5 6 7 8 9
Defl: 0 3 5 7 9 11 13 15 17
----------------------------------
Curve for Specimen two:
Load: 0 2 2.5 3 5 6.5 8 10
Def: 0 4.5 7 8 10 ...
=================
The codes I have completed look like this:

//Insert a chart.
Word.InlineShape oShape;
object oClassType = "MSGraph.Chart.8";
wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
oShape = wrdRng.InlineShapes.AddOLEObject(ref oClassType, ref
oMissing,
ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing);

//Set the width of the chart.
oShape.Width = oWord.InchesToPoints(6.25f);
oShape.Height = oWord.InchesToPoints(3.57f);

object myChart = oShape.OLEFormat.Object;
(myChart as Graph.Chart).Application.DataSheet.Columns.Clear() ;
...(filling data series from here)
...

The first data row is the X_values by default. However, in this case, I need
to use different data series for the Deflection series.
Can anybody teach me how to do? In addition, how to show the caption of
x-axis in the chart?

Thanks!

  #3   Report Post  
Posted to microsoft.public.word.newusers
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default How to configure the MSGraph.Chart.8?

You may want to try asking this in a newsgroup that deals with programming,
such as microsoft.public.word.vba.general.

--
Stefan Blom
Microsoft Word MVP



"Simon" wrote in message
...
no answer?

"Simon" wrote:

I am trying to insert a Graph.Chart into a word document using VS2005 C#.
I
have got two series of test data for specimens one and two, respectively.
The
data are about load-deflection pairs. Now I want to plot these two series
of
test results on a chart to compare the difference between them; load in
x-axis and deflection in y-axis. I have filled four data series into
Chart.Datasheet as follows:
=======================
Curve for Specimen one:
Load: 0 1 2 3 4 5 6 7 8 9
Defl: 0 3 5 7 9 11 13 15 17
----------------------------------
Curve for Specimen two:
Load: 0 2 2.5 3 5 6.5 8 10
Def: 0 4.5 7 8 10 ...
=================
The codes I have completed look like this:

//Insert a chart.
Word.InlineShape oShape;
object oClassType = "MSGraph.Chart.8";
wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
oShape = wrdRng.InlineShapes.AddOLEObject(ref oClassType, ref
oMissing,
ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing);

//Set the width of the chart.
oShape.Width = oWord.InchesToPoints(6.25f);
oShape.Height = oWord.InchesToPoints(3.57f);

object myChart = oShape.OLEFormat.Object;
(myChart as
Graph.Chart).Application.DataSheet.Columns.Clear() ;
...(filling data series from here)
...

The first data row is the X_values by default. However, in this case, I
need
to use different data series for the Deflection series.
Can anybody teach me how to do? In addition, how to show the caption of
x-axis in the chart?

Thanks!



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Configure Word to use Firefox? TomF Microsoft Word Help 4 February 5th 08 07:05 PM
Configure at startup Otto Moehrbach New Users 1 December 6th 07 09:16 PM
How do you configure the SEQ field ? Teresa Neves Microsoft Word Help 2 April 28th 06 04:09 PM
Configure for both Mac and PC Paul Harris Page Layout 5 November 4th 05 07:22 PM
why do i get { EMBED MSGraph \* MERGEFORMAT }instead of picture Megan Microsoft Word Help 1 May 4th 05 04:01 PM


All times are GMT +1. The time now is 02:16 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"