# Distribution

{% hint style="success" %}
This is the official documentation of the `agent_ruby` Ruby agent.
{% endhint %}

![Distribution Chart example](/files/jO8QF98RGtcFfvraGrba)

Distribution Charts display a pie and should return a plain object.

#### Traditional Syntax

Using full context methods with `add_chart`:

```ruby
@create_agent.add_chart('booksByAuthorCountry') do |_context, result_builder|
  result_builder.distribution({
    validated: 100,
    rejected: 100,
    to_validate: 100
  })
end
```

#### DSL Syntax

Using simplified DSL with `chart`:

```ruby
@create_agent.chart :booksByAuthorCountry do
  distribution({
    validated: 100,
    rejected: 100,
    to_validate: 100
  })
end
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.forestadmin.com/developer-guide-agents-ruby/agent-customization/charts/distribution.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
