Create a Smart Chart
Please be sure of your agent type and version and pick the right documentation accordingly.
This is the documentation of the forest-express-sequelize and forest-express-mongoose Node.js agents that will soon reach end-of-support.
forest-express-sequelize v9 and forest-express-mongoose v9 are replaced by @forestadmin/agent v1.
Please check your agent type and version and read on or switch to the right documentation.
This is still the latest Ruby on Rails documentation of the forest_liana agent, you’re at the right place, please read on.
This is the documentation of the django-forestadmin Django agent that will soon reach end-of-support.
If you’re using a Django agent, notice that django-forestadmin v1 is replaced by forestadmin-agent-django v1.
If you’re using a Flask agent, go to the forestadmin-agent-flask v1 documentation.
Please check your agent type and version and read on or switch to the right documentation.
This is the documentation of the forestadmin/laravel-forestadmin Laravel agent that will soon reach end-of-support.
If you’re using a Laravel agent, notice that forestadmin/laravel-forestadmin v1 is replaced by forestadmin/laravel-forestadmin v3.
If you’re using a Symfony agent, go to the forestadmin/symfony-forestadmin v1 documentation.
Please check your agent type and version and read on or switch to the right documentation.
Create a Smart Chart
On the previous page, we learned how API-based charts allow you to fetch any dataset from a custom endpoint. But using the finite list of predefined charts (Single, Distribution, Time-based, etc.), you are still constrained by how that data is displayed. With Smart Charts, you can code exactly what data you want and how you want it displayed!
Creating a Smart Chart
To create a chart and access the Smart Chart Editor, click on the Edit Smart Chart button:

Next, use the Template, Component, and Style tabs to create your customized chart. At any point, you can render your chart by clicking on the Run code button.

Don't forget to click on Create Chart (or Save if the chart is already created) once you're done!
Creating a Table Chart
Our first Smart Chart example will be a simple table: however you may choose to make it as complex and customized as you wish.
Using a trivial set of hardcoded data for example's sake:

To query a custom route of your Forest server as your datasource, you may use this syntax instead:
Creating a Bar Chart
This second example shows how you can achieve any format of charts, as you can benefit from external libraries like D3js.
In the above snippet, notice how we import the D3js library. Of course, you can choose to use any other library of your choice.
The resulting chart can be resized to fit your use:

Creating a density map
This last example shows how you can achieve virtually anything, since you are basically coding in a sandbox. There's no limit to what you can do with Smart charts.
In the above snippet, notice how we import the D3js library. Of course, you can choose to use any other library of your choice.
The resulting chart can be resized to fit your use:

Creating a Cohort Chart
This is another example to help you build a Cohort Chart.
In the above snippet, notice how we import the D3js library. Of course, you can choose to use any other library of your choice.
The resulting chart can be resized to fit your use:

Last updated
Was this helpful?