4 Replies Latest reply on May 1, 2016 2:00 PM by bishop0072

    Create chart graph

    bishop0072

      I am having trouble trying to start a bar graph.  I have a MeasurementsData table that has BodyAgeDate and Weight field that I want to use for the graph.  Date on left and weight on bottom.  I want to be able to have 2 date fields that I can pick months to compare and have those data populate the graph. 

       

      Please any help is appreciated.

        • 1. Re: Create chart graph
          erolst

          Try this:

           

          Create a calculation field, type Date, as

          BodyAgeDate - Day ( BodyAgeDate ) + 1

           

          Create a summary field, type ? (Average?), that summarizes the Weight field

           

          In the Chart object, select Current records – summary values as data source.

           

          For the x axis, specify a calculation like

          Left ( MonthName ( BodyAgeDate ) ; 3 ) & " " & Year ( BodyAgeDate )

           

          For the y axis, specify the summary field.

           

          Find the records to summarize, then (important!) sort that found set by the calculation field.

          • 2. Re: Create chart graph
            bishop0072

            Thank you!  One more question.  Is there a way for me to just show the last 3 months of data?

            • 3. Re: Create chart graph
              erolst

              Sure; create a script like:

               

              Enter Find Mode [ no pause ]

              Set Field [ target field: YourTableName::BodyAgeDate ; calculated result: ">=" & Get ( CurrentDate ) - 90 ]

              Set Error Capture [ on ]

              Perform Find [ no restore ]

              If [ not Get ( FoundCount ) ]

                # [ no matching records found ; show all records, or display a dialog, or … ]

              End If

              Sort Records [ theCalculatedDateField ]

               

              You can of course search for exactly the last three months, but if 90 days does the job …

              • 4. Re: Create chart graph
                bishop0072

                Thank you!  Where do I put the script?  This graph is actually on the same layout with a lot of of data fields.

                 

                Thank you for your help.