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 effectively, you must supply a tool capable of manipulating a chart control.

For instance, the SmartChartJ3Adapter class is a derived class that utilizes the ChartJS3Tools to interact with the Wisej.Ext.Web.ChartJS control.

This is the built-in prompt:

#
# 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}}
```

Properties

In addition to the properties inherited from the SmartAdapter, 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.

Last updated