1

I am creating plugin to display some counts with pie chart using this http://www.jpowered.com/

Now everything is fine but I want to connect it with database, where count will be pulled from db. They system is using three different files.

  1. HTML to render output
  2. data.txt to get value
  3. config.txt this is a configuration file for look, size etc for pie chart

HTML code is as below

<img src="../../graph/pie-chart.php?
data=../demo/piechart/data4.txt&
config=../demo/piechart/config4.txt"
width=700
height=400 />

Now I want to convert both txt files into php so I can connect with the database.

data.txt to data.php to pull all data from database config.txt to allow some customization from plugin setting panel

For better understanding I am placing both text file some code.

data.txt

data1series1:   150
data2series1:   27
data3series1:   80


data1series2:   21000
data2series2:   30000
data3series2:   17000

config.txt

   <!-- Chart Characteristics -->
    width:              700
    height:             400
    ndecplaces:         0
    pecentndecplaces:   0
    depth3d:            20
    3dangle:            40

    backgroundcolor:    #ffffff

    <!-- Chart Switches -->
    3d:                 false
    displayPercentages: true
    labellines:         true
    quality:            very high

    <!-- Popup segment Value Pre & Post Symbols -->
    valuepresym: $

    <!-- thousand seperater -->
    thousandseparator: ,

    <!-- Segment Labels -->
    segmentlabels:            true
    segmentlabelfont:         Arial
    segmentlabelfontsize:     8
    segmentlabelfontbold:     false
    segmentlabelfontitalic:   false
    segmentlabelcolor:        #666666
... ----->continue to more config settings

Finally: I want to convert these two files data.txt and config.txt to php where I can connect to the database. I have tried to convert both and data.txt I found working but config.txt doesn't taking affect inline php code and ignoring entire property assigned through php.

Any solution for this? I am okay with any other way or other plugin which can solve my issue by allowing php to connect the database and config setup with variables.

I hope this information would be enough but if you need any more info please let me know. Thanks!

Code Lover
  • 8,099
  • 20
  • 84
  • 154

1 Answers1

0

Using "../../graph/pie-chart.php?data=../demo/piechart/data4.txt&config=../demo/piechart/config4.txt" as your src will only send the value of data and config (../demo/piechart/data4.txt and ../demo/piechart/config4.txt, respectively) to the pie-chart.php file. You could simply pass the number of the config and data files (in this case "4") to the php file and have it parse the necessary txt files accordingly.

chaoskreator
  • 889
  • 1
  • 17
  • 39
  • Try Debug with this parameter and post the results here. `` Also you can check http://www.jpowered.com/php-scripts/adv-graph-chart/documentation/troubleShooting.htm – Nilam Doctor Nov 29 '12 at 07:19
  • Actually I have tried by using php in `data=` and `config=` where data is seems working but not config. see this code `` – Code Lover Nov 29 '12 at 07:32