# ChartJS3Tools

## Overview

`ChartJS3Tools` equips the AI with the capabilities necessary to create and populate charts utilizing the Wisej.Web.Ext.ChartJS3 control. Through these tools, the AI can generate dynamic and interactive charts.

Currently, it supports the following chart types: Line, Pie, Radar, PolarArea, Doughnut, and Bar. This class is designed for flexibility, allowing for easy extension to add new features or to implement custom tools for any type of chart control.

Use the code below to explore the existing implementation. It serves as a general example that can guide you in developing your own tools. By reviewing this code, you can gain insights into how the current functionality is structured and learn best practices for creating custom tools that extend the capabilities of ChartJS3Tools.

{% file src="/files/sHq13X93rnK4kCJzCocc" %}

## Using ChartJS3Tools

To enable the use of [ChartJS3Tools](/ai/components/api/tools/wisej.ai.tools.chartjs3tools.md), simply add it to a SmartHub, SmartAdapter, or SmartPrompt.

```csharp
this.smartPrompt1
    .UseTools(
        new ChartJSTools(new ChartJS3()));
```

You can add ChartJS3Tools to any adapter or prompt to enhance their core functionality in conjunction with other tools.

Please be aware that utilizing ChartJS3Tools necessitates the creation of a ChartJS3 instance beforehand. The tools are designed to operate on an existing ChartJ3 control. When you create this control, you have the flexibility to preconfigure it according to your preferences. For instance, you can preset attributes such as size, colors, or any other configurations that align with your specific needs. This preparatory setup ensures that your charts are tailored to your application's requirements right from the start.

For instance, you have the option to "retrieve" the chart after the AI has completed its task and then reassign a new chart by using the Chart property. This allows for dynamic updates and changes to your chart configurations, enabling further customization and refinement after the initial chart has been created by the AI.

## Properties

<table><thead><tr><th width="135">Name</th><th>Description</th></tr></thead><tbody><tr><td>Chart</td><td>Gets or sets the ChartJS3 object associated with the ChartJS3 tools container.</td></tr></tbody></table>


---

# 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.wisej.com/ai/components/built-in-smarttools/chartjs3tools.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.
