Skip to main content

ChartJS3Tools

Namespace: Wisej.AI.Tools

Assembly: Wisej.AI

Represents a container for ChartJS3 tools, providing functionalities to manipulate and build charts.

public class ChartJS3Tools : ToolsContainer

This class is designed to work with ChartJS3 objects, allowing the AI to configure and build various types of charts.

Constructors

ChartJS3Tools(chart)

Initializes a new instance of the ChartJS3Tools class with the specified chart.

NameTypeDescription
chartChartJS3The ChartJS3 object to be associated with this tools container.

Throws:

Properties

Chart

ChartJS3: Gets or sets the ChartJS3 object associated with this tools container. (Default: null)

Methods

build_chart(title, labels, dataSets)

Builds a chart with the specified title, labels, and datasets.

ParameterTypeDescription
titleStringThe title of the chart.
labelsString[]The labels for the chart's data points.
dataSetsObject[]The datasets to be included in the chart.

This method configures the chart's datasets and appearance based on the provided parameters.

get_dataset_schema(chartType)

Retrieves the dataset schema for the specified chart type.

ParameterTypeDescription
chartTypeChartTypeThe type of chart for which to get the dataset schema.

Returns: Object. An object representing the dataset schema for the specified chart type.

GetDataSetSchema(chartType)

Retrieves the dataset schema for a given chart type.

ParameterTypeDescription
chartTypeChartTypeThe type of chart for which to retrieve the dataset schema.

Returns: Object. An object representing the dataset schema for the specified chart type.

TranslateColor(color)

Translates a color object into a Color instance.

ParameterTypeDescription
colorObjectThe color object to translate.

Returns: Color. A Color instance representing the translated color.

TranslateColors(colors)

Translates an array of color objects into an array of Color instances.

ParameterTypeDescription
colorsObjectThe array of color objects to translate.

Returns: Color[]. An array of Color instances representing the translated colors.

Implements

NameDescription
IToolsContainerRepresents a container for tools, providing access to a hub, adapter, and a collection of parameters.