Page 1 of 1

Multi-series bar chart problem

Posted: Mon Oct 25, 2004 2:39 pm
by 9082734
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!

Posted: Mon Oct 25, 2004 2:44 pm
by Pep
Hi,

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

Posted: Mon Oct 25, 2004 2:59 pm
by 9082734
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

Posted: Wed Oct 27, 2004 7:50 am
by Pep
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 pep@steema.com