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

Message ListMessage List     Post MessagePost Message

  Base trendline on a subset of bar graph data
Posted by Chuck on Feb-15-2011 03:11
I currently have a bar graph showing a trendline but would like to add an additional trendline
only based off of the last 5 bar values.

My first few experiments have not turned out how I hoped, is there an easy way to do this
that I am missing?

Thanks!

  Re: Base trendline on a subset of bar graph data
Posted by Peter Kwan on Feb-15-2011 11:07
Hi Chuck,

You may just add the trend layer using the last 5 (x, y) coordinates only. If you are using Axis.setLabels to configure the x-axis, the x-coordinate of a bar is its array index. (The first bar is 0, the second bar is 1, etc.)

For example, in Python:

c.addTrendLayer2(range(len(myData) - 5, len(myData)), myData[-5:], 0x0000ff, "My Trend Line")

Hope this can help.

Regards
Peter Kwan