ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Pivot Chart - default chart type (https://www.excelbanter.com/excel-discussion-misc-queries/43797-pivot-chart-default-chart-type.html)

Rav99

Pivot Chart - default chart type
 
I created a Pivot chart from Pivot table, however, as the user changes the
options (from pivot fields), then the chart type changes back to default one
(I want the line-column 2 axes one). I figured I could go to VBA properties
to default the chart type by choosing the chart code, however under that
list, there is no chart code for that combination chart (line chart + column
chart with 2 axes). How can I do this?

Can someone help... as I am not good at VBA? Thanks!

Debra Dalgleish

If you turn on the macro recorder as you apply the custom chart type,
you'll get code similar to the following:

ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, _
TypeName:="Line - Column on 2 Axes"


Rav99 wrote:
I created a Pivot chart from Pivot table, however, as the user changes the
options (from pivot fields), then the chart type changes back to default one
(I want the line-column 2 axes one). I figured I could go to VBA properties
to default the chart type by choosing the chart code, however under that
list, there is no chart code for that combination chart (line chart + column
chart with 2 axes). How can I do this?

Can someone help... as I am not good at VBA? Thanks!



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


Rav99

OK... I tried.. but it doesn't work... What I did ... I open VBE and click on
the Chart, on my right, I have Chart_Activate(), so I put the script you
provided underneath it and saved... but it doesn't work.

Did I do something wrong?

"Rav99" wrote:

I created a Pivot chart from Pivot table, however, as the user changes the
options (from pivot fields), then the chart type changes back to default one
(I want the line-column 2 axes one). I figured I could go to VBA properties
to default the chart type by choosing the chart code, however under that
list, there is no chart code for that combination chart (line chart + column
chart with 2 axes). How can I do this?

Can someone help... as I am not good at VBA? Thanks!


Debra Dalgleish

If you put the code in the Chart_Calculate event, it should work.

Rav99 wrote:
OK... I tried.. but it doesn't work... What I did ... I open VBE and click on
the Chart, on my right, I have Chart_Activate(), so I put the script you
provided underneath it and saved... but it doesn't work.

Did I do something wrong?

"Rav99" wrote:


I created a Pivot chart from Pivot table, however, as the user changes the
options (from pivot fields), then the chart type changes back to default one
(I want the line-column 2 axes one). I figured I could go to VBA properties
to default the chart type by choosing the chart code, however under that
list, there is no chart code for that combination chart (line chart + column
chart with 2 axes). How can I do this?

Can someone help... as I am not good at VBA? Thanks!




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


Rav99

yeh! Wow wow... it works...But now I have another problem of fixing the value
of my 2nd Y axis from 0 to 100%, but everytime I change the choice, it
changes accordingly based on the logarithmic method. Please ... after this...
I am really done with my project. Any thought?

Woowww woooow ... You really make my day!



"Debra Dalgleish" wrote:

If you put the code in the Chart_Calculate event, it should work.

Rav99 wrote:
OK... I tried.. but it doesn't work... What I did ... I open VBE and click on
the Chart, on my right, I have Chart_Activate(), so I put the script you
provided underneath it and saved... but it doesn't work.

Did I do something wrong?

"Rav99" wrote:


I created a Pivot chart from Pivot table, however, as the user changes the
options (from pivot fields), then the chart type changes back to default one
(I want the line-column 2 axes one). I figured I could go to VBA properties
to default the chart type by choosing the chart code, however under that
list, there is no chart code for that combination chart (line chart + column
chart with 2 axes). How can I do this?

Can someone help... as I am not good at VBA? Thanks!




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




All times are GMT +1. The time now is 07:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com