Thanks for Brief answer Mona,
Mona had given good example to use MS Chart which is a part of Office Web
Components on the VB.NET form.
The MS Chart has basic functionality of a displaying the chart. If you are
looking at something fancy then you can use the MS Graph on a WinForm.
All you have to do is,
(1) Add the reference of Microsoft Graph from the Add reference->COM tab
(2) The script will look something like,
Dim values(,) As Integer = {{1, 2, 3, 4}, _
{4, 5, 6, 7}, _
{7, 8, 9, 10}, _
{10, 11, 12, 14} _
}
Dim oGraph As New Graph.Global
Dim oDataSheet As Graph.DataSheet
oDataSheet = oGraph.Application.DataSheet
' Place headers into data table.
' Create four column headers.
oDataSheet.Cells(1, 2).Value = "Col1"
oDataSheet.Cells(1, 3).Value = "Col2"
oDataSheet.Cells(1, 4).Value = "Col3"
oDataSheet.Cells(1, 5).Value = "Col4"
' Create four row headers.
oDataSheet.Cells(2, 1).Value = "Row1"
oDataSheet.Cells(3, 1).Value = "Row2"
oDataSheet.Cells(4, 1).Value = "Row3"
oDataSheet.Cells(5, 1).Value = "Row4"
' Get four rows of data.
Dim lRowCnt, lColCnt As Integer
For lRowCnt = 2 To 5
For lColCnt = 2 To 5
oDataSheet.Cells(lRowCnt, lColCnt).Value = values(lRowCnt -
2, lColCnt - 2)
Next lColCnt
Next lRowCnt
Dim oChart As Graph.Chart
oChart = oGraph.Application.Chart
Dim oAxis As Graph.Axis
oAxis = oChart.Axes(Graph.XlAxisType.xlValue,
Graph.XlAxisGroup.xlPrimary)
oAxis.CrossesAt = 7
oChart.Export(FileName:="current_sales.gif", FilterName:="GIF")
oAxis = Nothing
oChart = Nothing
oDataSheet = Nothing
oGraph.Application.Quit()
oGraph = Nothing
For more information on Microsoft Graph object model, refer to,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbagr10/htm
l/grtocobjectmodelapplication.asp
I hope this information helps!
Regards,
Uday Takbhate [MSFT]
Microsoft Developer Support
--------------------
[quoted text, click to view] >From: "Mona" <mona@discussions.com>
>References: <1125043844.608051.107310@o13g2000cwo.googlegroups.com>
>Subject: Re: Using Msgraph directly in VB.NET application
>Date: Tue, 30 Aug 2005 14:04:42 +0530
>Lines: 49
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
>Message-ID: <#9z912TrFHA.3264@TK2MSFTNGP12.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.interop
>NNTP-Posting-Host: 210.18.86.68.sify.net 210.18.86.68
>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework.interop:9370
>X-Tomcat-NG: microsoft.public.dotnet.framework.interop
>
>Hi Steph,
>
>Regarding this issue of using the MS Chart directly in VB.Net application ,
>I would like to tell you that first of all we need to add the MSChart
>control in the toolbox. It will be in the Components Tab when you
Add/Remove
>the toolbox items.
>
>Add an MS Chart control to a form and suppose the name of the Chart control
>is Chart1, then we need to use the following snippet of code :
>
>START CODE
>
>Dim arrData(2, 2) As object
>
>arrData(1, 1) = "Jan" ' Set the labels in the first series.
>
>arrData(2, 1) = "Feb"
>
>arrData(1, 2) = 8
>
>arrData(2, 2) = 4
>
>Chart1.ChartData = arrData
>
>
>
>END CODE
>
>Hope this helps.
>
>Regards,
>Mona [Grapecity]
>
>"Doudou" <doussiere@free.fr> wrote in message
>news:1125043844.608051.107310@o13g2000cwo.googlegroups.com...
>> Hello,
>> First I'm french, so my english isn't very good.
>>
>> I try to find explanation or example to use MsGraph object directly in
>> VB.NET application (in a windows form for example).
>>
>> Is it possible ? Or is it necessary to use Office application (like
>> Excel) to use MsGraph object ?
>>
>> Thanks for all response
>> Steph
>>
>
>
>