Skip to content
Michal Töpfer edited this page Dec 15, 2020 · 3 revisions

StaticPieChart component.

Pie Chart

Properties

  • config: Config [R] – chart configuration object, specifies the data
    • Config:
      • arcs: Arc[] – array of configurations of the arcs
    • Arc:
      • label: string [R] – label displayed in the legend
      • color: d3-color.color [R] – color of the arc
      • value: number [R] – determines the size (angle) of the arc
  • height: number [R]
  • margin: Margin
  • getArcColor: function – Function to modify the color of the arc before rendering. Gets the Arc.color as argument and the returned value is used as fill color of each arc. Note: this does NOT modify the color in the legend.
  • getLabelColor: function – Gets the Arc.color as argument and the returned value is used as text color for the label.
  • legendWidth: number – width of the legend in pixels
  • legendPosition: LegendPosition – position of the legend
    • possible values: LegendPosition.NONE, LegendPosition.RIGHT, LegendPosition.BOTTOM
  • legendRowClass: string – CSS class applied to each row of the legend

Setting the data to display

To set the data, use the config property and set the label and value of each bar. This chart does not fetch any data from the server, it only displays the data it got through its properties.

Clone this wiki locally