# Render a daily sales bar chart for e-mail

**Use case:** 

Renders one PNG bar chart of orders over the last 7 days, with values printed on the bars. It also returns a base64 data URI you can embed directly in an e-mail or HTML from n8n, Make or Zapier. Costs about $0.002.

## Input

```json
{
  "type": "bar",
  "title": "Orders, last 7 days",
  "labels": [
    "Mon",
    "Tue",
    "Wed",
    "Thu",
    "Fri",
    "Sat",
    "Sun"
  ],
  "data": [
    132,
    118,
    141,
    155,
    170,
    210,
    188
  ],
  "charts": [
    {
      "chartId": "revenue",
      "type": "line",
      "title": "Revenue",
      "labels": [
        "Q1",
        "Q2",
        "Q3",
        "Q4"
      ],
      "datasets": [
        {
          "label": "2025",
          "data": [
            120,
            150,
            170,
            210
          ]
        },
        {
          "label": "2026",
          "data": [
            140,
            160,
            205,
            260
          ]
        }
      ]
    },
    {
      "chartId": "nps",
      "type": "gauge",
      "title": "NPS",
      "value": 62,
      "gaugeMin": -100,
      "gaugeMax": 100
    }
  ],
  "format": "png",
  "width": 600,
  "height": 300,
  "scale": 1,
  "theme": "light",
  "showValues": true,
  "showLegend": true,
  "showGrid": true,
  "fontScale": 1,
  "logoHeight": 40,
  "logoPosition": "top-right",
  "includeDataUri": true,
  "maxCharts": 1000
}
```

## Output

```json
{
  "index": {
    "label": "#",
    "format": "integer"
  },
  "chartId": {
    "label": "Chart ID",
    "format": "string"
  },
  "status": {
    "label": "Status",
    "format": "string"
  },
  "fileUrl": {
    "label": "Image",
    "format": "string"
  },
  "type": {
    "label": "Type",
    "format": "string"
  },
  "title": {
    "label": "Title",
    "format": "string"
  },
  "format": {
    "label": "Format",
    "format": "string"
  },
  "width": {
    "label": "Width",
    "format": "integer"
  },
  "height": {
    "label": "Height",
    "format": "integer"
  },
  "sizeBytes": {
    "label": "Size (bytes)",
    "format": "integer"
  },
  "error": {
    "label": "Error",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Chart Image Generator API: JSON to PNG, SVG, PDF Charts Actor is ready to run with the inputs already set for "Render a daily sales bar chart for e-mail". [Sign up or log in](https://console.apify.com/create-task-from-example/94rkduxTNgaInLfZN) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Render a daily sales bar chart for e-mail" task

The Chart Image Generator API: JSON to PNG, SVG, PDF Charts Actor will start running based on the input automatically. You can also change all the input fields, like chart type, title, and more, to match your specific use case.

### 3. Receive the "Render a daily sales bar chart for e-mail" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as #, chart id, status, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Render a daily sales bar chart for e-mail" task via API](https://apify.com/actose/chart-image-renderer.md).

## About this Actor

This example demonstrates how to use [Chart Image Generator API: JSON to PNG, SVG, PDF Charts](https://apify.com/actose/chart-image-renderer.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/actose/chart-image-renderer.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/actose/chart-image-renderer.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
