# L.Minichart

add add bar, pie and polar charts to a leaflet map

  L.Minichart is used to add dynamic charts on a leaflet map. It is specially useful to represent multiple data values associated to some geographical coordinates.

  ### Constructor

  #### new L.Minichart(center, options)

  Name | Type | Description
  --- | --- | ---
  `center` | L.Point |
  `options` | MinichartOptions | Object containing options to construct a chart.

  ##### Example

      L.minichart([0, 0], {data: [1, 2, 3], maxValues: 3})

### Options

  Name | Type | Default | Description
  --- | --- | --- | ---
  `type` | string | "bar" | Type of chart to create. Possible values are "bar" for barcharts, "pie" for pie charts, "polar-radius" and "polar-area" for polar area charts where values are represented either by the radius or the area of the slices.
  `data` | Array.<number> | [1] | Data values the chart has to represent.
  `maxValues` | Array.<number> | [1] | maximal absolute value the data could take. It can be a single numeric value or an array of values with same length as data. In the first case, all values will be represented with the same scale while in the second case, each value will have its own scale. This is useful when one wants to represent multiple variables that are not comparable.
  `fillColor` | string | #4281e5 | Color used to fill the shape when data contains only one value.
  `colorPalette` | Array.<string> | d3.schemeCategory10 | Array of colors used to fill each part of the chart representing one value of data.
  `width` | number | 60 | Width of the chart when `type` equals 'bar' or maximal diameter of the chart for all other types.
  `height` | number | 60 | Maximal height of barcharts.
  `opacity` | number | 1 | Opacity of the chart.
  `showLabels` | boolean | false | Should values be displayed in the charts?
  `labelStyle` | string | "font-family:sans-serif" | CSS style to apply to labels
  `labelMinSize` | number | 8 | Labels are automatically hidden if the label height is less than this number.
  `labelMaxSize` | number | 24 | Maximal height of labels.
  `labelPadding` | number | 2 | Padding to apply to labels.
  `labelColor` | string | "auto" | Color to apply to labels. If "auto", text will be black or white depending on the background color.
  `labelText` | Array.<string> | null | null | Labels to display. It must have same length as data or be null. In the last case, data values are used as labels.
  `transitionTime` | number | 750 | Duration in millisecondq of transitions.

### Methods

  #### setOptions(options)

  Update the options of a minichart object.

  Name | Type | Description
  --- | --- | ---
  `options` | MinichartOptions | Object containing options to update the chart.

#### Search results