0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

Chart → Bars Chart

AI-generated

Overview

The node generates bar charts based on user-provided data points and labels. It is useful for visualizing numerical data in a clear, graphical format, such as sales figures over months, survey results, or performance metrics. Users can customize the chart's appearance including colors, size, and title. The output can be either an image file or a URL pointing to the generated chart.

Practical examples:

  • Visualizing monthly sales data with labeled bars.
  • Creating a quick report graphic for presentation slides.
  • Generating dynamic charts for dashboards or automated reports.

Properties

Name Meaning
Data Points Array of numbers representing the values for each bar in the chart (e.g., [10, 20, 30]).
Labels Array of strings labeling each data point/bar (e.g., ["Jan", "Feb", "Mar"]).
Chart Title Optional string to set the title displayed on the chart (e.g., "Sales by Month").
Background Color Hex color code defining the background color of the chart image (e.g., #ffffff for white).
Bar Colors Array of hex color codes for the fill color of each bar (e.g., ["#36A2EB", "#FF6384"]).
Border Colors Array of hex color codes for the borders around each bar (e.g., ["#36A2EB", "#FF6384"]).
Border Width Number specifying the width of the border around each bar in pixels (e.g., 1).
Return as URL Boolean indicating if the output should be a URL to the chart image instead of the image itself.
File Name Optional string to specify the filename for the generated chart image (e.g., "bar-chart.png").
Width Number specifying the width of the chart image in pixels (e.g., 800).
Height Number specifying the height of the chart image in pixels (e.g., 600).

Output

The node outputs JSON data containing the generated bar chart. Depending on the "Return as URL" property:

  • If false: The output includes the binary image data of the chart, which can be saved or used directly within workflows.
  • If true: The output contains a URL string pointing to the hosted chart image.

The output JSON structure typically includes fields for the image data or URL, along with metadata such as filename if provided.

Dependencies

  • Requires an API key credential for authentication with the external chart generation service at https://prod.0codekit.com.
  • The node sends a POST request to /generate/chart/bars endpoint with the chart parameters.
  • No additional local dependencies are needed; all processing is handled via the external API.

Troubleshooting

  • Invalid JSON input for Data Points or Labels: Ensure that the arrays are valid JSON and that the number of labels matches the number of data points.
  • API Authentication Errors: Verify that the API key credential is correctly configured and has necessary permissions.
  • Chart Generation Failures: Check that color codes are valid hex strings and dimensions are positive integers.
  • Empty or Missing Required Fields: Make sure required properties like Data Points and Labels are provided.
  • Output URL not accessible: If returning a URL, ensure network access to the external service and that the URL is valid.

Links and References

Discussion