Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: OWC Bar/ Line Chart with vertical labels


Message #1 by mayur_vakharia@e... on Mon, 14 Oct 2002 17:27:47
Hi There,
Is there a way to rotate the column labels on a OWC Bar Chart so they 
display vertically? My labels are long and get squished together.
Thanks,
Mayur..
The Code I am using is given below:
	dim OwcChart,OwcchartObj,objChart
								
	dim Chart1							
		
								
	Set Chart1 = server.createObject("OWC.Chart")
								
	Chart1.Clear
								
	set objChart = Chart1.Charts.Add()
								
	objChart.Type = Chart1.Constants.chChartTypeLinemarkers 
								
	objChart.HasLegend = True	
									
							
								
	'objChart.Axes(0).Orientation = 
Chart1.Constants.chLabelOrientationDownward
									
								
								
	set Chart1.DataSource = objRS
								
	objChart.SetData Chart1.Constants.chDimSeriesNames, 0,ObjRs.Fields
(1).Name						
								
	for each objSeries in objChart.SeriesCollection
								   	
	objSeries.SetData Chart1.Constants.chDimCategories, 0, ObjRs.Fields
(0).Name
								   	
	objSeries.SetData Chart1.Constants.chDimValues, 0, ObjRs.Fields
(2).Name
								
	next
'									
				
								
	for each axis in Chart1.Charts(0).Axes
									
			axis.HasTitle = True
									
		if axis.Type = Chart1.Constants.chCategoryAxis then
									
			if request("cDate") <> "" then
									
				axis.Title.Caption = getPageSegmentData
("Page2_segment5 " & strParamPage2Segment4 & "," & intParamPage2Segment4 
& "," & "'" & selected_date &"'")(0,0)
									
			else
									
				axis.Title.Caption = getPageSegmentData
("Page2_segment5 " & strParamPage2Segment4 & "," & intParamPage2Segment4 )
(0,0)
									
			end if						
					
									
		else
									
			axis.Title.Caption = getPageSegmentData
("Page2_segment6 " & strParamPage2Segment4 & "," & intParamPage2Segment4  )
(0,0)				
									
		end if
								
	next								
		
									
	sFileName = "graph"
									
	Chart1.Refresh
									
	Chart1.ExportPicture Server.MapPath(sFileName), "GIF",600,400
									
	objRS.Close
									
	set objRS = Nothing

  Return to Index