Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8541711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:53:34+00:00 2026-06-11T11:53:34+00:00

i have echoed the data from database in another file.. now i am fetching

  • 0

i have echoed the data from database in another file.. now i am fetching data . I am new to jquery and highchart.. plz help
my data format passed is :

[
{"name":"a","data":0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]},
{"name":"b","data":[34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]}
]

my code for highchart is :

var chartOptions = {
    chart: {
        renderTo: 'container',
        zoomType: 'x',
        defaultSeriesType: 'line',        
        backgroundColor: null,
        plotBackgroundColor: null,
        borderRadius:20,
        plotShadow: false,
        events: {
            load: function() {
                //    event.exporting.buttons.infoButton.symbolX=5;
                //    event.exporting.buttons.infoButton.symbolY=2;
                //    info_img=0;
                   // this.renderer.rect(5, 5, 60, 25, 15).attr({    fill: issue_col[1],    zIndex: 0 }).add();
                    }
        },
        style: {
            zIndex: 1
                },
        marginRight:30

    },
    title: {
        text: 'hello',
         style: { 
            fontFamily: 'Arial',
             fontWeight: 'bold',
             fontSize: '12px',
             textShadow: 'none'
                }
    },
    xAxis: {
        type:'datetime',
        title: {
        text: null
                }
    },
    yAxis: {
       title: {
       text: 'nothing is coming',
            style: { 
            fontFamily: 'Arial',
             fontWeight: 'bold',
             fontSize: '12px',
             textShadow: 'none'
                }
             },
       min: 0.0,



    },
    credits: {
        enabled: true,
        position: {
            align: 'center',
            x: 10,
            verticalAlign: 'bottom',
            y: -3
        },
        href: "http://www.interscapetech.com",
        style: {
            cursor: 'pointer',
            color: '#909090',
            fontSize: '9px'
        },
        text: "(c)1997- Interscape Technologies Inc. All rights reserved."
    },
    /*labels:{
        items: [{
            html: "TM",
            style: {
                fontSize:'8px',
                left: '330px',
                top: '140px'
            }
        }],
        style: {
            color: 'grey'
            }
    },*/
    lang:{
          downloadButtonTitle:'Download Chart',
          printButtonTitle :'Print Chart',
          infoButtonTitle:'Chart Information',
           switchButtonTitle:'Click to Enlarge'        
     //      switchButtonTitle:'Switch to Bar Chart'
      },

    navigation:{
        buttonOptions:{
            align:'right',
            verticalAlign:'middle',
            height:15,
            symbolFill: '#4572A7',
            hoverSymbolFill: '#768F3E',
            hoverBorderColor:'#92A8CD',
            borderColor:'#3D96AE',
            backgroundColor:'white',
            borderRadius:5,
            borderWidth:2,
            width:20,
            symbolX:10,
            symbolY:8,
            symbolSize:10
        }
    },
    subtitle: {
        text: '',
        align:'left',
        style: {
            fontFamily: 'Arial',
             fontWeight: 'bold',
             fontSize: '12px',
             textShadow: 'none',
             color: 'white'
                },
        x:3,    //-165 if center
        y:12
    },
    plotOptions: {
        line: {
            lineWidth: 1,
            marker: {
               enabled: false,
               states: {
                  hover: {
                     enabled: true,
                     radius: 5
                         }
                       }

                    },
            shadow: false,
            states: {
               hover: {
                  lineWidth: 1                  
                      }
                    },
            zindex:1
            },
        series:[{
                zindex:1
            }]
    }
    ,
    tooltip: {
        formatter: function() {
            var ctime= Highcharts.dateFormat('%m/%d/%Y %H:%M:%S',this.x);
            var s = '<b>'+ ctime +'</b>';
            $.each(this.points, function(i, point) {
                var result=Math.round(point.y*10)/10;
                s += '<br/>'+ point.series.name +': '+result;
            });
            return s;
        },
        shared: true,
        backgroundColor: '#FCFFC5'
    },
    legend: {
        itemStyle: { 
            fontFamily: 'Arial',
             fontSize: '12px',
             textShadow: 'none'
                },
         enabled: true
//        symbolPadding: 10
    },
    series: []
   };

$(document).ready(function()
    {

      var url='highchars_test2.php';
alert('helo');

   $.getJSON(url, function(seriesData){

    $(seriesData).each(function(i, pdata){
    console.log();
                if(i==(seriesData.length-1) || i==(seriesData.length-2))
                {}
                else
                {
                    alert(pdata['data']);
                    chartOptions.series.push(pdata);
                }
            });
               chart = new Highcharts.Chart(chartOptions);
   });
   });

cannot create the chart.. plz help..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:53:35+00:00Added an answer on June 11, 2026 at 11:53 am

    in series a data is not formatted properly ( opening bracket missing)
    I added that and its working
    check this out http://jsfiddle.net/q6LVV/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on transferring data from one database to another. For this I have
I have a function that retrieves some data from the database, formats it as
So I have this function that gets data from database and echoes it. The
I have some data from database coming out in a loop. Each of these
Basically, I have populated a dropdown list using php from a database on a
I have a textbox which i echo data from mysql. However if there is
I've recently written a custom API for inserting data into my database from multiple
I have a function loadContent() that when called, queries a database, formats the data
i retrieve data from upc database and then want to insert the data into
I'm having issues with getting data from an AJAX file, I am trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.