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

Message ListMessage List     Post MessagePost Message

  help with DB and the chart
Posted by carlos villanueva on May-19-2011 22:14
Attachments:
I am doing a test of speed.
Everything is fine, but I don?t know how to adapt the pchart with DB. This is what I have done, but it does?t load the results.
I put a sql, the programs and a PDF (graphic) of what I get.
Thanks for you help
chart_help.rar
chart_help.rar

2.24 Kb
CD.pdf
CD.pdf

169.69 Kb

  Re: help with DB and the chart
Posted by Peter Kwan on May-20-2011 01:23
Hi carlos,

I think your chart accurately reflects your data.

The two issues I found in your chart is:

(a) There is not enough space on the left side for the y-axis labels.

(b) The x-axis labels overlap, because they are too long.

It seems your x-axis labels can be very long, so you need to reserve a lot of space on the x-axis for the labels. I suggest you to configure the x-axis labels to run vertically.

May be you can try the following code. I have made the left side wider at 100 pixels for the y-axis labels, and have reserve a lot of space at the bottom for the x-axis labels. Also, I have rotated the x-axis labels by 90 degrees, so it runs vertically.


# Create a XYChart object of size 640 x 600 pixels
$c = new XYChart(640, 600);

# Add a title to the chart using 18pts Times Bold Italic font
$c->addTitle("VELOCIDAD", "timesbi.ttf", 18);

# Set the plotarea at (100, 40) and of size 500 x 280 pixels. Use a vertical gradient
# color from light blue (eeeeff) to deep blue (0000cc) as background. Set border and
# grid lines to white (ffffff).
$c->setPlotArea(100, 40, 500, 280, $c->linearGradientColor(60, 40, 60, 280, 0xeeeeff,
    0x0000cc), -1, 0xffffff, 0xffffff);

# Add a multi-color bar chart layer using the supplied data. Use soft lighting effect
# with light direction from left.
$barLayerObj = $c->addBarLayer3($data);
$barLayerObj->setBorderColor(Transparent, softLighting(Left));

# Set x axis labels using the given labels
$c->xAxis->setLabels($labels);

# Draw the ticks between label positions (instead of at label positions)
$c->xAxis->setTickOffset(0.5);

# Add a title to the y axis with 10pts Arial Bold font
$c->yAxis->setTitle("Euros", "arialbd.ttf", 10);

# Set axis label style to 8pts Arial Bold
$c->xAxis->setLabelStyle("arialbd.ttf", 8, 0x000000, 90);
$c->yAxis->setLabelStyle("arialbd.ttf", 8);

# Set axis line width to 2 pixels
$c->xAxis->setWidth(2);
$c->yAxis->setWidth(2);

# Output the chart
header("Content-type: image/png");
print($c->makeChart2(PNG));


Hope this can help.

Regards
Peter Kwan

  Re: help with DB and the chart
Posted by carlos villanueva on May-20-2011 03:53
Attachments:
Ok.
I have the names, and I see them.
The problem is with the other side of the chart that doesn?t charge the data.
It gave the same to all, and it must be a different.






time                               name

1305564682.650               http://www.GOOGLE.com
-1305564777.780             http://www.GOOGLE.com
-1305564817.280             http://www.iesmajadamarcial.com
-1305564830.320             http://www.bluekoli.fi
-1305564843.510             http://www.terra.com
-1305564942.830             http://www.chartdirector.com
-1305566601.580             http://www.chartdirector.com
-1305566716.250             http://www.componentsource.com
-1305643924.750              http://www.iesmajadamarcial.com
spped1.pdf
spped1.pdf

152.97 Kb

  Re: help with DB and the chart
Posted by carlosv56 on May-20-2011 15:07
I tried again. And it works
Thanks

  Re: help with DB and the chart
Posted by carlos villanueva on May-21-2011 00:27
Attachments:
In my work it goes
But at home don?t. Please see the attachment.
Something I don?t understand.
Could you help me
Thanks
IMG1.pdf
IMG1.pdf

201.01 Kb
house.pdf
house.pdf

200.92 Kb

  Re: help with DB and the chart
Posted by Peter Kwan on May-21-2011 03:15
Hi Carlos,

I am not sure which part is incorrect in your chart. Both of your charts look normal.

In your "house.pdf", the first 2 bars are zero, and all the other bars are close to -0.000013. Does this reflect your real data? If this reflects your real data, then the chart is normal.

In your "img1.pdf", there are 5 bars, all close to -0.000013. The five bars look different in length, because your y-axis are from -0.0000130587315 to -0.0000130587365. On your "house.pdf", the y-axis starts from 0 to -0.000016, so all the bars that are close to -0.000013 appears the same length. The "house.pdf" must start the y-axis at 0, because you have two bars that are 0 (the first two bars). If you do not want the first two bars, please remove them before passing the data to ChartDirector.

Hope this can help.

Regards
Peter Kwan

  Re: help with DB and the chart
Posted by carlos villanueva on May-21-2011 14:19
yes. Is so little the difference that is difficult to see.
Thanks for your help. Blessings