Objective

This is the official documentation of the forestadmin-agent-django and forestadmin-agent-flask Python agents.

Objective Charts are very similar to Value Charts, the only difference being that two numbers should be provided to the resultBuilder: the value and the objective.

from forestadmin.datasource_toolkit.context.agent_context import AgentCustomizationContext
from forestadmin.datasource_toolkit.decorators.chart.result_builder import ResultBuilder
from forestadmin.datasource_toolkit.interfaces.chart import Chart

async def companies_live_chart_fn(
    context: AgentCustomizationContext, result_builder: ResultBuilder
) -> Chart:
    return result_builder.objective(235, 300)

agent.add_chart("companiesLive", companies_live_chart_fn)

Last updated