Alpha Video Training
Results 1 to 2 of 2

Thread: Bar chart code

  1. #1
    Member
    Real Name
    Tony Mclaren
    Join Date
    Mar 2006
    Location
    Lake Cathie NSW Australia
    Posts
    25

    Default Bar chart code

    Hi,
    Can anyone help with the code needed for my barchart?
    I have a table called code & the fields I would like to chart are;
    Size (these are in a code format & do change, eg might be G4 in one field & S4T in the next field and so on)
    These then need to be multiplied times the figure in the drop field, which is also in the code table.
    The desired end result wanted would show Total units of G5, G6, S7T, etc each in a different color.
    I would be grateful if someone could edit the example code posted below to achieve the desired result. It can be a bar or pie chart.

    Regards
    Tony

    'Date Created: 24-Jun-2005 01:43:48 PM
    'Last Updated: 17-Jul-2006 11:38:19 AM
    'Created By: Tony
    'Updated By : Tony
    dim chart_item as c = default "Units"
    dim chart_type as c = default "bar"
    dim chart_zeroes as c = default "f"

    dim chart_var as c
    dim chartGen as p
    dim s as p
    dim total_units as n
    dim total_purchase as n
    dim total_cost as n
    dim total_profit as n

    if chart_item = "profit"
    chart_var = "total_profit"
    elseif chart_item = "cost"
    chart_var = "total_cost"
    elseif chart_item = "purchase"
    chart_var = "total_purchase"
    else
    chart_var = "total_units"
    end if

    chartGen = activex1.activex.this
    chartGen.DataSeries.AddBarSeries(chart_item, 0) 'scFillModeAutoSolid

    s = set.current()
    s.fetch_first()
    while .not. s.fetch_eof()
    total_units = total(Invoice_Items->Quantity,GRP->PRODUCT,GRP->INVOICE_HEADER)
    total_purchase = total(Invoice_Items->Extension-(Invoice_Items->Extension*Invoice_Header->Discount/100),GRP->PRODUCT,GRP->INVOICE_HEADER)
    total_cost = total(Product->Cost*Invoice_Items->Quantity,GRP->PRODUCT,GRP->INVOICE_HEADER)
    total_profit = total_purchase - total_cost

    if chart_zeroes = "t" .or. total_units > 0
    chartGen.DataSeries(1).SeriesData.Add(alltrim(product->DESCRIPTION),eval(chart_var))
    end if
    s.fetch_next(1)
    end while

  2. #2
    Member
    Real Name
    Tony Mclaren
    Join Date
    Mar 2006
    Location
    Lake Cathie NSW Australia
    Posts
    25

    Default Re: Bar chart code No Chart DATA Need Help

    Hi,
    I hate being a nusiance but struggling with this
    I have everything working just can't get Chart Data to work
    Would really hope someone can help or point me in the right direction
    This is all I need completed to finish the project.

    Regards
    Tony

Similar Threads

  1. bar code scanning
    By Joe D in forum Alpha Five Version 5
    Replies: 3
    Last Post: 02-11-2004, 05:03 PM
  2. simple bar chart in reports
    By chris davenport in forum Alpha Five Version 5
    Replies: 4
    Last Post: 02-05-2003, 09:12 AM
  3. bar code
    By Norman Weiss in forum Alpha Five Version 1
    Replies: 6
    Last Post: 03-24-2002, 12:20 PM
  4. Bar Code
    By Angelo G. Delgado in forum Code Archive
    Replies: 3
    Last Post: 03-06-2002, 05:02 PM
  5. Bar Chart: Print Problems
    By David Boomer in forum Alpha Five Version 4
    Replies: 6
    Last Post: 06-13-2000, 01:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •