Json

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sindhuisd
    New Member
    • Dec 2015
    • 5

    Json

    Hi,

    we are trying to built a treemap highcharts with dynamic data,my json data looks as

    [{"name":"PUNE", "id":"0","color ":"#50B432"},{" name":"Helical" ,"id":"0_1","pa rent":"0"},{"na me":"ADVANCE TEK ENGINEERS","id" :"0_1_1","paren t":"0_1"},{"nam e":"EPM-201500003470"," value":2.1,"id" :"0_1_1_1","par ent":"0_1_1","d rilldown":"2015 00003470","even ts":"{click: function () {EnquiryList (201500003470)} }"},{"name":"Th yssenKrupp Industries India Pvt Ltd-10925","id":"0_ 1_2","parent":" 0_1"},{"name":" EPM-201500003600"," value":13.16,"i d":"0_1_2_1","p arent":"0_1_2", "drilldown":"20 1500003600","ev ents":"{click: function () {EnquiryList (201500003600)} }"},{"name":"WM I Konecranes India Limited","id":" 0_1_3","parent" :"0_1"},{"name" :"EPM-201500003411"," value":0.85,"id ":"0_1_3_1","pa rent":"0_1_3"," drilldown":"201 500003411","eve nts":"{click: function () {EnquiryList (201500003411)} }"},{"name":"Pl anetary","id":" 0_2","parent":" 0"},{"name":"WM I Konecranes India Limited","id":" 0_2_1","parent" :"0_2"},{"name" :"EPM-201500003430"," value":102.52," id":"0_2_1_1"," parent":"0_2_1" ,"drilldown":"2 01500003430","e vents":"{click: function () {EnquiryList (201500003430)} }"},{"name":"Sp ecial","id":"0_ 3","parent":"0" },{"name":"Thys senKrupp Industries India Pvt Ltd-10925","id":"0_ 3_1","parent":" 0_3"},{"name":" EPM-201500003600"," value":8.63,"id ":"0_3_1_1","pa rent":"0_3_1"," drilldown":"201 500003600","eve nts":"{click: function () {EnquiryList (201500003600)} }"}]

    Without event i am able to display the treemap charts with nodes.I tried to pop up ajax form in the last child node click event.But click event not working ,becuase the event also i concatenated in the array.So it forms with " double quotes.I remove the double quotes in the front of click and the end i able to load the ajax form successfully.Bu t i dont know how to remove the double quotes in the json data.Help me

    Regards,
    Sindhu.P
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    But i dont know how to remove the double quotes in the json data
    you can’t. JSON only submits primitive data (strings, numbers, booleans) not functions. therefore removing the quotes would invalidate the JSON. as it is written there you would have to eval() that expression.

    Comment

    • sindhuisd
      New Member
      • Dec 2015
      • 5

      #3
      Hi Dormilich ,

      Thanks for your reply.eval() is not working for me because i have to concatenate the string in the array.

      I want to call the click event in treemap for the end child node.Help me to complete this.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        every time you have a "drilldown" property, you also have a click even with that same value. so I see two principal ways to do it. either update the setup code such that it adds the click event whenever there is a drilldown property, or go through that array (after you parsed the JSON) and add the event property as desired.

        Comment

        • sindhuisd
          New Member
          • Dec 2015
          • 5

          #5
          Thanks for your reply.I completed the task.Instead of using hte event in the array i declared it unser charts .

          Now i m able to load ajax .

          Comment

          Working...