Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 khan_imran
		
			khan_imran
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello All,
I have a requirement to have dynamic chart based on selection from particular fields. In attached app, I am able to change the chart type from line chart to straight table or vice versa(through macro).
Now, I would like to have an addition of some codes in existing macro which will defined chart type basis on my selection from account field.
For example: If i select Account 1 then it will show scatter chart, if I select Account 2 then it will show line chart and if I select Account 3 then straight table will be the view.
Below is the macro which i have used in attached app.
sub SetChartType
set chart = ActiveDocument.GetSheetObject("CH04")
intObjectType = chart.GetObjectType
if intObjectType = 15 then 'is currently a line chart
chart.SetChartType 2
else
chart.SetChartType 4
end if
end sub
Kindly advise how to write in macro to achieve above output.
Regards,
Imran Khan
 
					
				
		
 hector_munoz
		
			hector_munoz
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Imran,
It looks like you have the same problem someone had once... Look at this thred:set Chart Type
, and if you need additional help let us know.
Regards,
H
 khan_imran
		
			khan_imran
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I need some macro which will change the chart type based on field selection. I have mentioned my requirement in my original post.
Regards,
Imran Khan
 
					
				
		
 hector_munoz
		
			hector_munoz
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		OK... Take a look to the attached sample.
Regards,
H
 khan_imran
		
			khan_imran
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks for solution, but how would you do that? I want to have just 3 charts i.e. Line Chart, Scatter Chart and Bar Chart.
Regrads,
Imran Khan
 
					
				
		
 hector_munoz
		
			hector_munoz
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		OK Imran,
Step by step:

MASTER:
LOAD * INLINE [
ID, DESC
0, Bar
3, Scatter
4, Line
];
I attach you another app.
Regards,
H
 
					
				
		
 marjan_it
		
			marjan_it
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		can I do this for drilldown select in dimention?
