Saturday, May 23, 2015

Adding #Charts to a website using javascrip with DataBase connection

You have some data in your DataBase that you would like to explode with Charts to offer Analytics solution to your visitors.

One simple way is to use highcharts, a company that has a collection of utilities to paint Charts using a simple script and of course with data base connecction and much more.

$dbcon = mysql_connect("localhost", "bartolo", "******");
mysql_select_db("DATABASE", $dbcon);
$result = mysql_query("SELECT * FROM table");
while ($row = mysql_fetch_array($result)) {
   $data[] = "['".$row['name']."',".$row['tot']."]";

$(function () {
        chart: {
            type: 'pie',
            options3d: { enabled: true, alpha: 45, beta: 0 }
        title: { text: 'Chosse the best Broker' },
        tooltip: {
            pointFormat: '{}: <b>{point.percentage:.1f}%</b>'
        plotOptions: {
            pie: {  allowPointSelect: true, cursor: 'pointer', depth: 35,
                dataLabels: { enabled: true, format: '{}' }}
        series: [{
            type: 'pie',             name: 'Browser share',
            data: [  <?php echo join($data, ','); ?> ]




  1. Great post!! This can be one particular of the most useful blogs We’ve ever arrive across on this subject. Basically Wonderful. I am also a specialist in this topic so I can understand your hard work.

    Digital marketing company in Chennai

  2. Somebody necessarily help to make severely posts I might state. This is the first time I frequented your website page and to this point? I surprised with the research you made to create this particular post extraordinary. Well done admin..

    Digital marketing company in Chennai

  3. Awesome article. It is so detailed and well formatted that i enjoyed reading it as well as get some new information too.

    SAP HR Training in Chennai

  4. I am very happy when read this blog post because blog post written in good manner and write on good topic. Thanks for sharing valuable information.
    Bangalore Web Designing Company, UI Designing Company Bangalore

  5. I am always searching online for articles that can help me to improve my knowledge. There is clearly a lot to know about this. I think you made some good points in Features also. I don't have words to describe this blog. By the way you are running a great blog. So, please keep on update like this post.
    Engineering Colleges in Chennai, Mechanical Engineering Colleges in Chennai

  6. I absolutely admired every bit of it and i additionally accept you book apparent to analysis out fresh things in your site.
    UI Designing Companies, Web Application Development in Bangalore


  7. Its a wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way.Thank you so much

    Personal Installment Loans
    Title Car loan
    Cash Advance Loan

  8. I think like I get a clear cut understanding while reading the content than anywhere else. Keep continuing this journey...!

    Pawn Shops in Montgomery

    Pawn Shops in Birmingham

    Pawn Shops in Mobile

  9. Good work…unique site and interesting too… keep it up…looking forward for more updates.Good luck to all of you and thanks so much for your hard-work.
    Language Interpretation Services, Voice Over Services India

  10. This is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
    Language Translation Services ,
    Subtitling Companies in Bangalore

  11. I am very happy when read this blog post because blog post written in good manner and write on
    good topic. Thanks for sharing valuable information.

    School Information Management System,
    Online Fee Payment Integration
    College Management System