1 2 Previous Next 23 Replies Latest reply on Nov 7, 2016 8:35 PM by beverly

    JavaScript: chart.js 2.0



      - an alternative charting method (using javascript) that may be used in WebViewer (calculate the data point series to be used from FM field contents).


      This is not directly FM, I will see if I can pull together an article and demo.



        • 1. Re: JavaScript: chart.js 2.0

          Thank you for this link, even without the demo it's already helpful



          • 2. Re: JavaScript: chart.js 2.0

            Thanks Bev - that looks like it will be really useful...

            • 3. Re: JavaScript: chart.js 2.0

              Thanks for sharing, Beverly. It looks great.



              • 4. Re: JavaScript: chart.js 2.0
                Benjamin Fehr

                I uploaded a example with Google Charts as a proof-of-concept long time ago.

                Google Charts with WebViewer


                Google Charts is one of many options to use WV for charting. Some others are mentioned in the document above.


                What all this techniques have in common is a JS with which you can build your WV formula and a schema how data must be structured to use in this formula.


                If you put the JS in a global text field, the WV-Charts will also work offline.

                • 5. Re: JavaScript: chart.js 2.0

                  Yes! a very useful example! I thought this article was well written to explain something that can be very foreign to others. (plus no Google terms of service... * https://developers.google.com/terms/ )



                  • 6. Re: JavaScript: chart.js 2.0
                    Mike Duncan

                    I've done a bunch too, and would be more enthusiastic about using these all over the place, if it weren't for the way web viewers print in Windows. If they resolve that...that could change how much I would use them.



                    • 7. Re: JavaScript: chart.js 2.0

                      Mike, when doing charts on the web, I frequently have a way to 'save' the chart (as jpg likely) and then it was displayed much more efficiently. I sure there are ways to 'capture' the chart in WV to save as image, I'm just not at a place where I can research. Do you know of any tips?




                      • 8. Re: JavaScript: chart.js 2.0
                        Mike Duncan

                        I hadn't considered that, but that might be possible. You might be able to get the contents of a canvas object to save that way, then just get it back to a container field...I'll have to do more testing.


                        Of course you lose any interactivity you might have, but that's something you might be able to script around and only grab a png when going to print.


                        Thanks for the idea


                        • 9. Re: JavaScript: chart.js 2.0

                          precisely - at time of print (or when there are several charts on a web page to display - so much faster to load the images)


                          happy to have supplied some grey-matter-spark, Mike. I'm just returning the favor, as you've inspired me many times!


                          • 10. Re: JavaScript: chart.js 2.0

                            Hi Bev,


                            As someone who has never properly grasped the capabilities and innuendos of the WebViewer, I'd really appreciate your giving us some extra help in setting up the WebViewer for these useful graphing options.





                            • 11. Re: JavaScript: chart.js 2.0

                              Thanks, John! I've already thought about how much 'extra' comparison I can put in there. Like this is FileMaker chart (same data) and how easy to do, but here is WebViewer and more work with some features that may be helpful.




                              • 12. Re: JavaScript: chart.js 2.0

                                bump! yes, I'm still planning to get to an article on this.


                                1 of 1 people found this helpful
                                • 13. Re: JavaScript: chart.js 2.0

                                  Hi Beverly,

                                  while waiting for your tutorial    I've tried to implement something with chart.js v2 by myself.


                                  I'd like to use these charts in Filemaker Go on the iPhone and I'm actually stuck with the chart size.


                                  Foreword: I don't know anything about Java and never used the web viewer tool that much (only for maps).


                                  I've begun with a simple line chart, using the code provided in your link, and tried to change the chart size through the syntax "<canvas id="myChart" width="mywidth" height="myheight"></canvas>", either inserting static values or passing the webviewer height and width via the GetLayoutObjectAttribute function, both of them with no luck.


                                  What I'm trying to get is a chart enlarged to fill the webviewer size, but as I narrow the window on the Mac - to reach iPhone screen width - the chart will maintain its width and constantly reduce its height, at the end being only +/- one third of the webviewer height...

                                  What am I doing wrong ? Is it possible to obtain the result I'm looking for ? I can attach the demo file if it helps (after I discover how to insert attachments...).


                                  Thank you (and everybody else who can help... )


                                  • 14. Re: JavaScript: chart.js 2.0

                                    just changing the size like that may not work. there may be a place inside the actual "window" of the HTML that needs a change, not just the chart dimensions of the enclosing JavaScript.



                                    1 2 Previous Next