<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Bar graph in pop Up and Graphic layer in Layers List - WebApp Builder in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bar-graph-in-pop-up-and-graphic-layer-in-layers/m-p/1215999#M78820</link>
    <description>&lt;P&gt;Hi, I would like to understand why my popup does not show the graph, also I would like to understand why the graphicLayer is not visible in the Layer list. I enclose the code. Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;esempio: function (evt) {
       
        
        let that = this;
        let point = [];
        var json;

        var graphiclayer = new GraphicsLayer();

        function creatable(campo){



          var tab = "&amp;lt;table&amp;gt;&amp;lt;tbody&amp;gt;";
          for(var j = 0; j &amp;lt; campo.length; j++){
             tab = tab + "&amp;lt;tr&amp;gt;&amp;lt;td style='text-align: left;width: 90%;'&amp;gt;"+ campo[j].values.name +"&amp;lt;/td&amp;gt;&amp;lt;td style='text-align: right;'&amp;gt;"+ campo[j].values.value.toFixed(1) +"%&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;"; 
          }
          tab = tab + "&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;";
  
          return tab;
        }


        $.getJSON("mappa.json", (data) =&amp;gt; {         
        }).success(function(data) {

          json = data;

          
          for (var i = 0; i &amp;lt; json.length; i++) {

            var result = proj4('EPSG:32632', 'EPSG:4326', [json[i].geometry.x,json[i].geometry.y]);
            point[i] = new Point(result[0], result[1]);

            var symbol = new SimpleMarkerSymbol({
              "color": [250,0,250,1],
              "size": 12,
              "angle": -30,
              "xoffset": 0,
              "yoffset": 0,
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "outline": {
                "color": [0,0,0,255],
                "width": 1,
                "type": "esriSLS",
                "style": "esriSLSSolid"
              }
            });
            
            symbol.setColor(Color.fromHex(json[i].attributes.Colore));


            let gra = new Graphic(point[i], symbol);
            gra.setAttributes({
              "Area": json[i].attributes.Area,
              "Categoria":json[i].attributes.Categoria,
              "CodiceIstat":json[i].attributes.CodiceIstat,
              "Combustibile":json[i].attributes.Combustibile,
              "Potenza":json[i].attributes.Potenza,
              "Totale":json[i].attributes.Totale
            })

             

            var template = new PopupTemplate({
              title: json[i].attributes.Area,
              description: "&amp;lt;h2&amp;gt;Categorie: &amp;lt;/h2&amp;gt;" +creatable(json[i].attributes.Categoria) + "&amp;lt;h2&amp;gt;Combustibili: &amp;lt;/h2&amp;gt;"+creatable(json[i].attributes.Combustibile) +"&amp;lt;h2&amp;gt;Potenze: &amp;lt;/h2&amp;gt;"+ creatable(json[i].attributes.Potenza),
              fieldInfos: [{ //define field infos so we can specify an alias
                fieldName: "CodiceIstat",
                label: json[i].attributes.CodiceIstat
              },{
                fieldName: "Combustibile",
                label:"Combustibile"
                //label: json[i].attributes.Combustibile
              },{
                fieldName: "Potenza",
                label: json[i].attributes.Potenza
              },{
                fieldName: "Totale",
                label: json[i].attributes.Totale
              }],
              mediaInfos:[{ //define the bar chart
                caption: "",
                type:"barchart",
                value:{
                  theme: "Dollar",
                  fields:["Combustibile"]
                }
              }]
            });

            

            gra.setInfoTemplate(template);

            graphiclayer.add(gra);


          }          

          that.map.addLayers([graphiclayer]);
          
        });    
      },&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 26 Sep 2022 11:11:24 GMT</pubDate>
    <dc:creator>DavideAristipini</dc:creator>
    <dc:date>2022-09-26T11:11:24Z</dc:date>
    <item>
      <title>Bar graph in pop Up and Graphic layer in Layers List - WebApp Builder</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bar-graph-in-pop-up-and-graphic-layer-in-layers/m-p/1215999#M78820</link>
      <description>&lt;P&gt;Hi, I would like to understand why my popup does not show the graph, also I would like to understand why the graphicLayer is not visible in the Layer list. I enclose the code. Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;esempio: function (evt) {
       
        
        let that = this;
        let point = [];
        var json;

        var graphiclayer = new GraphicsLayer();

        function creatable(campo){



          var tab = "&amp;lt;table&amp;gt;&amp;lt;tbody&amp;gt;";
          for(var j = 0; j &amp;lt; campo.length; j++){
             tab = tab + "&amp;lt;tr&amp;gt;&amp;lt;td style='text-align: left;width: 90%;'&amp;gt;"+ campo[j].values.name +"&amp;lt;/td&amp;gt;&amp;lt;td style='text-align: right;'&amp;gt;"+ campo[j].values.value.toFixed(1) +"%&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;"; 
          }
          tab = tab + "&amp;lt;/tbody&amp;gt;&amp;lt;/table&amp;gt;";
  
          return tab;
        }


        $.getJSON("mappa.json", (data) =&amp;gt; {         
        }).success(function(data) {

          json = data;

          
          for (var i = 0; i &amp;lt; json.length; i++) {

            var result = proj4('EPSG:32632', 'EPSG:4326', [json[i].geometry.x,json[i].geometry.y]);
            point[i] = new Point(result[0], result[1]);

            var symbol = new SimpleMarkerSymbol({
              "color": [250,0,250,1],
              "size": 12,
              "angle": -30,
              "xoffset": 0,
              "yoffset": 0,
              "type": "esriSMS",
              "style": "esriSMSCircle",
              "outline": {
                "color": [0,0,0,255],
                "width": 1,
                "type": "esriSLS",
                "style": "esriSLSSolid"
              }
            });
            
            symbol.setColor(Color.fromHex(json[i].attributes.Colore));


            let gra = new Graphic(point[i], symbol);
            gra.setAttributes({
              "Area": json[i].attributes.Area,
              "Categoria":json[i].attributes.Categoria,
              "CodiceIstat":json[i].attributes.CodiceIstat,
              "Combustibile":json[i].attributes.Combustibile,
              "Potenza":json[i].attributes.Potenza,
              "Totale":json[i].attributes.Totale
            })

             

            var template = new PopupTemplate({
              title: json[i].attributes.Area,
              description: "&amp;lt;h2&amp;gt;Categorie: &amp;lt;/h2&amp;gt;" +creatable(json[i].attributes.Categoria) + "&amp;lt;h2&amp;gt;Combustibili: &amp;lt;/h2&amp;gt;"+creatable(json[i].attributes.Combustibile) +"&amp;lt;h2&amp;gt;Potenze: &amp;lt;/h2&amp;gt;"+ creatable(json[i].attributes.Potenza),
              fieldInfos: [{ //define field infos so we can specify an alias
                fieldName: "CodiceIstat",
                label: json[i].attributes.CodiceIstat
              },{
                fieldName: "Combustibile",
                label:"Combustibile"
                //label: json[i].attributes.Combustibile
              },{
                fieldName: "Potenza",
                label: json[i].attributes.Potenza
              },{
                fieldName: "Totale",
                label: json[i].attributes.Totale
              }],
              mediaInfos:[{ //define the bar chart
                caption: "",
                type:"barchart",
                value:{
                  theme: "Dollar",
                  fields:["Combustibile"]
                }
              }]
            });

            

            gra.setInfoTemplate(template);

            graphiclayer.add(gra);


          }          

          that.map.addLayers([graphiclayer]);
          
        });    
      },&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 26 Sep 2022 11:11:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bar-graph-in-pop-up-and-graphic-layer-in-layers/m-p/1215999#M78820</guid>
      <dc:creator>DavideAristipini</dc:creator>
      <dc:date>2022-09-26T11:11:24Z</dc:date>
    </item>
  </channel>
</rss>

