1001fx - NoCode functions icon

1001fx - NoCode functions

1001fx is a set of functions for any automation platform. Our functions are simple, very well tested, scalable and offer features that most automation platforms do not offer.

Actions74

charts → Create a Pie Chart

AI-generated

Overview

This node creates pie or donut charts based on user-supplied data and chart options, then outputs the resulting chart in a chosen format (PDF, PNG, or JPG) as binary data. It is useful for automating the generation of visual reports, dashboards, or presentations where dynamic chart creation is required. For example, you could use it to visualize sales distribution, survey results, or any categorical data within an n8n workflow.

Properties

Name Meaning
Data Input Mode Select how to provide your data:
- Expression: Enter a JSON array directly.
- Manual: Add entries one by one with label, value, and optional color.
Data The dataset to be displayed in the chart. In Expression mode, this is a JSON array. In Manual mode, each entry includes:
- Label: Text for the slice
- Value: Numeric value
- Slice Color: Optional color for the slice
Chart Options Input Mode Choose how to set chart options:
- Expression: Enter options as a JSON object.
- Manual: Configure options via form fields.
Chart Options Customization settings for the chart, such as title, subtitle, colors, font, legend position, data label formatting, etc. Available options depend on the input mode.
Chart Type How to display your chart:
- pie
- donut
Output Format Desired output file format:
- pdf
- png
- jpg
Binary Property Name of the binary property where the generated chart will be stored. Default is data.

Output

  • The node outputs a binary file containing the generated chart in the selected format (PDF, PNG, or JPG).
  • The binary data is attached to the output item under the property name specified in "Binary Property".
  • The original JSON data from the input is preserved in the output item's json field.
  • If an error occurs and "Continue On Fail" is enabled, the output's json field will contain an error key with details.

Example output structure:

{
  "json": {
    // Original input data or error message
  },
  "binary": {
    "data": {
      "data": "<base64-encoded chart file>",
      "fileName": "chart.pdf",
      "mimeType": "application/pdf"
    }
  }
}

(The property name under "binary" may differ if a custom Binary Property is used.)

Dependencies

  • External Service: Requires access to the 1001fx API.
  • API Key: You must configure the 1001fxApi credential in n8n.
  • n8n Configuration: No additional environment variables are needed beyond the credential setup.

Troubleshooting

  • Missing or Invalid API Key:
    Error: Authentication failed or unauthorized.
    Solution: Ensure the 1001fxApi credential is correctly configured in n8n.

  • Invalid Data Format:
    Error: The API returns an error about malformed data.
    Solution: Double-check that your data matches the expected structure for the selected input mode.

  • Output Not Found in Binary:
    Error: The expected binary property is missing.
    Solution: Make sure the "Binary Property" field matches the property you are referencing downstream.

  • Large Data Sets:
    Issue: Very large datasets may cause timeouts or memory issues.
    Solution: Reduce the size of your data or split into multiple charts.

  • Error Handling:
    If "Continue On Fail" is enabled, errors are returned in the json.error field; otherwise, the workflow stops on error.

Links and References

Discussion