Table of Contents
showExportDataMenuItem
attribute of the <chart> element as 1.
More details on exporting chart data as CSV using the right-click menu and its customization options here registerWithJS
flag of chart as 1 in your HTML code. 2.Invoke the getDataAsCSV()
API only after the chart has been rendered (i.e., in FC_Rendered
method) If we did the above and put the data in an alert box as soon as the chart was loaded, this is what our output would look like: Displaying exported data (using Javascript API) in an alert box
Yes, it is more like a “Hello World” example but then you get the point, don’t you? To see the exact code going behind the above example and more customization options, please check out the documentation on this here.exportDataSeparator
and exportDataQualifier
attributes respectively. If you want your CSV output to look a little cryptic for some purpose, here is something you can do: The CSV output would now look like this: <span>ySalespersonyxxySales Figurey</span> <span>yAlexyxxy25000y</span> <span>yMarkyxxy35000y</span> <span>yDavidyxxy42300y</span> <span>yGrahamyxxy35300y</span> <span>yJohnyxxy31300y</span>
exportDataFormattedVal
attribute of the <chart> element to ‘1’ – it is turned off by default. Once you have done that, the formatted CSV output would look as under: “Salesperson”,”Sales Figure” “Alex”,”$25K” “Mark”,”$35K” “David”,”$42.3K” “Graham”,”$35.3K” “John”,”$31.3K” That’s all about exporting data as CSV using FusionCharts. As always, we covered the feature here for FusionCharts specifically but it applies equally well to the other products in the FusionCharts Suite – FusionMaps, FusionWidgets and PowerCharts as well. Next up in the “How to get the most out of v3.1?” series is the usage of vertical separator lines for easier comprehension of data in the chart. So stay tuned… Have you ever spent hours buried in documentation, hunting for a specific piece of code?…
Do you feel like your data is a cryptic puzzle, locked away from revealing its…
In web development, mastering JavaScript charting libraries is crucial for keeping up with the fast-paced…
Ever spend an afternoon neck-deep in documentation, searching for that one elusive code snippet? Or…
In the dynamic world of data visualization, the need for precision and innovation has never…
Are you drowning in data but struggling to find the insights that drive real business…