# SmartChartAdapter

## Overview

Represents an adapter that can manipulate a calendar of any kind.

However, without an accompanying tool that can interact with a chart control, this adapter on its own does not perform any actions. In order to utilize the [SmartChartAdapter](/ai/components/api/smartadapter/wisej.ai.adapters.smartchartadapter.md) effectively, you must supply a tool capable of manipulating a chart control.

For instance, the [SmartChartJ3Adapter](/ai/components/adapters/smartchartjs3adapter.md) class is a derived class that utilizes the [ChartJS3Tools](/ai/components/built-in-smarttools/chartjs3tools.md) to interact with the `Wisej.Ext.Web.ChartJS` control.

This is the built-in prompt:

{% code overflow="wrap" %}

````ini
#
# SmartChartAdapter.
#
[SmartChartAdapter.Prompt]
Your job is to build a chart for the Data below and return a description of the data.

## Rules:
- The default chart type is {{defaultChartType}}
- Create the data sets for the chart using the JSON schema for the chart type
- Your response must always be only a short summary of what the data shows

```Data
{{dataSource}}
```
````

{% endcode %}

## Properties

In addition to the properties inherited from the [SmartAdapter](/ai/components/adapters/smartadapter.md), the SmartChartAdapter exposes the following additional properties.

### Prompt

This property acts as the prompt sent to the AI model to generate and populate the chart. When the AutoRun property is set to true, setting this property automatically initiates the chart generation process.

This property can be utilized on its own to define the data or in conjunction with other tools to enhance its functionality. Here are some examples:

1. "Plot 5 apples, 3 bananas, 8 kiwis. Use transparent pastel colors that resemble the fruit"
2. "Create a bar chart with Microsoft stock price for the past 5 years."
3. "Show a line chart with product sales by country last  year."

You can run sample 1 by itself. For sample 2 you need `this.adapter.UseTools(new WebSearchTools())` for sample 3 you need `this.adapter.UseTools(new DatabaseSearchTools(...))` connected to a sales database.


---

# 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/adapters/smartchartadapter.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.
