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

# Create a chart config

> Create a chart config



## OpenAPI

````yaml POST /project/{project_id}/chart/{id}/chart-dataset-config
openapi: 3.0.1
info:
  title: Chartbrew API reference
  description: The OpenAPI specification for Chartbrew
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.chartbrew.com
security:
  - bearerAuth: []
paths:
  /project/{project_id}/chart/{id}/chart-dataset-config:
    post:
      description: Create a new chart dataset configuration
      parameters:
        - name: project_id
          in: path
          description: ID of the project
          required: true
          schema:
            type: string
        - name: id
          in: path
          description: ID of the chart
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChartDatasetConfig'
      responses:
        '200':
          description: Created chart dataset configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChartDatasetConfig'
        '400':
          description: Error response
      security:
        - bearerAuth: []
components:
  schemas:
    ChartDatasetConfig:
      type: object
      properties:
        id:
          type: string
          format: uuid
        chart_id:
          type: integer
        dataset_id:
          type: integer
        xAxis:
          type: string
          description: >-
            Chart-specific x-axis or dimension field using traversal syntax -
            root[].field
        xAxisOperation:
          type: string
          description: Chart-specific x-axis operation
        yAxis:
          type: string
          description: >-
            Chart-specific y-axis or metric field using traversal syntax -
            root[].field
        yAxisOperation:
          type: string
          description: >-
            Chart-specific operation to perform on the y-axis - none, sum, avg,
            min, max, count
        dateField:
          type: string
          description: >-
            Chart-specific date field using traversal syntax. Specifies which
            field should be used for date filtering.
        dateFormat:
          type: string
          description: Chart-specific date format to use for date filtering. e.g YYYY-MM-DD
        conditions:
          type: array
          description: Chart-specific conditions layered on top of the dataset
          items:
            type: object
            properties:
              id:
                type: string
              field:
                type: string
                description: Field using traversal syntax - root[].field
              operator:
                type: string
                enum:
                  - is
                  - isNot
                  - greaterThan
                  - lessThan
                  - greaterThanOrEqual
                  - lessThanOrEqual
                  - contains
                  - notContains
                  - isNull
                  - isNotNull
                description: Comparison operator
              value:
                type: string
              displayValues:
                type: boolean
                description: Whether to display the values in the dropdown UI
        formula:
          type: string
        datasetColor:
          type: string
        fillColor:
          type: string
        fill:
          type: boolean
          default: false
        multiFill:
          type: boolean
          default: false
        legend:
          type: string
        pointRadius:
          type: integer
        excludedFields:
          type: array
          items:
            type: string
        sort:
          type: string
        columnsOrder:
          type: array
          items:
            type: string
        order:
          type: integer
          default: 0
        maxRecords:
          type: integer
        goal:
          type: integer
        configuration:
          type: object
          description: >-
            Additional configuration options for the dataset. Currently used to
            give values to variables.
          properties:
            variables:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                    description: Variable name from DataRequest VariableBinding
                  value:
                    description: Override value (string, number, etc.)
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````