Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to draw a XY graph in a Form

Status
Not open for further replies.

JackONeill

Programmer
Mar 8, 2004
65
US
hi there,

I'm trying to draw a XY graph in a form...
base on 2 array of same size, but i can't..

I can draw a bar graph... but not a XY..

Someone have some basic code that i can study?

I'm trying this in Excell. I know that i can draw the graph in Excel...

thank you!
 





Hi,

Why can't you CHANGE the ChartType from Bar to Scatter?

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
not Working...

here is my code

Code:
'Draw Graphs
'--------------

    'Create a new chart
    Dim oChart As WCChart
    QuickFlowGraph.Clear
    QuickFlowGraph.Refresh
    Set oChart = QuickFlowGraph.Charts.Add
    
    'Add a title to the chart
    oChart.HasTitle = True
    oChart.Title.Caption = "X Y Test Graph"
    

     Dim oSeries As WCSeries
    
    'Line2
    Set oSeries = oChart.SeriesCollection.Add
    With oSeries
        .Caption = "Line 2 "
        .SetData chDimValues, chDataLiteral, x2
        .SetData chDimValues, chDataLiteral, Line2
        .Type = chChartTypeLineStacked
        
    End With
    
    'Line3
    Set oSeries = oChart.SeriesCollection.Add
    With oSeries
        .Caption = "Line 3"
        .SetData chDimValues, chDataLiteral, x2
        .SetData chDimValues, chDataLiteral, Line3
        .Type = chChartTypeLineStacked
    End With
    
    'Line4
    Set oSeries = oChart.SeriesCollection.Add
    With oSeries
        .Caption = "Line 4 "
        .SetData chDimValues, chDataLiteral, x4
        .SetData chDimValues, chDataLiteral, Line4
        .Type = chChartTypeLineStacked
    End With
        
    'Add a value axis to the right of the chart for the second series
    oChart.Axes.Add oChart.Axes(chAxisPositionLeft).Scaling, _
        chAxisPositionRight, chValueAxis

    'Format the Value Axes
    With oChart.Axes(chAxisPositionLeft)
            .NumberFormat = "#,##0"
            '.MajorUnit = 1000
           
    End With
    
    With oChart.Axes(chAxisPositionRight)
            .NumberFormat = "#,##0"
            '.MajorUnit = 1000
    End With
    
    'Show the legend at the bottom of the chart
    oChart.HasLegend = True
    oChart.Legend.Position = chLegendPositionBottom



 




Hmmmmmm???

Googling QuickFlowGraph, got ZERO responses.

What kind of object is this? Nothing I ever hear of.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 




Duh, a local Object [blush]

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top