Chart size not coming through from FileMaker to JS
I am working through the JS for FM course. I’m to the part where you try passing parameters for the chart through FileMaker to JS. I’m trying to do this with the size of the chart. I can’t seem to make it work. I pass the chart size through FileMaker, the chartSize appears in the console, but doesn’t affect the actual size of the chart. What am I missing?
Here is the JS:
import c3 from "c3"; window.loadChart = function (json) { console.log("loadChart", json); const obj = JSON.parse(json); console.log(obj); const data = obj.data; const chartType = obj.chartType; const chartSize = obj.chartSize; console.log(chartType); console.log(chartSize); const options = { bindto: "#chart", color: { pattern: ["#4287f5", "#753b6b"] }, data: { json: data, type: chartType, size: chartSize, labels: true, keys: { value: ["month", "Apples", "Peaches", "Pears"] }, }, axis: { x: { type: "month" }, }, }; const chart = c3.generate(options); };
And here is the FileMaker:
Here is what the console shows: