> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# /visualize/image/chart

```
URL: http://<db.host>:<db.port>/visualize/image/chart
```

Scatter plot is the only plot type currently supported. A non-numeric column
can be specified as x or y column and jitters can be added to them to avoid
excessive overlapping. All color values must be in the format RRGGBB or
AARRGGBB (to specify the alpha value). The image is contained in the output
parameter *image\_data* field.

## Input Parameter Description

<ParamField body="table_name" type="string">
  Name of the table containing the data to be drawn as a chart, in \[schema\_name.]table\_name format, using standard [name resolution rules](../../concepts/tables/#table-name-resolution).
</ParamField>

<ParamField body="x_column_names" type="array of strings">
  Names of the columns containing the data mapped to the x axis of a chart.
</ParamField>

<ParamField body="y_column_names" type="array of strings">
  Names of the columns containing the data mapped to the y axis of a chart.
</ParamField>

<ParamField body="min_x" type="double">
  Lower bound for the x column values. For non-numeric x column, each x column item is mapped to an integral value starting from 0.
</ParamField>

<ParamField body="max_x" type="double">
  Upper bound for the x column values. For non-numeric x column, each x column item is mapped to an integral value starting from 0.
</ParamField>

<ParamField body="min_y" type="double">
  Lower bound for the y column values. For non-numeric y column, each y column item is mapped to an integral value starting from 0.
</ParamField>

<ParamField body="max_y" type="double">
  Upper bound for the y column values. For non-numeric y column, each y column item is mapped to an integral value starting from 0.
</ParamField>

<ParamField body="width" type="int">
  Width of the generated image in pixels.
</ParamField>

<ParamField body="height" type="int">
  Height of the generated image in pixels.
</ParamField>

<ParamField body="bg_color" type="string">
  Background color of the generated image.
</ParamField>

<ParamField body="style_options" type="map of string to arrays of strings">
  Rendering style options for a chart.

  <Expandable title="style_options">
    <ParamField body="pointcolor">
      The color of points in the plot represented as a hexadecimal number.

      The default value is `0000FF`.
    </ParamField>

    <ParamField body="pointsize">
      The size of points in the plot represented as number of pixels.

      The default value is `3`.
    </ParamField>

    <ParamField body="pointshape">
      The shape of points in the plot.

      The default value is `square`.

      The supported values are:

      * none
      * circle
      * square
      * diamond
      * hollowcircle
      * hollowsquare
      * hollowdiamond
    </ParamField>

    <ParamField body="cb_pointcolors">
      Point color class break information consisting of three entries: class-break attribute, class-break values/ranges, and point color values. This option overrides the pointcolor option if both are provided. Class-break ranges are represented in the form of "min:max". Class-break values/ranges and point color values are separated by cb\_delimiter, e.g. \{"price", "20:30;30:40;40:50", "0xFF0000;0x00FF00;0x0000FF"}.
    </ParamField>

    <ParamField body="cb_pointsizes">
      Point size class break information consisting of three entries: class-break attribute, class-break values/ranges, and point size values. This option overrides the pointsize option if both are provided. Class-break ranges are represented in the form of "min:max". Class-break values/ranges and point size values are separated by cb\_delimiter, e.g. \{"states", "NY;TX;CA", "3;5;7"}.
    </ParamField>

    <ParamField body="cb_pointshapes">
      Point shape class break information consisting of three entries: class-break attribute, class-break values/ranges, and point shape names. This option overrides the pointshape option if both are provided. Class-break ranges are represented in the form of "min:max". Class-break values/ranges and point shape names are separated by cb\_delimiter, e.g. \{"states", "NY;TX;CA", "circle;square;diamond"}.
    </ParamField>

    <ParamField body="cb_delimiter">
      A character or string which separates per-class values in a class-break style option string.

      The default value is `;`.
    </ParamField>

    <ParamField body="x_order_by">
      An expression or aggregate expression by which non-numeric x column values are sorted, e.g. "avg(price) descending".
    </ParamField>

    <ParamField body="y_order_by">
      An expression or aggregate expression by which non-numeric y column values are sorted, e.g. "avg(price)", which defaults to "avg(price) ascending".
    </ParamField>

    <ParamField body="scale_type_x">
      Type of x axis scale.

      The default value is `none`.

      * **none**: No scale is applied to the x axis.
      * **log**: A base-10 log scale is applied to the x axis.
    </ParamField>

    <ParamField body="scale_type_y">
      Type of y axis scale.

      The default value is `none`.

      * **none**: No scale is applied to the y axis.
      * **log**: A base-10 log scale is applied to the y axis.
    </ParamField>

    <ParamField body="min_max_scaled">
      If this options is set to *false*, this endpoint expects request's min/max values are not yet scaled. They will be scaled according to scale\_type\_x or scale\_type\_y for response. If this options is set to *true*, this endpoint expects request's min/max values are already scaled according to scale\_type\_x/scale\_type\_y. Response's min/max values will be equal to request's min/max values.

      The default value is `false`.
    </ParamField>

    <ParamField body="jitter_x">
      Amplitude of horizontal jitter applied to non-numeric x column values.

      The default value is `0.0`.
    </ParamField>

    <ParamField body="jitter_y">
      Amplitude of vertical jitter applied to non-numeric y column values.

      The default value is `0.0`.
    </ParamField>

    <ParamField body="plot_all">
      If this options is set to *true*, all non-numeric column values are plotted ignoring min\_x, max\_x, min\_y and max\_y parameters.

      The default value is `false`.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="options" type="map of string to strings">
  Optional parameters.

  The default value is an empty map ( \{} ).

  <Expandable title="options">
    <ParamField body="image_encoding">
      Encoding to be applied to the output image. When using JSON serialization it is recommended to specify this as *base64*.

      The default value is `none`.

      * **base64**: Apply base64 encoding to the output image.
      * **none**: Do not apply any additional encoding to the output image.
    </ParamField>
  </Expandable>
</ParamField>

## Output Parameter Description

The Kinetica server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query.  Here is a description of the various fields of the wrapper:

<ResponseField name="status" type="String">
  'OK' or 'ERROR'
</ResponseField>

<ResponseField name="message" type="String">
  Empty if success or an error message
</ResponseField>

<ResponseField name="data_type" type="String">
  'visualize\_image\_chart\_response' or 'none' in case of an error
</ResponseField>

<ResponseField name="data" type="String">
  Empty string
</ResponseField>

<ResponseField name="data_str" type="JSON or String">
  This embedded JSON represents the result of the /visualize/image/chart endpoint:

  <Expandable title="data_str">
    <ResponseField name="min_x" type="double">
      Lower bound for the x column values as provided in input parameter *min\_x* or calculated for non-numeric columns when plot\_all option is used.
    </ResponseField>

    <ResponseField name="max_x" type="double">
      Upper bound for the x column values as provided in input parameter *max\_x* or calculated for non-numeric columns when plot\_all option is used.
    </ResponseField>

    <ResponseField name="min_y" type="double">
      Lower bound for the y column values as provided in input parameter *min\_y* or calculated for non-numeric columns when plot\_all option is used.
    </ResponseField>

    <ResponseField name="max_y" type="double">
      Upper bound for the y column values as provided in input parameter *max\_y* or calculated for non-numeric columns when plot\_all option is used.
    </ResponseField>

    <ResponseField name="width" type="int">
      Width of the image as provided in input parameter *width*.
    </ResponseField>

    <ResponseField name="height" type="int">
      Height of the image as provided in input parameter *height*.
    </ResponseField>

    <ResponseField name="bg_color" type="string">
      Background color of the image as provided in input parameter *bg\_color*.
    </ResponseField>

    <ResponseField name="image_data" type="bytes">
      The generated image data.
    </ResponseField>

    <ResponseField name="axes_info" type="map of string to arrays of strings">
      Information returned for drawing labels for the axes associated with non-numeric columns.

      <Expandable title="axes_info">
        <ResponseField name="sorted_x_values">
          Sorted non-numeric x column value list for drawing x axis label.
        </ResponseField>

        <ResponseField name="location_x">
          X axis label positions of sorted\_x\_values in pixel coordinates.
        </ResponseField>

        <ResponseField name="sorted_y_values">
          Sorted non-numeric y column value list for drawing y axis label.
        </ResponseField>

        <ResponseField name="location_y">
          Y axis label positions of sorted\_y\_values in pixel coordinates.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="info" type="map of string to strings">
      Additional information.
    </ResponseField>
  </Expandable>

  Empty string in case of an error.
</ResponseField>
