Class: c3.Polar

Defined in: js/c3-polar.coffee
Inherits: c3.Chart

Overview

A chart that uses a polar coordinate system. r is the radial dimension and t is the angular dimension. The top is 0 degrees and the range is expressed in radians so a full circle is 0 to 2Pi. A polar chart can contain multiple layers.

Author:

Variables Summary

version =
0.1
type =
'polar'
layers =
[]

[Array<c3.Polar.Layer>] Array of polar layers

data =
[]

[Array] Default data array for layers in this polar chart. This can be set for each individual layer or a default for the entire chart.

r =
undefined

[d3.scale] Scale for the radial dimension. Please set the domain(), c3 will set the range(). This can be set for each individual layer or a default for the entire chart.

t =
undefined

[d3.scale] Scale for the angular dimension. Please set the domain(), c3 will set the range(). This can be set for each individual layer or a default for the entire chart.

angular_range =
[0, 2 * Math.PI]

[Number] Angular range for the polar chart in radians. 0 is up and the direction is clockwise. Defaults to the entire circle, which is [0, 2Pi]. Adjust this range to rotate the chart or use a semi-circle (e.g. [-Math.PI/2, Math.PI/2])

zoomable =
false

[Boolean] Enable this polar chart to be zoomable with the mouse wheel or touch pinching gesture

zoom_extent =
undefined

[Array] Array of minimum and maximum zoom scaling if zoomable is enabled

layer_options =
undefined

[c3.Selection.Options] Options to apply to each layer. For callbacks, the first argument is the layer object and the second argument is the index of the layer

Variable inherited from c3.Chart

type class options content_options anchor height width anchor_styles handlers

Class Method Summary

Instance Method Summary

Inherited Method Summary

Methods inherited from c3.Chart

#init #style #render #resize #redraw #restyle #_prep #_init #size #_size #update #_update #draw #_draw #_style

Class Method Details

. (Array<Number>) toPolar(x, y)

Convert cartesean x,y coordinates to polar coordinates.

Parameters:

  • x ( Number ) x pixel value with 0 in the middle
  • y ( Number ) y pixel value with 0 in the middle

Returns:

  • ( Array<Number> ) — Array of theta in radians and radial distance in pixels

Instance Method Details

# (void) _init() Bound

# (void) _size() Bound

# (void) _update(origin) Bound

# (void) _draw(origin) Bound

# (void) _style(style_new) Bound

# (Array<Number>) toPolar(x, y) Bound

Convert cartesean x,y coordinates to polar coordinates based on this chart's scales.

Parameters:

  • x ( Number ) x pixel value with 0 in the middle
  • y ( Number ) y pixel value with 0 in the middle

Returns:

  • ( Array<Number> ) — Array of theta in this chart's t domain and radial distance in this chart's r domain.

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: