[linux-programlama] PHP GD GRAFIK CIZDIRME PROBLEMI

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: serkan eminoglu (seminoglu@meteor.gov.tr)
Date: Tue 10 Aug 2004 - 14:10:12 EEST


Arkadaslar herkese iyi calismalar
Benim php ile grafık cizdırme ilgili bir sorum olacak.

Gd ornek kodlarından biri uzerinde problemi gostereyim. Asagidaki gibi bir kod var elimde bu kodda yaptıgım degisiklikler bir turlu gerceklesmiyor.

Ornegin $graph->title->Set("Background image"); satırını $graph->title->Set("DENEME"); degistirdigimde eskiden kalma biseyler yaziyor. Bunu yapabilmek icin php de ekstra ayar yapmam mı gerekiyor.

Eger bu problemi cozebilirsek turkiyenin tum meteorolojik bilgilerini web arayuzlu olarak gosterebilecegiz.

 

Ortam:

 

easyphp 1.7 : apache 1.3.27 - php 4.3.3 - mysql 4.0.15 - phpmyadmin 2.5.3

 

 

<?php

include ("../jpgraph.php");

include ("../jpgraph_line.php");

 

// Some data

$datay = array(28,19,18,23,12,11);

$data2y = array(14,18,33,29,39,55);

 

// A nice graph with anti-aliasing

$graph = new Graph(400,200,"auto");

$graph->img->SetMargin(40,180,40,40);

$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLPLOT);

 

// Adjust brightness and contrast for background image

// must be between -1 <= x <= 1, (0,0)=original image

$graph->AdjBackgroundImage(0,0);

 

$graph->img->SetAntiAliasing("white");

$graph->SetScale("textlin");

$graph->SetShadow();

$graph->title->Set("DENEME");

 

// Use built in font

$graph->title->SetFont(FF_FONT1,FS_BOLD);

 

// Slightly adjust the legend from it's default position in the

// top right corner.

$graph->legend->Pos(0.05,0.5,"right","center");

 

// Create the first line

$p1 = new LinePlot($datay);

$p1->mark->SetType(MARK_FILLEDCIRCLE);

$p1->mark->SetFillColor("red");

$p1->mark->SetWidth(4);

$p1->SetColor("blue");

$p1->SetCenter();

$p1->SetLegend("Triumph Tiger -98");

$graph->Add($p1);

 

// ... and the second

$p2 = new LinePlot($data2y);

$p2->mark->SetType(MARK_STAR);

$p2->mark->SetFillColor("red");

$p2->mark->SetWidth(4);

$p2->SetColor("red");

$p2->SetCenter();

$p2->SetLegend("New tiger -99");

$graph->Add($p2);

 

// Output line

$graph->Stroke();

 

?>

 

 

Serkan EMİNOĞLU
*********************************************************************
Department of Weather Forecasting Hava Tahminleri Da. Bşk.lığı
Remote Sensing Division Uzaktan Algılama Şube Müd.lüğü
Turkish State Meteorological Service Devlet Met. İşleri Genel Müd.lüğü
*********************************************************************
CC 401 06120 Ankara / TURKEY
Phone : + 90 312 302 26 20
Fax : + 90 312 359 34 30
web : www.uzaktanalgilama.sayfasi.com
e-mail : seminoglu@meteor.gov.tr

 


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.