The pie chart implementation is usually used to visualize a small categorical distribution. The pie chart uses keyAccessor to determine the slices, and valueAccessor to calculate the size of each slice relative to the sum of all values. Slices are ordered by ordering which defaults to sorting by key.
Examples:
Create a Pie Chart
Parameters: Name Type Argument Descriptionparent
String | node | d3.selection
Any valid d3 single selector specifying a dom block element such as a div; or a dom element or d3 selection.
chartGroup
String <optional>
The name of the chart group this chart instance should be placed in. Interaction with a chart will only trigger events and redraws within the chart's group.
// create a pie chart under #chart-container1 element using the default global chart group var chart1 = new PieChart('#chart-container1'); // create a pie chart under #chart-container2 element using chart group A var chart2 = new PieChart('#chart-container2', 'chartGroupA');
Get or set center x coordinate position. Default is center of svg.
Parameters: Name Type Argument Descriptioncx
Number <optional>
Get or set center y coordinate position. Default is center of svg.
Parameters: Name Type Argument Descriptioncy
Number <optional>
Get or set whether to draw lines from pie slices to their labels.
Parameters: Name Type Argument DescriptiondrawPaths
Boolean <optional>
Title to use for the only slice when there is no data.
Parameters: Name Type Argument Descriptiontitle
String <optional>
Position slice labels offset from the outer edge of the chart.
The argument specifies the extra radius to be added for slice labels.
Parameters: Name Type Argument DescriptionexternalLabelRadius
Number <optional>
Get or set the external radius padding of the pie chart. This will force the radius of the pie chart to become smaller or larger depending on the value.
Parameters: Name Type Argument Default DescriptionexternalRadiusPadding
Number <optional>
Get or set the inner radius of the pie chart. If the inner radius is greater than 0px then the pie chart will be rendered as a doughnut chart.
Parameters: Name Type Argument Default DescriptioninnerRadius
Number <optional>
Get or set the minimal slice angle for label rendering. Any slice with a smaller angle will not display a slice label.
Parameters: Name Type Argument Default DescriptionminAngleForLabel
Number <optional>
Get or set the outer radius. If the radius is not set, it will be half of the minimum of the chart width and height.
Parameters: Name Type Argument Descriptionradius
Number <optional>
Get or set the maximum number of slices the pie chart will generate. The top slices are determined by value from high to low. Other slices exceeding the cap will be rolled up into one single Others slice.
Parameters: Name Type Argument Descriptioncap
Number <optional>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4