7 Replies Latest reply on Aug 7, 2012 2:14 PM by philmodjunk

    Graph is not compiling  right

    4guito

      Title

      Graph is not compiling  right

      Post

      Hello,

       

      I'm trying to add a graph to my dashboard and it's not working.

       

      I have a Vehicles table, Maintenance table. I want to be able to show the Total Amount spent on each vehicle this month, this Qtr, this Yr. In the maintenance table, I have maintenance Date, Amount. It's linked with _fk_vehicleID. Will I need a radio button for this month, this Qtr, this Yr.

       

      Thanks

        • 1. Re: Graph is not compiling  right
          philmodjunk

          What kind of chart?

          Perhaps a pie chart?

          And on what layout do you need to see the chart?

          How do you log records in the maintenance table? One record for each time maitnenance is performed on a vehicle?

          A pie chart for this can be set up on a layout based on the maitenance table and you can set it up for different periods of time by performing a find to pull up different found sets of records.

          • 2. Re: Graph is not compiling  right
            4guito

            A pie chart is fine.

            I want it in the dashboard layout.

            Yes it's one record for each time a maintenance is performed on a vehicle.

            • 3. Re: Graph is not compiling  right
              philmodjunk

              The one based on reservations?

              Such a chart cannot be placed on that layout. It will need to be placed on a layout based on the maintenance layout. A static copy could be copied from ther to the dashboard layout and placed in a container field. You'll first need to set it up on the maintenance layout, however.
              Whether pie chart of bar chart (Bar chart may work better depending on how many vehicles are in your fleet), you can use a summary field to compute the total fo the amount field. You can then specify that the chart use "groups of data when sorted", the Vehicle ID would provide data for the X-Axis and you specify the summary field for the Y axis. YOu then perform a find for all records in a specified date range and sort your records by Vehicle ID to get 1 wedge or bar for each vehicle that has maitenance performed in that time period.

              • 4. Re: Graph is not compiling  right
                4guito

                We have a total of 7 vehicles

                The chart is showing the graph for EACH time a vehicle goes for maintenance instead of the total amount for each vehicle.

                • 5. Re: Graph is not compiling  right
                  philmodjunk

                  Sort your records by Vehicle ID so that they are grouped by Vehicle.

                  • 6. Re: Graph is not compiling  right
                    4guito

                    It works!!

                    Now how can I make a static copy of it and place it in the dashboard layout?

                    • 7. Re: Graph is not compiling  right
                      philmodjunk

                      Define a global container field.

                      Use the Name box on the inspector's Position tab to give your chart you just got to work an object name such as "MChart".

                      Then you can use this script to load the global container field with the current chart in the chart object:

                      Set Field [YourTable::YourContainerField ; GetLayoutObjectAttribute [ "MChart" ; "Content" ]