Welcome Guest, Not a member yet? Register   Sign In
codeigniter pchart integration
#1

[eluser]xorman[/eluser]
hello all,

i need some help in setting up pchart with codeigniter. I'm using codeigniter 1.7.2 and pchart 2.1.1.

would appreciate some help and sample code to get a few graphs working.

thanks
#2

[eluser]lemathieu[/eluser]
Xorman,

You can put the whole pchart content in the third_party/chart/ directory of your codeigniter application. Then you have to make an library with functions that can generate the charts. I've made a sample for you. Simply put all files in the correct codeigniter application folders as i've done in the zip file.

lemathieu.
#3

[eluser]xorman[/eluser]
lemathieu

appreciate you taking the time out to reply to my post. First i dont know who to view the zip file you sent.

i already tried putting the whol pchart into the applications folder.
I created a controller called chart and in it I referenced using the inlclude function whole path to the pchart classes.

In the end I ended up getting a lot of errors aparently to do with fonts. I gave up on the whole thing hoping someone like yourself will come forward with help.

If i put the pchart in the applications direct, i want some guidance what my controller and functions would look like when it calls the chart.

appreciate your help.
xorman
#4

[eluser]lemathieu[/eluser]
Hi Xorman,

When you send me your emailadres in a PM, then i'll be able to send the zip file. I've tried to attach it to my reply to you but there was an error with uploading.

The problem with te fonts is probably due to the fact that you've tried to add a path in the pchart.class to the fontname. You only have to add the right path to the code that generate the chart.

In my example code i added this to my used tahoma font:

Code:
$pchart_basepath = "application/third_party/pchart/";
$Test->setFontProperties($pchart_basepath."Fonts/tahoma.ttf",8);

lemathieu.
#5

[eluser]lemathieu[/eluser]
http://inetplaza.nl/pchart/
#6

[eluser]xorman[/eluser]
lemathieu,

Sorry for my late reply. I tried using it but got an error. I noticed that your system and application directories are on the same level. I am using codeigniter 1.7.2 so my application directory is inside my system directory system->application.

not sure if that was causing the issue. will try again tomorrow and let you know.

appreciate your help.
thanks
#7

[eluser]xorman[/eluser]
i added the system directory path in chart.php file and now chart is displaying.
now i get new error

A PHP Error was encountered

Severity: Notice

Message: Uninitialized string offset: 1

Filename: pChart/pData.class

Line Number: 127


thanks
#8

[eluser]xorman[/eluser]
lemathieu

i have the answer from post http://ellislab.com/forums/viewthread/102909/P20/

thanks for your help.

xorman
#9

[eluser]lemathieu[/eluser]
Hi Xorman!

Ok, fine! I've just made an example for codeigniter 1.7.2. If you like, it is attached to this reply.

Lemathieu
#10

[eluser]xorman[/eluser]
Hello lemathieu,

I managed to fix my issue and have it all working fine. Thanks for your help.
I could not have done it with you.

thanks.




Theme © iAndrew 2016 - Forum software by © MyBB