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

# Chart and diagram generation

> Ask Sofie to create charts, diagrams, timelines, flowcharts, and visual summaries directly in chat.

Chart and diagram generation lets Sofie turn a request into a visual output inside chat. Use it when you want a quick chart, process map, timeline, flowchart, or visual summary without opening a separate editor.

This is different from CoSheet charts. CoSheet is best when the chart should stay tied to spreadsheet data. Chart and diagram generation is best when the visual is a chat output that helps you understand or explain a result.

<Note>
  Sofie can create useful visuals from your request and available context, but you should still review labels, groupings, source data, and assumptions before using the visual in controlled work.
</Note>

## When to use chart and diagram generation

Use chart and diagram generation when you need to see a pattern, sequence, relationship, or process.

Good uses include:

* A deviation investigation timeline.
* A CAPA workflow or effectiveness check process.
* A tech transfer dependency map.
* A quality risk assessment decision tree.
* A Gantt-style project plan.
* A sequence diagram for handoffs between teams or systems.
* A mindmap for protocol sections, source gaps, or follow-up questions.
* A horizontal bar chart for top finding categories.
* A pie or bar chart for percentage breakdowns.
* A visual summary of a File Studio or CoSheet analysis.

## Choose the right surface

| Need                                                                        | Use                                            |
| --------------------------------------------------------------------------- | ---------------------------------------------- |
| A quick chart, diagram, flow, timeline, or visual summary in chat           | Chart and diagram generation                   |
| Editable spreadsheet data with formulas, pivots, and charts                 | CoSheet                                        |
| A downloadable Office file, generated PowerPoint, or code-based file output | File Studio                                    |
| Inspection of an existing chart, figure, image, PDF, or slide               | File Query                                     |
| Source-backed narrative around a visual                                     | Chat with selected sources or Workspace search |

<Tip>
  If Sofie returns a table when you wanted a visual, say `Create this as a chart or diagram in chat`.
</Tip>

## Ask for a chart

Name the chart type, data, grouping, and review goal.

<Steps>
  <Step title="Provide the source">
    Attach the file, select the CoSheet, add the Workspace, or paste the data summary Sofie should use.
  </Step>

  <Step title="Name the visual">
    Ask for a chart type such as horizontal bar, line, pie, scatter, or timeline.
  </Step>

  <Step title="Define the grouping">
    Tell Sofie which fields belong on the axis, legend, labels, or time scale.
  </Step>

  <Step title="Ask for a source check">
    Ask Sofie to list the data used, exclusions, units, and assumptions before or after creating the chart.
  </Step>
</Steps>

Good prompts:

```text theme={null}
Create a horizontal bar chart showing deviation findings by category. Use the attached tracker. Include category name, count, and a short note about any grouping assumptions.
```

```text theme={null}
Create a line chart of assay result trend by lot. Use the selected CoSheet range. Show the date on the x-axis and result value on the y-axis. List missing or excluded values before creating the chart.
```

```text theme={null}
Create a pie chart showing CAPA status distribution from this table. Use Open, In progress, Pending effectiveness check, and Closed as categories.
```

## Ask for a diagram

Use diagrams when the order, relationship, or decision path matters more than the numbers.

Common diagram requests:

| Diagram          | Use it for                                                                       |
| ---------------- | -------------------------------------------------------------------------------- |
| Flowchart        | Process steps, review paths, escalation logic, triage workflows.                 |
| Timeline         | Investigation events, batch milestones, meeting follow-ups, evidence chronology. |
| Gantt-style plan | Workstreams, owners, dependencies, and target dates.                             |
| Sequence diagram | Handoffs between teams, systems, roles, or review stages.                        |
| Decision tree    | Quality risk decisions, disposition logic, next-check recommendations.           |
| Mindmap          | Source gaps, protocol sections, stakeholder questions, training topics.          |
| Relationship map | Links between systems, records, documents, teams, or data sources.               |

Good prompts:

```text theme={null}
Create a flowchart for this deviation triage process. Include intake, initial impact assessment, immediate containment, investigation path, QA review, CAPA decision, and closure.
```

```text theme={null}
Create a timeline of the investigation events from the attached meeting notes and deviation summary. Mark dates with missing source support as "needs confirmation."
```

```text theme={null}
Create a decision tree for whether a CAPA effectiveness check needs additional sampling. Separate confirmed source rules from suggested decision points.
```

## Use visuals after analysis

Chart and diagram generation works well after Sofie has already analyzed sources.

For example:

1. Ask Sofie to profile a CoSheet or source file.
2. Review the findings, exclusions, and assumptions.
3. Ask Sofie to create a visual from the reviewed result.
4. Ask Sofie to explain what the visual supports and what it does not prove.

Good follow-up:

```text theme={null}
Using the analysis you just completed, create a visual summary with one horizontal bar chart for finding categories and one timeline for major investigation events. Keep unverified events marked as assumptions.
```

## Review the visual

Before you use a generated chart or diagram, check:

* The source file, Workspace, CoSheet, or data range used.
* Axis labels, units, dates, and category names.
* Whether counts, percentages, and totals match the source.
* Whether the chart type fits the question.
* Whether the visual hides missing values, outliers, or excluded records.
* Whether the diagram introduces steps, decisions, owners, or dates that were not in the source.
* Whether the visual needs SME review before it appears in a quality, clinical, regulatory, or controlled-process document.

Ask Sofie:

```text theme={null}
Review this chart before I use it. List the source data, included records, excluded records, grouping assumptions, label issues, and anything that needs SME confirmation.
```

## Refine the output

Use direct correction prompts.

| Goal                            | Prompt                                                                            |
| ------------------------------- | --------------------------------------------------------------------------------- |
| Change chart type               | `Make this a horizontal bar chart instead of a pie chart.`                        |
| Clarify labels                  | `Use full category names and include units on the y-axis.`                        |
| Reduce clutter                  | `Remove data labels except for the top five categories.`                          |
| Show uncertainty                | `Mark unconfirmed dates as "needs confirmation".`                                 |
| Use reviewed data only          | `Use only the reviewed table from the previous message.`                          |
| Separate facts from assumptions | `Keep source-backed facts and assumptions in separate sections below the visual.` |
| Create a file instead           | `Use File Studio to place this visual in a downloadable PowerPoint file.`         |

## Related guides

* [Tools and capabilities](/chat/tools-and-capabilities)
* [Chat actions and tools reference](/chat/actions-and-tools-reference)
* [File Studio](/chat/file-studio)
* [Use formulas, pivots, and charts in CoSheet](/cosheets/formulas-pivots-charts)
* [Analyze CoSheet data with chat](/cosheets/analyze-data-with-chat)
