# Visualization: Pie Chart (Image)

**Important:** The Image Charts portion of Google Chart Tools has been [officially deprecated](http://googledevelopers.blogspot.com/2012/04/changes-to-deprecation-policies-and-api.html) as of April 20, 2012. It will continue to work as per our [deprecation policy](https://developers.google.com/chart/terms).
1. [Overview](https://developers.google.com/chart/interactive/docs/gallery/imagepiechart#Overview)
2. [Example](https://developers.google.com/chart/interactive/docs/gallery/imagepiechart#Example)
3. [Loading](https://developers.google.com/chart/interactive/docs/gallery/imagepiechart#Loading)
4. [Data Format](https://developers.google.com/chart/interactive/docs/gallery/imagepiechart#Data_Format)
5. [Configuration Options](https://developers.google.com/chart/interactive/docs/gallery/imagepiechart#Configuration_Options)
6. [Methods](https://developers.google.com/chart/interactive/docs/gallery/imagepiechart#Methods)
7. [Events](https://developers.google.com/chart/interactive/docs/gallery/imagepiechart#Events)
8. [Data Policy](https://developers.google.com/chart/interactive/docs/gallery/imagepiechart#Data_Policy)

## Overview


A pie chart that is rendered as an image using the [Google Charts API](https://developers.google.com/chart/image/docs/gallery/pie_charts).

## Example

\<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"\>\</script\> \<script type="text/javascript"\> google.charts.load('current', {'packages':\['imagepiechart'\]}); \</script\> \<div id="chart_div" style="width: 400px; height: 240px;"\>\</div\> google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable(\[ \['Task', 'Hours per Day'\], \['Work', 11\], \['Eat', 2\], \['Commute', 2\], \['Watch TV', 2\], \['Sleep', 7\] \]); var chart = new google.visualization.ImagePieChart(document.getElementById('chart_div')); chart.draw(data, {width: 430, height: 240, title: 'My Daily Activities'}); }

```html
<html>
  <head>
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">
      google.charts.load("current", {packages:["imagepiechart"]});
      google.charts.setOnLoadCallback(drawChart);

      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Task', 'Hours per Day'],
          ['Work',        11],
          ['Eat',         2],
          ['Commute',     2],
          ['Watch TV',    2],
          ['Sleep',       7]
        ]);

        var chart = new google.visualization.ImagePieChart(document.getElementById('chart_div'));

        chart.draw(data, {width: 430, height: 240, title: 'My Daily Activities'});
      }
    </script>
  </head>
  <body>
    <div id="chart_div" style="width: 400px; height: 240px;"></div>
  </body>
</html>
```

## Loading


The `google.charts.load` package name is `"imagepiechart"`:

```
  google.charts.load('current', {packages: ['imagepiechart']});
```


The visualization's class name is `google.visualization.ImagePieChart`

```
  var visualization = new google.visualization.ImagePieChart(container);
```

## Data Format


Two columns.
The first column should be a string, and contain the slice label.
The second column should be a number, and contain the slice value.

## Configuration Options

You can specify the following options as part of the *options* object passed into
the visualization's `draw()` method.

| Name | Type | Default | Description |
|---|---|---|---|
| backgroundColor | string | '#FFFFFF' (white) | The background color for the chart in the [Chart API color format](https://developers.google.com/chart/image/docs/chart_params#gcharts_rgb). |
| color | string | Auto | Specifies a base color to use for all series; each series will be a gradation of the color specified. Colors are specified in the [Chart API color format](https://developers.google.com/chart/image/docs/chart_params#gcharts_rgb). Ignored if `colors` is specified. |
| colors | Array\<string\> | Auto | Use this to assign specific colors to each data series. Colors are specified in the [Chart API color format](https://developers.google.com/chart/image/docs/chart_params#gcharts_rgb). Color i is used for data column i, wrapping around to the beginning if there are more data columns than colors. If variations of a single color is acceptable for all series, use the `color` option instead. |
| enableEvents | boolean | false | Causes charts to throw user-triggered events such as click or mouse over. Supported only for specific chart types. See [Events](https://developers.google.com/chart/interactive/docs/gallery/imagepiechart#Events) below. |
| height | number | Container's height | Height of the chart in pixels. |
| is3D | boolean | false | If set to true, displays a three-dimensional chart. |
| labels | string | 'none' | What label, if any, to show for each slice. Choose from the following values: - 'none' - No labels. - 'value' - Use the slice value as a label. - 'name' - Use the slice name (the column name). |
| legend | string | 'right' | The location of the legend on the chart. Choose from one of the following values: 'top', 'bottom', 'left', 'right', 'none'. |
| title | string | no title | Text to display above the chart. |
| width | number | Container's width | Width of the chart in pixels. |

## Methods

| Method | Return Type | Description |
|---|---|---|
| `draw(data, options)` | none | Draws the chart. |

## Events

You can register to hear the events described on the [Generic
Image Chart](https://developers.google.com/chart/interactive/docs/gallery/genericimagechart#Events) page.

## Data Policy


Please refer to the [Chart API logging policy](https://developers.google.com/chart/interactive/faq#logging).