API: Donut

Reusable Donut Chart API class that renders a simple and configurable donut chart.

(require("Donut"))(_selection, _data)

This function creates the graph using the selection as container
Parameters:
Name Type Description
_selection D3Selection A d3 selection that represents the container(s) where the chart(s) will be rendered
_data DonutChartData The data to attach and generate the chart
Source:

Requires

  • module:d3-dispatch,

Methods


module:Donut(_selection, _data)

This function creates the graph using the selection as container
Parameters:
Name Type Description
_selection D3Selection A d3 selection that represents the container(s) where the chart(s) will be rendered
_data DonutChartData The data to attach and generate the chart
Source:

<static> colorSchema(_x)

Gets or Sets the colorSchema of the chart
Parameters:
Name Type Description
_x Array.<String> Desired colorSchema for the graph
Source:
Returns:
Current colorSchema or Chart module to chain calls
Type
String | module

<static> exportChart(filename, title)

Chart exported to png and a download action is fired
Parameters:
Name Type Description
filename String File title for the resulting picture
title String Title to add at the top of the exported picture
Source:

<static> externalRadius(_x)

Gets or Sets the externalRadius of the chart
Parameters:
Name Type Description
_x Number ExternalRadius number to get/set
Source:
Returns:
Current externalRadius or Donut Chart module to chain calls
Type
Number | Module

<static> hasFixedHighlightedSlice(_x)

Gets or Sets the hasFixedHighlightedSlice property of the chart, making it to highlight the selected slice id set with `highlightSliceById` all the time.
Parameters:
Name Type Description
_x Boolean If we want to make the highlighted slice permanently highlighted
Source:
Returns:
Current hasFixedHighlightedSlice flag or Chart module
Type
Boolean | module

<static> height(_x)

Gets or Sets the height of the chart
Parameters:
Name Type Description
_x Number Desired width for the graph
Source:
Returns:
Current height or Donut Chart module to chain calls
Type
Number | Module

<static> highlightSliceById(_x)

Gets or Sets the id of the slice to highlight
Parameters:
Name Type Description
_x Number Slice id
Source:
Returns:
Current highlighted slice id or Donut Chart module to chain calls
Type
Number | Module

<static> internalRadius(_x)

Gets or Sets the internalRadius of the chart
Parameters:
Name Type Description
_x Number InternalRadius number to get/set
Source:
Returns:
Current internalRadius or Donut Chart module to chain calls
Type
Number | Module

<static> isAnimated(_x)

Gets or Sets the isAnimated property of the chart, making it to animate when render. By default this is 'false'
Parameters:
Name Type Description
_x Boolean Desired animation flag
Source:
Returns:
Current isAnimated flag or Chart module
Type
Boolean | module

<static> margin(_x)

Gets or Sets the margin of the chart
Parameters:
Name Type Description
_x Object Margin object to get/set
Source:
Returns:
Current margin or Donut Chart module to chain calls
Type
Object | Module

<static> on()

Exposes an 'on' method that acts as a bridge with the event dispatcher We are going to expose this events: customMouseOver, customMouseMove and customMouseOut
Source:
Returns:
Bar Chart
Type
module

<static> orderingFunction(_x)

Changes the order of items given custom function
Parameters:
Name Type Description
_x function A custom function that sets logic for ordering
Source:
Returns:
Void function with no return
Type
function | Module

<static> width(_x)

Gets or Sets the width of the chart
Parameters:
Name Type Description
_x Number Desired width for the graph
Source:
Returns:
Current width or Donut Chart module to chain calls
Type
Number | Module