Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Chart XBasic not working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Chart XBasic not working

    I have placed a chart on a form. The form is based on a set: Consultants=Consultordcpo
    The chart data is based on a 'Custom' xBasic chart definition...

    Code:
    'Date Created: 30-May-2013 09:11:28 AM
    'Last Updated: 25-Jan-2015 01:14:38 PM
    'Created By  : SMathews
    'Updated By  : David
    function plotArrayDataCPOWk as Charting::ChartDataDefinition(ConsultNumber as n)
    'For more examples on how to generate a ChartDataDefinition object for different chart types
    'see examples in the Learning Xdialog Database
    '
    'Create an array with some data to plot
    dim Counter As N
    dim Count As N
    dim i As N
    dim DateTxt1 As C
    dim DateTxt2 As C
    dim a[20] As P
    
    for Counter = 1 to 20
    	DateTxt1 = dtoc(date()-(7*Counter))
    	DateTxt2 = dtoc(date()-(7*(Counter-1)))
    	a[Counter].name = "-" + alltrim(str(Counter))
    	a[Counter].value = tablesum("consultordcpo","Consultnum = " + alltrim(str(ConsultNumber)) + ".and.BETWEEN(OrderDToProc,{" + DateTxt1 + "},{" + DateTxt2 + "})", "Consultcpo")
    	ui_msg_box("a[Counter].Name = " + a[Counter].name + "a[Counter].value =  " + alltrim(str(a[Counter].value)), "a[Counter].Name = " + a[Counter].name + "a[Counter].value = "+ alltrim(str(a[Counter].value)),UI_INFORMATION_SYMBOL+UI_OK)
    next
    
    'Count = a.size()
    Count = 20
    
    dim i as n 
    
    ' Dim the chart & series
    dim cd as Charting::ChartDataDefinition
    dim cs as Charting::ChartSeriesDefinition
    cd.series.add(cs)
    
    for i = 1 to Count 
    				dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
    				cdd.value = format_data(a[i].value,",")
    				cdd.label = a[i].name + " ("+cdd.value+")"
    				cs.data.add(cdd)
    next
    plotArrayData = cd
    end function
    I placed a watch expression in the chart dialog Consultants->Consultnum (a field in the primary table).
    The msg_box indicates that a[].value is not being populated correctly... all 0s even though there is data in the table.
    of course... When the chart is displayed it is blank... just a blank rectangle where the chart should be.

    How can I fix this?
    Last edited by David Boomer; 01-25-2015, 03:34 PM.

    #2
    Re: Chart XBasic not working

    What's the field data type of Consultnum ?

    You can do this in the interactive.

    ConsultNumber = 7 �se any valid number
    Counter = 1
    DateTxt1 = dtoc(date()-(7*Counter))
    DateTxt2 = dtoc(date()-(7*(Counter-1)))
    a[Counter].name = "-" + alltrim(str(Counter))
    a[Counter].value = tablesum("consultordcpo","Consultnum = " + alltrim(str(ConsultNumber)) + ".and.BETWEEN(OrderDToProc,{" + DateTxt1 + "},{" + DateTxt2 + "})", "Consultcpo")
    ? a[1].value

    to inspect the value summed.

    If the value returned is not what it should be the tablesum() filter is likely mis-written.
    Last edited by Stan Mathews; 01-25-2015, 04:06 PM.
    There can be only one.

    Comment


      #3
      Re: Chart XBasic not working

      Consultnum is type N

      I couldn't get the interactive to work... see below

      DateTxt1 = dtoc(date()-(7*Counter))
      ?datetxt1
      = "09/07/2014"
      Counter = 20
      DateTxt2 = dtoc(date()-(7*(Counter-1)))
      ?datetxt2
      = "09/14/2014"
      dim datatoplot[20] As P
      ERROR: Variable type mismatch: variable datatoplot is type 'P', attempted to assign type 'A'.


      DataToPlot[Counter].name = "-" + alltrim(str(Counter))
      ?datatoplot[Counter]
      ERROR: Property not found
      datatoplot[] not found.
      but the tablesum seems to work:

      ?tablesum("consultordcpo","Consultnum = " + alltrim(str(19)) + ".and.BETWEEN(OrderDToProc,{" + "09/01/2014" + "},{" + "01/01/2015" + "})", "Consultcpo")
      = 1345.44

      Comment


        #4
        Re: Chart XBasic not working

        You must have some other code interfering. Works fine here.

        counter = 20
        DateTxt1 = dtoc(date()-(7*Counter))
        ?datetxt1
        = "09/07/2014"
        datetxt2 = dtoc(date()-(7*(Counter-1)))
        ?datetxt2
        = "09/14/2014"
        dim datatoplot[20] As P
        DataToPlot[Counter].name = "-" + alltrim(str(Counter))
        ?datatoplot[Counter]
        = name = "-20"

        Try restarting Alpha and begin again without running the chart function first.
        There can be only one.

        Comment


          #5
          Re: Chart XBasic not working

          Thanks Stan... I have tried your suggestion and started from beginning with new form / Chart... and everything else that I can think of.
          Below is the current code that I am working with. I am pretty sure that the Tablesum() function is working.

          'Date Created: 30-May-2013 09:11:28 AM
          'Last Updated: 26-Jan-2015 09:52:38 AM
          'Created By : SMathews
          'Updated By : David
          function plotArrayDataCPOWk as Charting::ChartDataDefinition(ConsultNumber as n)
          'For more examples on how to generate a ChartDataDefinition object for different chart types
          'see examples in the Learning Xdialog Database
          '
          'Create an array with some data to plot
          dim Counter As N
          dim Count As N
          dim i As N
          dim DateTxt1 As C
          dim DateTxt2 As C
          dim LabelToplot[20] As C
          dim DataToPlot[20] As N

          for Counter = 20 to 1 Step -1
          DateTxt1 = dtoc(date()-7*Counter)
          DateTxt2 = dtoc(date()-7*Counter-1)
          LabelToPlot[Counter] = "-" + alltrim(str(Counter))
          DataToPlot[Counter] = tablesum("consultordcpo","Consultnum = " + alltrim(str(ConsultNumber)) + ".and.BETWEEN(OrderDToProc,{" + DateTxt1 + "},{" + DateTxt2 + "})", "Consultcpo")
          'ui_msg_box("LabelToPlot[" + alltrim(str(Counter))+"] = " + LabelToPlot[Counter] + " DataToPlot[" + alltrim(str(Counter)) + "] = " + alltrim(str(DataToPlot[Counter])), "LabelToPlot[" + alltrim(str(Counter))+"] = " + LabelToPlot[Counter] + "DataToPlot[" + alltrim(str(Counter)) + "] = " + alltrim(str(DataToPlot[Counter])),UI_INFORMATION_SYMBOL+UI_OK)
          next

          'Count = a.size()
          Count = 20

          dim i as n

          ' Dim the chart & series
          dim cd as Charting::ChartDataDefinition
          dim cs as Charting::ChartSeriesDefinition
          cd.series.add(cs)

          for i = 1 to count
          dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
          cdd.value = DataToPlot[i].value
          cdd.label = LabelToPlot[i].name + " ("+cdd.value+")"
          cs.data.add(cdd)
          next

          'for i = 1 to Count
          ' dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
          ' cdd.value = format_data(LabelToPlot[i].value,",")
          ' cdd.label = DataToPlot[i].name + " ("+cdd.value+")"
          ' cs.data.add(cdd)
          'next

          plotArrayData = cd
          end function

          Where can I go from here?

          Comment


            #6
            Re: Chart XBasic not working

            If you want to attach a sample table I'll try to take a look. I don't have anything I can use adapting your code to graph.
            There can be only one.

            Comment


              #7
              Re: Chart XBasic not working

              ConsultOrdCPOV2.zip

              Thanks Stan...

              attached is the table that I have been using to try to generate a chart of each Consultnum total consultcpo by week for the last 20 weeks

              Comment


                #8
                Re: Chart XBasic not working

                I haven't gotten too far but I did notice you changed the source data xbasic function name to plotArrayDataCPOWk. You also need to change the function assignment line. (Just before the end function statement.)

                plotArrayDataCPOWk = cd
                There can be only one.

                Comment


                  #9
                  Re: Chart XBasic not working

                  The problem seems to be with the population of the array...
                  when I do it the hard way (see below) it works (sort-of):
                  ??? why isn't the array populating???

                  Code:
                  'Date Created: 30-May-2013 09:11:28 AM
                  'Last Updated: 26-Jan-2015 01:29:48 PM
                  'Created By  : SMathews
                  'Updated By  : David
                  function plotArrayDataCPOWk as Charting::ChartDataDefinition(ConsultNumber as n)
                  'For more examples on how to generate a ChartDataDefinition object for different chart types
                  'see examples in the Learning Xdialog Database
                  '
                  'Create an array with some data to plot
                  dim Counter As N
                  dim Count As N
                  dim i As N
                  dim DateTxt1 As C
                  dim DateTxt2 As C
                  dim LabelToPlot As C
                  dim DataToPlot As N
                  'dim LabelToplot[20] As C
                  'dim DataToPlot[20] As N
                  
                  ui_msg_box("Consultant: " + alltrim(str(ConsultNumber)),"Consultant: " + alltrim(str(ConsultNumber)),UI_INFORMATION_SYMBOL+UI_OK)
                  'I don't know why... but The array just does not populate... so Ill do it the hard way!
                  'for Counter = 20 to 1 Step -1
                  '	DateTxt1 = dtoc(date()-7*Counter)
                  '	DateTxt2 = dtoc(date()-7*Counter-1)
                  '	LabelToPlot[Counter] = "-" + alltrim(str(Counter))
                  '	DataToPlot[Counter] = tablesum("consultordcpo","Consultnum = " + alltrim(str(ConsultNumber)) + ".and.BETWEEN(OrderDToProc,{" + DateTxt1 + "},{" + DateTxt2 + "})", "Consultcpo")
                  '	'ui_msg_box("LabelToPlot[" + alltrim(str(Counter))+"] = " + LabelToPlot[Counter] + " DataToPlot[" + alltrim(str(Counter)) + "] = " + alltrim(str(DataToPlot[Counter])), "LabelToPlot[" + alltrim(str(Counter))+"] = " + LabelToPlot[Counter] + "DataToPlot[" + alltrim(str(Counter)) + "] = " + alltrim(str(DataToPlot[Counter])),UI_INFORMATION_SYMBOL+UI_OK)
                  'next
                  
                  'Count = a.size()
                  Count = 20
                  
                  dim i as n 
                  
                  ' Dim the chart & series
                  dim cd as Charting::ChartDataDefinition
                  dim cs as Charting::ChartSeriesDefinition
                  cd.series.add(cs)
                  'for i = 1 to count 
                  '				dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  '				cdd.value = Format_Data(DataToPlot[i].value,",")
                  '				cdd.label = LabelToPlot[i].name + " ("+cdd.value+")"
                  '				cs.data.add(cdd)
                  'next
                  
                  'for i = 1 to Count 
                  '				dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  '				cdd.value = format_data(LabelToPlot[i].value,",")
                  '				cdd.label = DataToPlot[i].name + " ("+cdd.value+")"
                  '				cs.data.add(cdd)
                  'next
                  
                  'populating the array didnt work... so...
                  
                  DateTxt1 = dtoc(date()-7*20)
                  DateTxt2 = dtoc(date()-7*19-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*19)
                  DateTxt2 = dtoc(date()-7*18-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  
                  
                  DateTxt1 = dtoc(date()-7*18)
                  DateTxt2 = dtoc(date()-7*17-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  
                  DateTxt1 = dtoc(date()-7*17)
                  DateTxt2 = dtoc(date()-7*16-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*16)
                  DateTxt2 = dtoc(date()-7*15-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*15)
                  DateTxt2 = dtoc(date()-7*14-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*14)
                  DateTxt2 = dtoc(date()-7*13-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*13)
                  DateTxt2 = dtoc(date()-7*12-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*12)
                  DateTxt2 = dtoc(date()-7*11-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*11)
                  DateTxt2 = dtoc(date()-7*10-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*10)
                  DateTxt2 = dtoc(date()-7*9-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*9)
                  DateTxt2 = dtoc(date()-7*8-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*8)
                  DateTxt2 = dtoc(date()-7*7-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*7)
                  DateTxt2 = dtoc(date()-7*6-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*6)
                  DateTxt2 = dtoc(date()-7*5-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*5)
                  DateTxt2 = dtoc(date()-7*4-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*4)
                  DateTxt2 = dtoc(date()-7*3-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*3)
                  DateTxt2 = dtoc(date()-7*2-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*2)
                  DateTxt2 = dtoc(date()-7*1-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  DateTxt1 = dtoc(date()-7*1)
                  DateTxt2 = dtoc(date()-7*0-1)
                  DataToPlot = tablesum("consultordcpo","Consultnum = " + alltrim(str(Var->Consultant)) + ".and.BETWEEN(orderdtoproc,{" + DateTxt1 + "},{" + DateTxt2 + "})","Consultcpo")
                  LabelToPlot = DateTxt1 ' week beginning
                  dim cdd as Charting::ChartValueDefinition = new Charting::ChartValueDefinition()
                  cdd.value = Format_Data(DataToPlot,",")
                  cdd.label = LabelToPlot + " ("+cdd.value+")"
                  cs.data.add(cdd)
                  
                  plotArrayDataCPOWk = cd
                  end function
                  Last edited by David Boomer; 01-26-2015, 02:36 PM. Reason: add info

                  Comment


                    #10
                    Re: Chart XBasic not working

                    DateTxt1 = dtoc(date()-(7*Counter))
                    DateTxt2 = dtoc(date()-(7*(Counter-1)))
                    There can be only one.

                    Comment


                      #11
                      Re: Chart XBasic not working

                      Thanks Stan... that was the major problem

                      Comment

                      Working...
                      X