13 Replies Latest reply on Jul 19, 2015 1:03 PM by scottlynch

    Pie Chart Setup Problem

    scottlynch

      Title

      Pie Chart Setup Problem

      Post

      I'm having issues creating a simple pie chart in FileMaker Pro Advanced 13.

      I have an employee tracker solution and I'm trying to design a quick glance dashboard with a simple pie chart that shows the count of each type of leave taken. For example sick days 3, unpaid 2, holiday 7 etc.

      All calculations work and show correct totals, but for the life of me I cant seem to get a simple pie chart working. I've read the help guides, searched the web and still no joy.

      I have a field called Type that has a value list attached via a dropdown list that includes the various types of leave,  i.e. Holiday, Paternity, Maternity, sick, unpaid etc.

      I have created calc fields for each leave type, "cHolidayFlag" with the calculation of FilterValues ( Type ; "Holiday" )

      I have then created summary fields which count each type i.e. sHolidayCount.

      On the dashboard I would like to create a simple pie chart that shows these counts by leave type and this is where my stumbling block is.

      In the chart setup box under "category labels" I've specified the  field name of "Type" and in the Slice Data field I ve have specified the field name sHolidayCount,  hoping it may just show holiday days taken?  In the Data Source section I've selected  "Current found set". 

      I feel i maybe missing a calculation field that includes all the different leave summary count types? If someone could point me in the right direction i'd be very grateful.

      Regards

       

        • 1. Re: Pie Chart Setup Problem
          philmodjunk

          How are the tables and relationships set up? A typical "dashboard" set up uses a layout based on TableA that displays summary data from related tables such as your table of employee leave data. If that's what you have here, you can't base your chart on the dashboard layout's found set.

          So have I described your set up correctly or is it something different?

          • 2. Re: Pie Chart Setup Problem
            scottlynch

            Hi Phil, Thanks for the reply and help. I've uploaded a picture of my relationship layout. I'm trying to adapt a starter solution that I think came with FM 11 or 12. And the dashboard layout that I'm trying to create is based upon the "Time Off" Table. Does this information help. Do I need to base the dashboard layout on Personnel Records Table?

            Regards

             

             

            • 3. Re: Pie Chart Setup Problem
              philmodjunk

              It doesn't match the typical definition of a "dashboard" layout so it's not what I described in my first post.

              The bars/points/wedges of a Y series in a FileMaker chart all need to come from the same field so you can't use any of your "c" fields for this chart, but you can use a single summary field.

              Set up a summary field to count or total your data. I think that you want total days leave in each category to control the size of each "wedge" in you chart. So a calculation field: End Date - Start Date with a number result type would calculate the daysLeave for each record and sTotalLeave could then be set up to compute the total of DaysLeave. You would use sTotalLeave for your wedge data and set up your data source options to be based on "FoundSet", "summarized data". You must then sort your records by the Type field to group your records by Type. Each wedge will then represent the number of days leave in each type of your found set.

              (When charting summarized data, you'll find a number of similarities between sub summary layout parts and your Y-Series, including the need to sort your records.)

              • 4. Re: Pie Chart Setup Problem
                scottlynch

                Hi Phil,
                Thanks so much for the help with the pie chart which is now working. But it has thrown up some more questions and queries.
                When I change a record in the "Time Off" portal which is on the Personnel Records layout, the change doesn't reflect in the chart correctly.
                For instance if i edit a record and change its leave type from compassionate leave to sick. I would expect the chart to reflect that change and increase the sick wedge by 1 day and show zero for compassionate leave. Or remove the compassionate wedge completely based on the fact that compassionate leave only had 1 day previously set against it.
                But whats happening is the compassionate leave wedge is still showing, but only the type title has changed. So in effect I now have two sick wedges instead of only one.
                Is there a way to almost refresh the data before selecting the chart layout? Hope I've explained it clearly enough.
                Regards.


                 

                 

                 

                 

                 

                • 5. Re: Pie Chart Setup Problem
                  philmodjunk

                  Just resort the records.

                  • 6. Re: Pie Chart Setup Problem
                    scottlynch

                    God as simple as that...and the only thing I didn't try!...

                    If i wanted to show just one wedge type instead of "all types" is it a question of filtering the sort list again? 
                    And thank you for taking the time to help me over this.

                     

                    • 7. Re: Pie Chart Setup Problem
                      philmodjunk

                      Wouldn't "one wedge type" produce a solid circle where the width of the wedge = the area of the circle?

                      Or do you really want two wedges, one for the specified type and one for everything else?

                      • 8. Re: Pie Chart Setup Problem
                        scottlynch

                        Sorry Phil, yes I meant two wedges.
                        Maybe my logic is thinking incorrectly. As I would assume that the whole circle would be based upon the number of days leave given to each employee at the beginning of the year, for example 28 days holiday. And that would make up the 100% full circle.  
                        And the second wedge could be the Type "Paid Leave" showing what the employee has actually taken (for example) 3 days.
                         
                        But what you have guided me through so far has worked perfectly and is more than adequate for my solution. I'm just trying to understand the basics, and see other ways I can improve it.  The help files with Filemaker are pretty poor in my opinion and don't really cover any depth of detail.

                        • 9. Re: Pie Chart Setup Problem
                          scottlynch

                          Hi Phil,
                          I've come back to this one again, and you are of course correct that "one wedge type" produces a solid circle. I have been struggling with this pie chart for some time and still can't figure out how to split the pie chart to show two wedges. i.e one wedge showing holiday taken and the other showing holiday remaining.
                          I have at present sTotalLeaveDuration which summarises all Paid Leave per employee, but does indeed produce a solid circle. How do I add the other wedge into this pie chart, when there is only the option for adding "one data slice" in the settings box?

                          Many thanks

                          • 10. Re: Pie Chart Setup Problem
                            philmodjunk

                            If the data source option for your chart is "current record, delimited data", then you need a single field or a single expression for your wedge data that includes two values separated by a return character. One would be the leave days taken, the other would be for the leave days remaining (total minus number of days taken).

                            The list function can be handy for this as it might be something like:

                            List ( LeaveDaysTaken ; 28 - LeaveDaysTaken )

                            Of course, you may have a field that can be used in place of the constant value 28.

                            • 11. Re: Pie Chart Setup Problem
                              scottlynch

                              Hi Phil,
                              Thank you very much for that it has worked, this is my calculation
                              List ( sLeaveDuration Total ; HolidayAllowanceFromPersonnel - sLeaveDuration Total )
                              Is there anyway of adding text to the calculation so each wedge is descriptive and not just a number and percentage as in the screen shot. I would like for example each wedge to show "leave taken" and "leave remaining".
                              Before changing to "current record delimited data" I was using related records, (but was a solid circle) and the sorted field name "Paid Leave" showed as a category label.

                              • 12. Re: Pie Chart Setup Problem
                                philmodjunk

                                List ( "Leave Taken" ; "Leave Remaining" )

                                Use that for your labels data.

                                • 13. Re: Pie Chart Setup Problem
                                  scottlynch

                                  Phil,
                                  Thank you so much for all your ongoing help and expertise, its working great.