Multi-series bar chart problem

TeeChart for ActiveX, COM and ASP
Post Reply
TCubs
Newbie
Newbie
Posts: 6
Joined: Fri Jun 04, 2004 4:00 am
Location: NY

Multi-series bar chart problem

Post by TCubs » Mon Oct 25, 2004 2:39 pm

Hi,

I have recently upgraded from v4 to v6 of the ASP version of TeeChart. I have noticed a problem with the bar chart series. Previously, we had a barchart with 3 series per item. There was a very small gap between series of the same item and a slightly larger gap between the 3rd series of the previous item and the first series of the next (to break up the groups of 3).

I cannot replicate this using TeeChart 6. I either get the same size gap between all the series and items, or I get no gap between the series. I have tries adding "buffer" series and changing the width using both BarWidthPercent and BarWidth, but this doesn't work (i.e. it ignores my values).

Can anyone help please, it's quite urgent? Thanks!

Pep
Site Admin
Site Admin
Posts: 3305
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Oct 25, 2004 2:44 pm

Hi,

which code are you using with TeeChart Pro v4 ? (so I can see what you refer) ?

TCubs
Newbie
Newbie
Posts: 6
Joined: Fri Jun 04, 2004 4:00 am
Location: NY

Post by TCubs » Mon Oct 25, 2004 2:59 pm

I can also send the 2 resulting JPGs if that's clearer, if you let me know an email address.

the main function call is below:

Code: Select all

function BreakoutsChart(SummaryArray)

	dim oChart, fName, valType, Portfolio, Benchmark, Liability, Buffer, maxY, minY
	redim Portfolio(ubound(SummaryArray, 2), 1)
	redim Liability(ubound(SummaryArray, 2), 1)
	redim Benchmark(ubound(SummaryArray, 2), 1)
	redim Buffer(ubound(SummaryArray, 2), 1)
				
	for i = 0 to ubound(SummaryArray, 2)
		Portfolio(i, 0) = FormatDate(SummaryArray(iSUMMARY_DATE, i))
		Benchmark(i, 0) = FormatDate(SummaryArray(iSUMMARY_DATE, i))
		Liability(i, 0) = FormatDate(SummaryArray(iSUMMARY_DATE, i))
		Buffer(i, 0)	= FormatDate(SummaryArray(iSUMMARY_DATE, i))
		Portfolio(i, 1) = SummaryArray(iSUMMARY_PORTFOLIO, i)
		Benchmark(i, 1) = SummaryArray(iSUMMARY_BENCHMARK, i)
		Liability(i, 1) = SummaryArray(iSUMMARY_LIABILITY, i)
		Buffer(i, 1)	= 0
	next
	
	call createDefaultChart(oChart, "Cashflow Profile: " & AnalyticName)
	call addChartBarSeries(oChart, Portfolio, "Portfolio", vbBlue)
	call addChartBarSeries(oChart, Benchmark, "Benchmark", vbRed)
	call addChartBarSeries(oChart, Liability, "Liabilities", vbGreen)
	call addChartBarSeries(oChart, Buffer, "", vbWhite)
	

	oChart.Series(0).asBar.OffsetPercent = -100 ' % of bar width		
	oChart.Series(1).asBar.OffsetPercent = -100 ' % of bar width		
	oChart.Series(2).asBar.OffsetPercent = -100 ' % of bar width		
	oChart.Series(3).asBar.OffsetPercent = -100 ' % of bar width		

	oChart.Series(3).ShowInLegend = false
	
	oChart.Series(0).asBar.BarWidthPercent = 100
	oChart.Series(1).asBar.BarWidthPercent = 100
	oChart.Series(2).asBar.BarWidthPercent = 100	

	oChart.Series(0).asBar.BarPen.Visible = false ' % hide bar lines
	oChart.Series(1).asBar.BarPen.Visible = false ' % hide bar lines
	oChart.Series(2).asBar.BarPen.Visible = false ' % hide bar lines

	oChart.Axis.Bottom.GridPen.Visible = false
	
	if ubound(SummaryArray, 2) > 5 then
		oChart.Axis.Bottom.Labels.Angle = 270
	end if
	
	call oChart.Axis.Left.AdjustMaxMin()
	
	minY = oChart.Axis.Left.Minimum
	maxY = oChart.Axis.Left.Maximum
	
	oChart.Axis.Left.Automatic = false

	oChart.Axis.Left.Minimum = 1.05 * minY
	oChart.Axis.Left.Maximum = 1.05 * maxY

	oChart.Aspect.View3D = (Request("3DON") = "on")
	fName = saveChart(oChart, chartWidth, chartHeight)
	set oChart = nothing
	
	BreakoutsChart = fName
end function

Pep
Site Admin
Site Admin
Posts: 3305
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Oct 27, 2004 7:50 am

Hi,

have you tried to set a less value for BarWidthPercent ? This should do what you are trying to accomplish. :

for i = 0 to 3
oChart.Series(i).asBar.BarWidthPercent = 96
next i

If you still having problems, please send me the screenshoots directly to [email protected]

Post Reply