ComfyUI > Nodes > Comfyroll Studio > 🟢 CR Draw Pie

ComfyUI Node: 🟢 CR Draw Pie

Class Name

CR Draw Pie

Category
🧩 Comfyroll Studio/👾 Graphics/🟣 Shape
Author
Suzie1 (Account age: 2158days)
Extension
Comfyroll Studio
Latest Updated
2024-06-05
Github Stars
0.49K

How to Install Comfyroll Studio

Install this extension via the ComfyUI Manager by searching for Comfyroll Studio
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Comfyroll Studio in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

🟢 CR Draw Pie Description

Generate pie chart visualizations for data representation, aiding AI artists in creating data-driven graphics easily.

🟢 CR Draw Pie:

The CR Draw Pie node is designed to create pie chart visualizations, which are useful for representing data in a circular graph divided into slices to illustrate numerical proportions. This node is particularly beneficial for AI artists who want to incorporate data-driven graphics into their projects. By leveraging this node, you can easily generate pie charts that visually communicate the distribution of different data categories, enhancing the storytelling and analytical aspects of your artwork. The main goal of the CR Draw Pie node is to simplify the process of creating pie charts, making it accessible even to those without a technical background.

🟢 CR Draw Pie Input Parameters:

data

This parameter represents the data values that will be used to create the pie chart. Each value corresponds to a slice of the pie, with the size of each slice proportional to the value. The data should be provided as a list of numerical values. The minimum value for each data point is 0, and there is no strict maximum value, but the values should be positive to make sense in the context of a pie chart. The default value is an empty list, which means no pie chart will be drawn until data is provided.

labels

This parameter is a list of strings that label each slice of the pie chart. Each label corresponds to a data value, providing a textual representation of what each slice represents. The number of labels should match the number of data values. If no labels are provided, the slices will be unlabeled. The default value is an empty list.

colors

This parameter allows you to specify the colors of the pie slices. It should be a list of color codes (e.g., hex codes or color names). If the number of colors provided is less than the number of data values, the colors will cycle through the list. The default value is an empty list, which means the node will use a default color palette.

explode

This parameter is a list of numerical values that determine how far each slice is "exploded" out from the center of the pie. It is useful for highlighting specific slices. Each value should be between 0 and 1, where 0 means the slice is not exploded and 1 means the slice is fully exploded. The default value is an empty list, meaning no slices are exploded.

shadow

This boolean parameter determines whether a shadow is drawn beneath the pie chart, adding a 3D effect. The default value is False.

startangle

This parameter sets the starting angle of the pie chart in degrees. It rotates the start of the pie chart to the specified angle. The default value is 0 degrees.

autopct

This parameter is a string or function used to label the slices with their numeric value. If it is a string, it should be a format string (e.g., '%1.1f%%' to show percentages). If it is a function, it should take a numeric value and return a string. The default value is None, meaning no labels are shown.

pctdistance

This parameter is a float that specifies the distance of the percentage labels from the center of the pie. The default value is 0.6.

radius

This parameter is a float that sets the radius of the pie chart. The default value is 1, which means the pie will fit within the unit circle.

counterclock

This boolean parameter determines the direction in which the pie chart is drawn. If True, the slices are drawn counterclockwise. The default value is True.

wedgeprops

This parameter is a dictionary of additional properties for the pie chart wedges, such as edge color and line width. The default value is None.

textprops

This parameter is a dictionary of additional properties for the text labels, such as font size and color. The default value is None.

🟢 CR Draw Pie Output Parameters:

pie_chart

This output parameter is the generated pie chart visualization. It is a graphical representation of the input data, with each slice corresponding to a data value and labeled according to the provided labels. The pie chart can be used in various contexts, such as embedding in reports, presentations, or as part of a larger artwork.

🟢 CR Draw Pie Usage Tips:

  • Ensure that the number of labels matches the number of data values to avoid confusion.
  • Use the colors parameter to customize the appearance of your pie chart and make it visually appealing.
  • Experiment with the explode parameter to highlight specific slices and draw attention to important data points.
  • Utilize the autopct parameter to display percentage values on the slices for better data interpretation.

🟢 CR Draw Pie Common Errors and Solutions:

ValueError: data and labels must be of the same length

  • Explanation: This error occurs when the number of labels does not match the number of data values.
  • Solution: Ensure that the labels list has the same number of elements as the data list.

TypeError: colors must be a list of color codes

  • Explanation: This error occurs when the colors parameter is not provided as a list of valid color codes.
  • Solution: Provide a list of color codes (e.g., hex codes or color names) for the colors parameter.

ValueError: explode values must be between 0 and 1

  • Explanation: This error occurs when the explode parameter contains values outside the range of 0 to 1. - Solution: Ensure that all values in the explode list are between 0 and 1.

ValueError: startangle must be a number

  • Explanation: This error occurs when the startangle parameter is not a numerical value.
  • Solution: Provide a numerical value for the startangle parameter.

TypeError: autopct must be a string or a function

  • Explanation: This error occurs when the autopct parameter is not a string or a function.
  • Solution: Provide a valid format string or function for the autopct parameter.

🟢 CR Draw Pie Related Nodes

Go back to the extension to check out more related nodes.
Comfyroll Studio
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.