Where to process the data?
Many JS chart libraries require the data to be processed and formatted in a certain way or in one of multiple ways.
For example, ApexCharts has multiple ways to format the data.
One I use a lot is two arrays: one array for the x-axis categories and one array for the y-values. Or, for the pie chart, we need two arrays: the series and the labels.
Typically this data is not formatted in that way in a FileMaker table. In the case above those would be individual records, where the label (“Apple”) is in one field and the series value (23) is in a field “Sales”.
So the question is, how and where do you format the data?
We have two options: FileMaker scripting and JavaScript functions. Both work well.
So questions:
What are the advantages of either location?
What are the disadvantages of either location?
How are they similar?
Which one are you inclined to use? Why?