|
hello! ^^ i hv wondering something. would you guys help me~~? |
Posted by overflow on Dec-11-2012 09:26 |
|
hello.
i have two question about chart director.
first of all.
How does one draw a two point trendline?(sample file1)
myChart.addLine(point1X, point1Y, point2X, point2Y, &H000000)
is it correct???
second of all
how does scroll chart left or right.? (sample file2)
coz sometimes i wanna check past chart .. past data of chart
so can i make scroll in chart director?
if there isnt scroll function in chart director , then just check past data of chart ... its
ok. enough.
what am i supposed to do?? ^^:
thx for read my question.
have a good day!~
|
Re: hello! ^^ i hv wondering something. would you guys help me~~? |
Posted by Peter Kwan on Dec-12-2012 00:34 |
|
Hi overflow,
You can use myChart.addLine to draw a line, but this method uses pixel coordinates (not data coordinates). Also, this method will draw a line from (point1X, point1Y) to (point2X, point2Y), but will not extend the line to the border of the plot area. For your case, it is better to draw the line using myChart.addTrendLayer.
Note that if your are drawing a FinanceChart, you need to apply the addTrendLayer method to the chart that you want to trend line to appear. (In a FinanceChart, there is usually a main price chart, and may be some indicator charts.) So the myChart should be the XYChart object you want the line to appear, and not the entire FinanceChart object.
Finally, in the FinanceChart, all data series should be synchronzied. The number of points in the timeStamps, highData, lowData, openData, closeData, volData should be the same. The number of points in your trend line should also be the same as that in the timeStamps array. Since you only have two actual points in the trend line, you should fill the other points with Chart.NoValue.
For scrolling, there is already some scrolling examples in ChartDirector (see the "Zoomable and Scrollable Charts" section of the ChartDirector documentation). You may modify those examples to apply them to the FinanceChart.
I have included an example for the scrollable finance chart with a trend line for your reference.
Hope this can help.
Regards
Peter Kwan
|
Re: thx for ur kind reply |
Posted by overflow on Dec-14-2012 09:44 |
|
hello Peter Kwan .
thx for ur kind reply. ^^
its really helped. 감사합니다
hv another question.
would you help me again peter? XD
m programming finance chart n trendline use chart director as you know
so is there any example code, or sample code about finance chart n trendline??
i mean chart n trendline in 1 sample.....
thx for reading ^^ have a nice day! bro
Regards
overflow |
Re: thx for ur kind reply |
Posted by Peter Kwan on Dec-15-2012 03:07 |
|
Hi overflow,
The example in my last message "frmfinancescroll.zip" already has a trend line (the blue line). Have you seen it?
Regards
Peter Kwan |
|