Jump to content
  • Revista PROGRAMAR: Já está disponível a edição #60 da revista programar. Faz já o download aqui!

Sign in to follow this  
diogopuskas

Kohana, ajuda

Recommended Posts

diogopuskas

<?php

class Welcome_Controller extends Controller {

public function __construct()
{
    parent::__construct();
    require Kohana::find_file('libraries', 'pchart/pChart/pData', $required = TRUE, $ext = 'class');
    require Kohana::find_file('libraries', 'pchart/pChart/pChart', $required = TRUE, $ext = 'class');
}

public function test6()
{
    // Dataset definition
    $DataSet = new pData;
    $DataSet->ImportFromCSV('./system/libraries/pchart/Sample/datawithtitle.csv',",",array(1,2,3),TRUE,0);
    $DataSet->AddAllSeries();
    $DataSet->SetAbsciseLabelSerie();

    // Initialise the graph
    $Test = new pChart(700,230);
    $Test->setFontProperties(SYSPATH.'/fonts/tahoma.ttf',8);
    $Test->setGraphArea(60,30,680,200);
    $Test->drawFilledRoundedRectangle(7,7,693,223,5,240,240,240);
    $Test->drawRoundedRectangle(5,5,695,225,5,230,230,230);
    $Test->drawGraphArea(255,255,255);
    $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),5,150,150,150,TRUE,0,2);
    $Test->drawGrid(4,220,220,220);

    // Draw the 0 line
    $Test->setFontProperties(SYSPATH.'/fonts/tahoma.ttf',6);
    $Test->drawTreshold(0,143,55,72,TRUE,TRUE);

    // Draw the filled line graph
    $Test->drawFilledLineGraph($DataSet->GetData(),$DataSet->GetDataDescription(),50);

    // Finish the graph
    $Test->setFontProperties(SYSPATH.'/fonts/tahoma.ttf',8);
    $Test->drawLegend(65,35,$DataSet->GetDataDescription(),255,255,255);
    $Test->setFontProperties(SYSPATH.'/fonts/tahoma.ttf',10);
    $Test->drawTitle(60,22,"Example 6",50,50,50,585);
    $Test->Stroke("example6.png");
}

}

?>

o nome do ficheiro é report.php e esta na pasta dos controllers.

alguma sugestão é bem vinda

Share this post


Link to post
Share on other sites
diogopuskas

encontrei umas coisas relativamente a isto, vou ver se consigo resolver e ja posto aqui alguma coisa :thumbsup:

Share this post


Link to post
Share on other sites
diogopuskas

Bem, ja descobri que basicamente é para meter a pasta pchart para o system/libraries

mas agora esta me a dar uns erros jeitosos.. 

Function split() esta deprecated .. e basicamente esta na funcao da class do pchart .. alguma ideia ?

Bem, já alterei essa ..

agora falta me outras tantas :|

Kohana_404_Exception

core.error_file_line

core.page_not_found

core.stack_trace

    *

      Kohana::show_404(  )

    * core.error_file_line

      call_user_func( Array

      (

          [0] => Kohana

          [1] => show_404

      )

      )

    * core.error_file_line

      Event::run( system.404 )

    *

      Controller_Core->__call( index )

    * core.error_file_line

      ReflectionMethod->invokeArgs( Welcome_Controller Object

      (

          [uri] => URI Object

              (

              )

          [input] => Input Object

              (

                  [use_xss_clean:protected] => 1

                  [magic_quotes_gpc:protected] =>

                  [ip_address] =>

              )

      )

      , Array

      (

          [0] => index

          [1] => Array

              (

              )

      )

      )

    *

      Kohana::instance(  )

    * core.error_file_line

      call_user_func( Array

      (

          [0] => Kohana

          [1] => instance

      )

      )

    * core.error_file_line

      Event::run( system.execute )

    * core.error_file_line

      require( system\core\Bootstrap.php )

Se alguém tiver alguma resolução de algum bug que me diga sff (:

ps:actualizei o código que tinha na primeira pagina.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.