9 Replies Latest reply on Oct 28, 2010 4:44 AM by Jon1009

    Graph Axis

    Jon1009

      Title

      Graph Axis

      Post

      Hi just started using charts in filemaker. Ive created a chart but the X axis is listing every date for each record in my data. is they a way to only show one date for each month? As the X axis is just a big blur at the minute

      Ive attached a screen shot

      Cheers

      Jon

      screenshot.JPG

        • 1. Re: Graph Axis
          philmodjunk

          You could define a calculation field set to return text like this:

          If ( Day ( DateField ) = 1 ; MonthName ( DateField ) ; "" )

          Use this field to label your bottom axis.

          • 2. Re: Graph Axis
            Jon1009

            that gets rid of the blur but my data dosnt have information for each day so only month names with the 1 of the month entered are showing up

            any other ideas?

            Cheers

            Jon

            • 3. Re: Graph Axis
              philmodjunk

              Define a summary field, sMonth, as "minimum of" DateField.

              Define a calculation field as:

              If ( DateField = GetSummary ( sMonth ; DateField ) ; MonthName ( datefield ) ; "' )

              Your records will need to be sorted by DateField in order for this to work, but that's an order you'd want anyway.

              • 4. Re: Graph Axis
                Jon1009

                I can't get that to work, Should the calculation field have Sorted next to it rather than Unsorted in Manage Database? Ive tried sorting it via the sort function in the main menu but still say unsotred. Any ideas?

                • 5. Re: Graph Axis
                  philmodjunk

                  I haven't let the caffiene kick in this morning. Let's start over. We need a "break" field that will group your records by month. Sorting by DateField won't do that.

                  Define another calculation field: cMonth as DateField - Day ( DateField ) + 1 -- got this idea from another Forum participant who goes by "Comment".

                  Change that GetSummary function to be:  GetSummary ( sMonth ; cMonth )

                  Now the function will return the earliest date of each month.

                  Sort your records first by cMonth then by your date field in order to get this to work.

                  • 6. Re: Graph Axis
                    Jon1009

                    Still having no luck looks like the if statement isnt finding any results i have done the following

                    cMonth        Calculation           DateOfAnalysis - Day ( DateOfAnalysis ) + 1

                    sMonth        Summary              Min of DateOfAnalysis

                    ChartAxis     Calculation           Unsotred, = If ( DateOfAnalysis = GetSummary ( sMonth ; cMonth ) ; MonthName ( DateOfAnalysis ) ; "")

                    and ive sorted the records by cMonth and DateOfAnalysis

                    but no joy :(

                    • 7. Re: Graph Axis
                      philmodjunk

                      Hmmm, cMonth should be set to return a value of type Date, so check that. ChartAxis should be set to return a value of type text, and all records for your graph must be in the found set.

                      Here's a demo file you can download and compare to your settings to see if you can figure out what's different: http://www.4shared.com/file/8jPzkeS8/MinDateDemo.html

                      • 8. Re: Graph Axis
                        Jon1009

                        Hello Ive looked at your solution and mine works the same way, shows the month in the table however when I set the X axis on the graph to the ChartAxis field it just appears blank any ideas?

                        • 9. Re: Graph Axis
                          Jon1009

                          Ive created another filed that looks up the value of the ChartAxis field and used that as the X Axes and that seems to work lovely now. dont know why it wouldnt work using the ChartAxis field. :(