ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Stackoverflow in .NET
Posted by AJ on Aug-25-2011 22:52
I have the following code and in some situations, the setGapColor line causes ChartDirector to throw a StackOverflow exception during the makeChart which cannot be handled. Removing this line under the same conditions results in no exception being thrown. Any idea how to resolve this?

Thanks in advance.

Dim l0 As LineLayer = mc.addLineLayer2()
l0.addDataSet(Data1, c.dashLineColor(&HFF00), "test").setDataSymbol(Chart.NoShape, 0)
l0.setLegend(Chart.NoLegend)
l0.addExtraField(dataIndex)
l0.setLineWidth(1)
l0.setGapColor(Chart.SameAsMainColor)                      ''<<<<<< causes StackOverflow Exception in CD

  Re: Stackoverflow in .NET
Posted by Peter Kwan on Aug-26-2011 02:48
Hi AJ,

Is there is stack trace when the exception occur? This may be useful to help us identify the cause of the problem.

If no stack trace is available, is it possible to inform me the data that you use to generate the error, and also the chart size and plot area position)? I will try to reproduce the error.

Regards
Peter Kwan

  Re: Stackoverflow in .NET
Posted by Peter Kwan on Aug-26-2011 03:18
Hi AJ,

I have just discovered there is an error in the code in your earlier message, but I am not sure if this is the cause of the problem or not.

In your original code, you have:

Dim l0 As LineLayer = mc.addLineLayer2()
l0.addDataSet(Data1, c.dashLineColor(&HFF00), "test").setDataSymbol(Chart.NoShape, 0)

The "c.dashLineColor" should be "mc.dashLineColor". The dashLineColor must be created by the chart object that uses the color.

Regards
Peter Kwan

  Re: Stackoverflow in .NET
Posted by AJ on Aug-26-2011 03:32
That was it Peter - excellent spot.

Many thanks!