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

Message ListMessage List     Post MessagePost Message

  Change TrendLayer color based on getSlope
Posted by Kevin on Jun-19-2018 23:09
Is there any way to programmatically set the TrendLayer line color?
If its positive I want it green, if negative red

I am struggling to understand how to evaluate the slope using getSlope / at what point I can evaluate it.

I have ( VB code )

Dim trend As TrendLayer = c.addTrendLayer(trendtable.getCol(1), &H72AB32)
Dim TrendSlope As Double = trend.getSlope
If TrendSlope < 0 Then
                        can i set the color here ??
End If

Or is there some way I can call getSlope before I call addTrendLayer ?

Any help very much appreciated

  Re: Change TrendLayer color based on getSlope
Posted by Peter Kwan on Jun-20-2018 02:31
Hi Kevin,

You can use the following code to change the line color after the TrendLayer has already been created:

trend.getDataSet(0).setDataColor(&HFF0000)

Hope this can help.

Regards
Peter Kwan