I’m creating a wizard to allow users create her owns visualization from a data source and I want to check what widgets are available on the ChartFactor Toolkit before rendering my chart selection component, how I can do that. thanks.
Get a list of available widgets
Hi, @pedro to get the list of all available visualizations you can do:
cf.getSupportedVisualizations()
You can take a look at the Supported Visualizations section of the documentation, let me know if this answers your question. Best regards.
Maybe not too related, but how can I get a specific visualization (already created)? I saw there is a cf.getAllVisualizations() and so far I go over the list searching for the one I need. Is there an easiest way to do this?
@rscoleman You can obtain a visual by the element you used to render it: cf.getVisualization('element-id')
. This is the easiest way.
If the visual you want to obtain is going to be used a lot and from different places in your app (let’s say to change visual options depending on user interactions), then you could assign the creation process to a global variable:
var visual = cf.provider('MyProvider')
.source('mysource')
....
visual.execute()
Note that execute has to be called AFTER since it returns a promise and not the instance.
Hi @dario cf.getSupportedVisualizations() works and returns me all the visualizations and that is ok, but I wonder if there is a way to see what visualization belongs to a specific module ? for example, which belong to the standard module (cft-standard-charts.min.js). Thanks.
Hi @pedro you can get a list of the supported charts of a specific module calling to the “list” method on the module global variable that is registered when the module is loaded at the first time, for example for the standard module (cft-standard-charts.min.js) should be something like this:
let standardModulesList = cf_standard.list();
I hope this answer your question. Best Regards.