|
Graph not showing correctly |
Posted by oplaza on Jun-17-2011 22:18 |
|
Hi Peter,
I have an strange behavior on the Finance Graph,
is working perfect almost all time, but when I try to graph this data it only shows a dot :
(
and I dont know why is it doing this because it works perfect for all the rest...
I have this:
array (labels)
0 => string '18/05/2011' (length=10)
1 => string '19/05/2011' (length=10)
2 => string '20/05/2011' (length=10)
3 => string '23/05/2011' (length=10)
4 => string '24/05/2011' (length=10)
5 => string '25/05/2011' (length=10)
6 => string '26/05/2011' (length=10)
7 => string '27/05/2011' (length=10)
8 => string '31/05/2011' (length=10)
9 => string '01/06/2011' (length=10)
10 => string '02/06/2011' (length=10)
11 => string '03/06/2011' (length=10)
12 => string '06/06/2011' (length=10)
13 => string '07/06/2011' (length=10)
14 => string '08/06/2011' (length=10)
15 => string '09/06/2011' (length=10)
16 => string '10/06/2011' (length=10)
17 => string '13/06/2011' (length=10)
18 => string '14/06/2011' (length=10)
19 => string '15/06/2011' (length=10)
20 => string '16/06/2011' (length=10)
array(timestamps)
0 => float 63441273600
1 => float 63441360000
2 => float 63441446400
3 => float 63441705600
4 => float 63441792000
5 => float 63441878400
6 => float 63441964800
7 => float 63442051200
8 => float 63442396800
9 => float 63442483200
10 => float 63442569600
11 => float 63442656000
12 => float 63442915200
13 => float 63443001600
14 => float 63443088000
15 => float 63443174400
16 => float 63443260800
17 => float 63443520000
18 => float 63443606400
19 => float 63443692800
20 => float 63443779200
array(closeData)
0 => float 16.69
1 => float 16.67
2 => float 16.26
3 => float 15.98
4 => float 16.11
5 => float 16.33
6 => float 16.37
7 => float 16.48
8 => float 16.81
9 => float 16.09
10 => float 16.2
11 => float 15.92
12 => float 15.61
13 => float 15.69
14 => float 15.41
15 => float 15.5
16 => float 15.28
17 => float 15.1
18 => float 15.41
19 => float 14.96
20 => float 14.79
The Code:
# Create the chart object using the selected size
$m = new FinanceChart($width);
$m->setMargins(55, 30, 10, 55);
$m->setPlotAreaStyle(0xFFFFFF, 0xdddddd, 0xCCCCCC, 0xCCCCCC, 0xCCCCCC);
$m->setPlotAreaBorder(0x888888, $indicatorsMarginSeparator);
# Set the data into the chart object
$m->setData($timeStamps, $highData, $lowData, $openData, $closeData, $volData,
$extraPoints);
$m->setAxisOnRight(false);
$myMainChart = $m->addMainChart($mainHeight);
$myMainChart->yAxis()->setTitle("Price (p)");
$myMainChart->xAxis->setLabels($labels);
$myMainChart->xAxis()->setLabelStyle("Arial", "8", "&H000000", 45);
$myMainChart->addExtraField($timeStamps);
P.D. I have read somewhere, that there is a special forum or something for thos who
have bought the license, we bought it last week, is that true? or just rumours?
thanks for all
|
Re: Graph not showing correctly |
Posted by oplaza on Jun-17-2011 22:21 |
|
It is strange, because as you can see, the high and low data are taking correct data, once
from june and other from may.
So i dont understand why it is not showing all the points |
Re: Graph not showing correctly |
Posted by Peter Kwan on Jun-18-2011 00:45 |
|
Hi oplaza,
Is it possible there is really no visible data in the chart, or your code have not plotted anything on the chart?
From your message, it is not clear what is $highData, $lowData, $openData and $extraPoints, or what you are plotting.
Note that the purpose of the $extraPoints is to skip some leading data, so that they will not be visible on the chart. In your case, you have 21 data points. Suppose your $extraPoints is set to 20, then only 1 point will remain visible. That explain why there is one label on the x-axis. If you are plotting a line chart, nothing can be plotted (you need at least 2 points to create a line). If you are plotting a 25 days moving average, again nothing can be plotted as there is insufficient data.
For the "high and low data label" on the chart, ChartDirector does not have an API to show these labels. So I think these labels are added by your own code, which is not included in your earlier message. You would need to examine your own code to see why they are there (eg. do the code respect the $extraPoints settings or ignores it?).
If you need further help, would you mind to provide more complete charting code to help me understand what the code is trying to plot? Also, please kindly include the values of other variables in your code, in particular $highData, $lowData, $openData and $extraPoints.
Hope this can help.
Regards
Peter Kwan |
Re: Graph not showing correctly |
Posted by oplaza on Jun-20-2011 16:26 |
|
Fixed, it was as you said the extrapoint stuff, I did not understand what are those points
for.
thanks! |
|