Pinter
ENID
Reference
View as Markdown

Flint chart artifacts

Reference for chart artifacts rendered in Pinter chat.

Pinter chat renders flint_chart artifacts with flint-chart@0.4.1 and ECharts. The artifact content is a JSON-stringified ChartAssemblyInput:

{
  "type": "flint_chart",
  "title": "Sales by month",
  "content": "{\"data\":{\"values\":[...]},\"semantic_types\":{...},\"chart_spec\":{...}}"
}

content must contain data.values, semantic_types, and chart_spec. Each field referenced by encodings must exist in the data and have a semantic type. Use the canonical channels below for new artifacts.

Required shape

{
  "data": { "values": [{ "month": "Jan", "sales": 120 }] },
  "semantic_types": { "month": "Category", "sales": "Amount" },
  "chart_spec": {
    "chartType": "Bar Chart",
    "encodings": {
      "x": { "field": "month" },
      "y": { "field": "sales" }
    }
  }
}

Chart types and channels

Chart typeRequired channelsOptional channels
Scatter Plotx, ycolor, size, opacity, column, row
Regressionx, ysize, color, column, row
Connected Scatter Plotx, yorder, color, detail, column, row
Ranged Dot Plotx, ycolor
Boxplotx, ycolor, opacity, column, row
Strip Plotx, ycolor, size, column, row
Bar Chartx, ycolor, opacity, column, row
Grouped Bar Chartx, y, groupcolor, column, row
Stacked Bar Chartx, y, colorcolumn, row
Lollipop Chartx, ycolor, column, row
Pyramid Chartx, ycolor
Heatmapx, y, colorcolumn, row
Calendar Heatmapx, color—
Line Chartx, ycolor, opacity, column, row
Bump Chartx, ycolor, detail, column, row
Slope Chartx, ycolor, detail, column, row
Area Chartx, ycolor, opacity, column, row
Streamgraphx, y, colorcolumn, row
Range Area Chartx, y, y2color, column, row
Pie Chartsize, colorcolumn, row
Funnel Charty, size—
Treemapcolorsize, detail
Sunburst Chartcolorsize, group, detail
Treecolordetail, size
Histogramxcolor, column, row
Density Plotxcolor, column, row
ECDF Plotxcolor, detail, column, row
Parallel CoordinatesTwo or more numeric data fieldscolor, detail
Candlestick Chartx, open, high, low, closecolumn, row
Waterfall Chartx, ycolor, column, row
Gantt Charty, x, x2color, detail, column, row
Bullet Charty, x, goalcolor, column, row
Radar Chartx, ycolor, column, row
Rose Chartx, ycolor, column, row
Gauge Chartsizecolumn
Sankey Diagramx, y, size—
Network Graphx, y, size—

Flow, hierarchy, and polar charts

These charts are the most sensitive to channel selection:

Chart typeCanonical mapping
Funnel Charty = stage, size = count/value. Do not use color for the stage.
Sankey Diagramx = source, y = target, size = flow value.
Network Graphx = source node, y = target node, size = link weight.
Rose Chartx = category, y = value. color is only for a separate series grouping.
Radar Chartx = dimension, y = value. color is only for a separate series grouping.
Treemapcolor = category, size = value, detail = child category.
Sunburst Chartcolor = outer category, group = middle level, detail = leaf, size = value.
Treecolor = parent/category, detail = child, size = value.
Gauge Chartsize = value; column optionally creates one gauge per category.

Example: Sankey diagram

{
  "data": {
    "values": [
      { "source": "Pabrik A", "target": "Gudang", "value": 500 },
      { "source": "Gudang", "target": "Toko", "value": 500 }
    ]
  },
  "semantic_types": {
    "source": "Category",
    "target": "Category",
    "value": "Amount"
  },
  "chart_spec": {
    "chartType": "Sankey Diagram",
    "encodings": {
      "x": { "field": "source" },
      "y": { "field": "target" },
      "size": { "field": "value" }
    }
  }
}

Example: Funnel chart

{
  "data": {
    "values": [
      { "stage": "Applicants", "count": 1200 },
      { "stage": "Screening", "count": 400 },
      { "stage": "Hired", "count": 15 }
    ]
  },
  "semantic_types": { "stage": "Category", "count": "Count" },
  "chart_spec": {
    "chartType": "Funnel Chart",
    "encodings": {
      "y": { "field": "stage" },
      "size": { "field": "count" }
    }
  }
}

Compatibility aliases

The chat renderer accepts selected legacy/descriptive channel names for existing artifacts. This is a compatibility layer; agents and integrations should use the canonical channels above.

Chart typeAccepted legacy encodingNormalized to
Sankey Diagram, Network Graphsource, targetx, y
Funnel Chartstage, category, label, or color; valuey; size
Rose Chartcolor, sizex, y

Common failures

  • Use exact chart type names, such as Sankey Diagram and Network Graph.
  • An encoding channel must reference a field in data.values exactly.
  • Do not use ECharts option JSON as an artifact; pass the Flint input shape above.
  • Do not use channels; the field is encodings.
  • If the chart is blank, verify required channels first. Flint may omit a series when a required channel is absent.