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

Message ListMessage List     Post MessagePost Message

  Dual Trendlines
Posted by Anders on Apr-05-2011 23:04
Hi

I have a bar graph of values ​​over 12 months. For this graph, I have a trend line.
Is it possible to add a trend line to that just calculated out from the last four months.
This trend line is only plotted over the last 4 months.


//Anders

  Re: Dual Trendlines
Posted by Peter Kwan on Apr-06-2011 02:20
Hi Anders,

To add a trend line calculated based on the last 4 months, please simply add a trend layer using the data points from the last 4 months only.

For example, suppose you are using a label based x-axis (configured using Axis.setLabels or Axis.setLabels2). In this case, the x-coordinates of the data points are the array index of the labels, so the x-coordinates of the last 4 points are {8, 9, 10, 11}. The code is like (in VB/VBScript):

Set trendLayer = c.addTrendLayer2(Array(8, 9, 10, 11), Array(myData(8), myData(9), myData(10), myData(11)), c.xZoneColor(7.5, cd.Transparent, &H0000ff))

Call trendLayer.setLineWidth(2)

In the above code, the xZoneColor is used to cause the trend layer to be visible only for x >= 7.5 (starting from the mid-point between the 8th and 9th months).

If you need to translate the above to another programming language, please let me know.

Hope this can help.

Regards
Peter Kwan

  Re: Dual Trendlines
Posted by Anders on Apr-06-2011 13:56
Hi

Thanks for the quick reply. I use the graph in classic ASP


//Anders