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

Message ListMessage List     Post MessagePost Message

  Using Scatter Layer with Finance Chart
Posted by John Best on Feb-06-2016 23:59
Attachments:
Hi Peter,

I am trying to plot some symbols on Finance chart. Please see the attached image.
The candlesticks squeezes when Scatter layer is applied.


Please help me... I am using Chartdirect 5.0 with Old Visual Basic 6


Regards
John
Untitled.png

  Re: Using Scatter Layer with Finance Chart
Posted by John, on Feb-07-2016 04:07
Hi John,

For Finance Chart, do you mean you are using the "FinanceChart" object (created using
cd.FinanceChart), or are you using an XYChart object (created using cd.XYChart)?

If you are using an XYChart object, please try to add the line:

Call c.yAxis().setAutoScale(0.05, 0.05, 0)

By default, if auto-scaling is used, the XYChart object will prefer to start the y-axis from
0, unless the data range is small. The setAutoScale can be used to disable this
preference to start the y-axis from 0. The FinanceChart object does not have this
preference to start the y-axis from 0.

If you are already using the FinanceChart object, or the setAutoScale does not solve the
problem, one possibility is that your scatter layer really contain 0 as a data value.
Because the y-axis will auto-scale to cover the entire data range, so it needs to start
from 0 if you really have a data value of 0.

In VB6, one common mistake is to declare the array to large. For example, suppose you
have 100 trading sessions, one mistake is to use "ReDim myData(100)" to declare
array. The correct code should be "ReDim myData(99)" for 100 sessions. It is because
the VB array starts from 0, and ends at the declared index value, so "ReDim
myData(100)" will actually declare an array with 101 elements. If only 100 elements are
used, the last element is not used, and VB will treat it as 0 in numeric context. In this
way, there will be an extra unexpected zero point in the data.

Hope this can help.

Regards
Peter Kwan

  Re: Using Scatter Layer with Finance Chart
Posted by John Best on Feb-11-2016 12:07
Dear Peter,


Thanks a lot... :)


Regards
John