Jump to content

Multi-Series Google Bar Charts


This topic is 2722 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies


Hi, I can't seem to get filemaker pro to plot google charts the way I want them in web viewer.

I want the graph to look something like this: bar-chart1.png
...Seems it would be pretty basic at first but I can't get this particular multi-series chart to work. It needs to plot ALL the records and MORE THAN ONE series.
I've created one table called 'MyTable' with 3 fields 'CarName', 'CarSpeed' and 'CarWeight'. I've populated the table with 5 records.
CarName on the Y-Axis, and against this, CarSpeed and CarWeight are plotted on the X-Axis as 2 series. i.e. series one is 'CarName' vs 'CarSpeed', series 2 is 'CarName' vs 'CarWeight'

I've managed to successfully create 2 graphs, first one plots the series ok but only works for one record. The second, in which I've used an ExecuteSQL command to collect the table data from FMP, shows all the records but for only one field on the X-Axis. Any help appreciated. I'm running filemaker pro 14, and I've attached the fmp file, as well as the javascript code from the web viewer of each graph.

Any help greatly appreciated

 

Google Charts-Demo File.fmp12

AllRecords-OneSeries.rtf

AllSeries-OneRecord.rtf

Edited by brendan_mahe
Link to comment
Share on other sites

Hi Brendan,

I would not put a function into the HTML. You want to run a script and gather the data, do the substitution (to make it look like Google expects it) and then save it to a global variable and add that variable in your HTML. You'll gain two things:

  1. You'll clearly see what data you generated in the variable while debugging your script
  2. You'll clearly see what data you generated in the webviewer in layout mode, because it will show, so you can see if there's an issue with your HTML.

Also, there's this useful thing called FMFiddle that you can download from here: https://cimbura.com/2016/08/29/gis-filemaker-part-1-basics/

 

Hope this helps,
Agi

Link to comment
Share on other sites

Hi Brendan,

I recently ran into the same issue.   I typically use ExecuteSQL function to get my data for charting.   There are some limitations of this function but with some help I was able to bend the data into shape.   Have a look: https://community.filemaker.com/thread/166294.   Hope that helps

Edited by rivet
Link to comment
Share on other sites

  • Newbies

Agnes that's what I ended up doing, Jeremy Brown over in community.filemaker.com was very helpful and pointed me in that exact direction (see link below). Thanks for the link to that filemaker file it looks really useful.

Rivet, I was recommended against running an ExecuteSQL function in the html because of the fact it can run whenever it wants and it can take longer to complete the task. I'm sure I'll need to use that function soon, thanks

https://community.filemaker.com/message/615327

Link to comment
Share on other sites

This topic is 2722 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.