5 Replies Latest reply on Aug 21, 2014 1:40 PM by keywords

    Quick Chart - scriptable?

    HershHiltonHead

      Is there a way SCRIPT the selection of a field and have a quick chart be created?

       

      And once created is there a way to auto save the Layout Name and hide it from the menu list - but be accessible via buttons?

       

      Thanks in Advance for any and all insight.

        • 1. Re: Quick Chart - scriptable?
          mikebeargie

          There is no way to script creation of a quick chart, or a layout for that matter.

           

          Also there is no way to toggle the visibility of a layout in the menu via scripts either.

           

          Those are both "schema" operations, which filemaker does not give a lot of script access to. Similar to how we can't create tables or fields via scripts.

           

          It kind of makes sense to lock this down. Imagine if you got stuck in a loop script that created layouts until you system crashed and file corrupted itself?

           

          Now depending on what your goal with charting is, you could create a "utility" chart that doesn't actually hold data until you populate some global variables (EG $$xAxisDate, $$yAxisData) for the chart. This way you could use a single chart/layout for a number of "different" graphs.

          • 2. Re: Quick Chart - scriptable?
            Mike_Mitchell

            Piggybacking on Mike B's excellent suggestion to use a dynamic layout, it seems you would like to be able to save these charts once created. You can do this by storing the contents of the chart in a container field using GetLayoutObjectAttribute ( objectName ; "content" ). Just give your chart a name and then capture the contents into a container field.

             

            By doing this, you can go back to the chart later just by finding the right record (instead of saving it to a new layout every time). Just give the record some appropriate metadata (like date / time, name, user, or whatever) to facilitate the search.

             

            HTH

             

            Mike

            • 3. Re: Quick Chart - scriptable?
              HershHiltonHead

              Thanks for the tip.  While I suspected that was the case I thought I would ask anyway. 

               

              Having said that I am doing some neat things with creating multi-criteria find via looping routines and globals.  I also am able to save these customized reports to a sep table. I can recall and repopulaye the finds via a portal.

               

              I also accomplish using creating default report layouts a way to select the appropriate layout using the get(layoutnumber) call and then placing the "Report layout w chart {A} " right below the "Report layout w/o Chart {B}".  If you want the charted report the layout shifts to the layoutnumber of {A} + 1.  Obviously to make this work the layout have to be stacked on their proper order.

              Mike M's suggestion of the container field is cool, but I also save all output to a related Doc table.

               

              Thanks to both of you.

              • 4. Re: Quick Chart - scriptable?
                HershHiltonHead

                Thanks for the tip.  While I suspected that was the case I thought I would ask anyway. 

                 

                Having said that I am doing some neat things with creating multi-criteria find via looping routines and globals.  I also am able to save these customized reports to a sep table. I can recall and repopulaye the finds via a portal.

                 

                I also accomplish using creating default report layouts a way to select the appropriate layout using the get(layoutnumber) call and then placing the "Report layout w chart {A} " right below the "Report layout w/o Chart {B}".  If you want the charted report the layout shifts to the layoutnumber of {A} + 1.  Obviously to make this work the layout have to be stacked on their proper order.

                 

                Mike M's suggestion of the container field is cool, but I also save all output to a related Doc table.

                 

                Thanks to both of you.

                • 5. Re: Quick Chart - scriptable?
                  keywords

                  Or you could save the chart as a pdf …