Creating Charts

G

Guest

I’m having a problem creating a pie pivot chart from a pivot table on an
active sheet. I first select the range that I want to plot from inside the
pivot table, and then add a chart to plot the selected field. The code I’m
using is as follows:

Range(“E7:19â€).Select
Charts.Add
ActiveChart.ChartType = xlPie

The problem is that the pivot chart that is generated always plots another
data field (i.e. the first field) in the pivot table, instead of the selected
range that I specify. Is there a way to create a pivot chart from a pivot
table and specify precisely what data field(s) you want to plot? If anyone
has any ideas, I would greatly appreciate it. Thanks.
 
J

Jon Peltier

Mel -

By definition everything in a pivot table (except the totals and subtotals) are
plotted in the corresponding pivot chart. You could make the pivot table not display
the particular item in the field, or you could make a normal chart. To make a normal
chart, select a blank cell away from the pivot table, add the chart, add a series,
define the .Name, .XValues, and .Values of the series, then assign the chart type.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top