MSChart??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dillon Mantle

    MSChart??

    Hi All

    Thanks for the help n the decoding, made sense after I read it a few times.
    I am now graphing the data with the simple code below, which works fine but
    my format is all wrong.
    How do you format the number into "General Number"? I know its possible
    because I can do it in excel and its the same control.

    Private Sub Draw_Graph()
    '************** *************** *************** ****
    ' PURPOSE :- To draw the graph
    ' INPUTS :-
    ' OUTPUTS :-
    '************** *************** *************** ****

    ReDim GraphData(Graph _Data_Max(0), 2)
    For X = 1 To Graph_Data_Max( 0)
    GraphData(X, 1) = 1
    GraphData(X, 2) = Graph_AVG_Strok es(X)
    Next

    ChartData.Chart Data = GraphData

    ChartData.Plot. Axis(VtChAxisId X).ValueScale.M ajorDivision = 200
    ChartData.Plot. Axis(VtChAxisId X).ValueScale.M inorDivision = 50
    ChartData.Plot. Axis(VtChAxisId X).ValueScale.M inimum = 0

    'I need to format the numbers here some where

    ChartData.Plot. Axis(VtChAxisId X).Tick.Style = VtChAxisTickSty leNone

    End Sub


    --
    Regards
    Dillon Mantle


  • Stephane Richard

    #2
    Re: MSChart??

    You can use the format statement to format your numbers...

    Result = Format(YourVari able, "#,###,###,##0. 00")

    There's probably a term you put in the 2nd parameter for regular number, I
    just don't remember it off hand but this example will format your number as
    1,000.00 for example.

    --
    Stéphane Richard

    "Dillon Mantle" <dillonm@dasolu tions.co.za> wrote in message
    news:dLCdnce3AY nQLZzdRVn-sA@is.co.za...[color=blue]
    > Hi All
    >
    > Thanks for the help n the decoding, made sense after I read it a few[/color]
    times.[color=blue]
    > I am now graphing the data with the simple code below, which works fine[/color]
    but[color=blue]
    > my format is all wrong.
    > How do you format the number into "General Number"? I know its possible
    > because I can do it in excel and its the same control.
    >
    > Private Sub Draw_Graph()
    > '************** *************** *************** ****
    > ' PURPOSE :- To draw the graph
    > ' INPUTS :-
    > ' OUTPUTS :-
    > '************** *************** *************** ****
    >
    > ReDim GraphData(Graph _Data_Max(0), 2)
    > For X = 1 To Graph_Data_Max( 0)
    > GraphData(X, 1) = 1
    > GraphData(X, 2) = Graph_AVG_Strok es(X)
    > Next
    >
    > ChartData.Chart Data = GraphData
    >
    > ChartData.Plot. Axis(VtChAxisId X).ValueScale.M ajorDivision = 200
    > ChartData.Plot. Axis(VtChAxisId X).ValueScale.M inorDivision = 50
    > ChartData.Plot. Axis(VtChAxisId X).ValueScale.M inimum = 0
    >
    > 'I need to format the numbers here some where
    >
    > ChartData.Plot. Axis(VtChAxisId X).Tick.Style = VtChAxisTickSty leNone
    >
    > End Sub
    >
    >
    > --
    > Regards
    > Dillon Mantle
    >
    >[/color]


    Comment

    • Rick Rothstein

      #3
      Re: MSChart??

      > You can use the format statement to format your numbers...[color=blue]
      >
      > Result = Format(YourVari able, "#,###,###,##0. 00")[/color]

      Too many #-signs.... just use Format(YourNumb er, "#,##0.00")

      [color=blue]
      > There's probably a term you put in the 2nd parameter for
      > regular number, I just don't remember it off hand[/color]

      There is... Format(2000#, "General Number"), but that "general number" is
      one with no thousands separator.


      Rick - MVP


      Comment

      • Randy Birch

        #4
        Re: MSChart??

        Or just FormatNumber() and specify the number of decimals desired.

        --

        Randy Birch
        MVP Visual Basic

        Please respond only to the newsgroups so all can benefit.

        There's no place like 127.0.0.1


        "Rick Rothstein" <rickNOSPAMnews @NOSPAMcomcast. net> wrote in message
        news:zoidnZqyUq e2Np_d4p2dnA@co mcast.com...
        : > You can use the format statement to format your numbers...
        : >
        : > Result = Format(YourVari able, "#,###,###,##0. 00")
        :
        : Too many #-signs.... just use Format(YourNumb er, "#,##0.00")
        :
        :
        : > There's probably a term you put in the 2nd parameter for
        : > regular number, I just don't remember it off hand
        :
        : There is... Format(2000#, "General Number"), but that "general number" is
        : one with no thousands separator.
        :
        :
        : Rick - MVP
        :
        :


        Comment

        Working...