<?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 Re: MediaContent popup element contains a chart with line's type or column's type or bar 's type and with a series porpertie (ChartMediaInfoValueSerie in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mediacontent-popup-element-contains-a-chart-with/m-p/1200703#M78225</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/400217"&gt;@LaurenBoyd&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;Finally i used chartJS :&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/blaurancin/pen/JjLrKqr" target="_blank" rel="noopener"&gt;https://codepen.io/blaurancin/pen/JjLrKqr&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content" target="_self"&gt;documentation&lt;/A&gt; indicates :&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"&lt;STRONG&gt;function&lt;/STRONG&gt;&amp;nbsp;- Content may be defined with a JavaScript function that returns any of the above-mentioned elements. This is useful when your popup requires additional processing or functionality than what is provided with the four content types listed above.&amp;nbsp;&lt;STRONG&gt;For example, assume that you would like to display charts using third-party JavaScript libraries&lt;/STRONG&gt;&amp;nbsp;or categorize information into separate tabs"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bertrand&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2022 07:43:23 GMT</pubDate>
    <dc:creator>Bertrand_Laurancin</dc:creator>
    <dc:date>2022-08-09T07:43:23Z</dc:date>
    <item>
      <title>MediaContent popup element contains a chart with line's type or column's type or bar 's type and with a series porpertie (ChartMediaInfoValueSeries[])</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mediacontent-popup-element-contains-a-chart-with/m-p/1195221#M78028</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want use a MediaContent popup element contains a chart with line's type or column's type or bar 's type and with a series propertie (ChartMediaInfoValueSeries[]).&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ChartMediaInfoValue.html#series" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ChartMediaInfoValue.html#series&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-BarChartMediaInfo.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-BarChartMediaInfo.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-ColumnChartMediaInfo.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-ColumnChartMediaInfo.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-LineChartMediaInfo.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-LineChartMediaInfo.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I want an array for ChartMediaInfoValueSeries[] with my custom values.&lt;/P&gt;&lt;P&gt;However, I don't understand the help and how it works&amp;nbsp;and there is no sample.&lt;/P&gt;&lt;P&gt;Here it is my sample :&lt;BR /&gt;&lt;A href="https://codepen.io/blaurancin/pen/xxWrQMW?editors=1000" target="_blank" rel="noopener"&gt;https://codepen.io/blaurancin/pen/xxWrQMW?editors=1000&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://codepen.io/blaurancin/live/xxWrQMW" target="_blank" rel="noopener"&gt;https://codepen.io/blaurancin/live/xxWrQMW&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;html dir="ltr"&amp;gt;

&amp;lt;head&amp;gt;
  &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&amp;gt;
  &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" /&amp;gt;
  &amp;lt;title&amp;gt;Line Chart | ArcGIS API for JavaScript 4.24&amp;lt;/title&amp;gt;

  &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.24/esri/themes/light/main.css" /&amp;gt;
  &amp;lt;script src="https://js.arcgis.com/4.24/"&amp;gt;&amp;lt;/script&amp;gt;

  &amp;lt;style&amp;gt;
    html,
    body,
    #mapDiv {
      height: 100%;
      width: 100%;
      margin: 0;
      padding: 0;
    }
  &amp;lt;/style&amp;gt;

  &amp;lt;script&amp;gt;
    require(["esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer", "esri/core/reactiveUtils"],
      (Map, MapView, FeatureLayer, reactiveUtils) =&amp;gt; {
        // setup the map
        const map = new Map({
          basemap: "hybrid"
        });
        const view = new MapView({
          container: "mapDiv",
          map: map,
          center: [-81.31557659295213, 48.12557766494745],
          zoom: 6,          
          popup: {
            dockEnabled: true,
            dockOptions: {
              buttonEnabled: false,
              breakpoint: false
            }
          }
        });
        const featureLayer = new FeatureLayer({
          url: "https://services.arcgis.com/6iGx1Dq91oKtcE7x/ArcGIS/rest/services/Census_Data/FeatureServer/2",
          popupTemplate: {            
            title: "Chart",            
            content: [
              // {
              //   // It is also possible to set the fieldInfos outside of the content
              //   // directly in the popupTemplate. If no fieldInfos is specifically set
              //   // in the content, it defaults to whatever may be set within the popupTemplate.
              //   type: "fields", // FieldsContentElement
              //   fieldInfos: [{
              //       fieldName: "Population ",
              //       visible: false,
              //       label: "Population",
              //       format: {
              //         places: 0,
              //         digitSeparator: true
              //       }
              //     },
              //     {
              //       fieldName: "LaborForce",
              //       visible: false,
              //       label: "LaborForce",
              //       format: {
              //         places: 0,
              //         digitSeparator: true
              //       }
              //     },
              //     {
              //       fieldName: "Household",
              //       visible: false,
              //       label: "Household",
              //       format: {
              //         places: 0,
              //         digitSeparator: true
              //       }
              //     },
              //     {
              //       fieldName: "Job",
              //       visible: false,
              //       label: "Job",
              //       format: {
              //         places: 0,
              //         digitSeparator: true
              //       }
              //     },
              //   ]
              // },
              {
                type: "media",
                mediaInfos: [{
                  title: "&amp;lt;b&amp;gt;Chart&amp;lt;/b&amp;gt;",
                  type: "line-chart",
                  caption: "",
                  value: {
                    // fields: ["Population", "LaborForce", "Household", "Job"],
                    series: [{fieldName: "val1", value: 10}, {fieldName: "val2", value: 50}, {fieldName: "val3", value: 100}, {fieldName: "val4", value: 150}, {fieldName: "val1", value: 200},],
                    normalizeField: null,
                    tooltipField: ""
                  }
                }, ]
              }
            ]
          },
          outFields: ["*"]
        });
        map.add(featureLayer);
//         reactiveUtils.when(
//           () =&amp;gt; view?.stationary === true,
//           async () =&amp;gt; {
//             console.log(view);
            
//           });
      });
  &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
  &amp;lt;div id="mapDiv"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="img.JPG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/46625iAD42921CBB6D8AC4/image-size/large?v=v2&amp;amp;px=999" role="button" title="img.JPG" alt="img.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please, could you help me ?&lt;/P&gt;&lt;P&gt;How can I use my own values (without a field) for media's type of a popup ?&lt;/P&gt;&lt;P&gt;Thank you so much for your help,&lt;/P&gt;&lt;P&gt;Bertrand&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 07:58:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mediacontent-popup-element-contains-a-chart-with/m-p/1195221#M78028</guid>
      <dc:creator>Bertrand_Laurancin</dc:creator>
      <dc:date>2022-08-09T07:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: MediaContent popup element contains a chart with line's type or column's type or bar 's type and with a series porpertie (ChartMediaInfoValueSerie</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mediacontent-popup-element-contains-a-chart-with/m-p/1200512#M78215</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/466654"&gt;@Bertrand_Laurancin&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-support-ChartMediaInfoValueSeries.html" target="_self"&gt;ChartMediaInfoValueSeries&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;class is a read-only support class that represents information specific to how field data should be plotted in a chart so you cannot build your own charts using this class.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You can take advantage of other charting APIs if you're looking to build custom charts not based on field info within your popups. Here's an example of how to do this via &lt;A href="https://www.chartjs.org/" target="_self"&gt;ChartJS&lt;/A&gt; and popup &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-CustomContent.html" target="_self"&gt;CustomContent&lt;/A&gt;:&amp;nbsp;&lt;A href="https://codepen.io/laurenb14/pen/vYRdEaj" target="_blank" rel="noopener"&gt;https://codepen.io/laurenb14/pen/vYRdEaj&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a couple examples of working with ChartJS in our samples as well:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurelayerview-query-distance/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/featurelayerview-query-distance/&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/arcade-execute-chart/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/arcade-execute-chart/&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 18:18:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mediacontent-popup-element-contains-a-chart-with/m-p/1200512#M78215</guid>
      <dc:creator>LaurenBoyd</dc:creator>
      <dc:date>2022-08-08T18:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: MediaContent popup element contains a chart with line's type or column's type or bar 's type and with a series porpertie (ChartMediaInfoValueSerie</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mediacontent-popup-element-contains-a-chart-with/m-p/1200703#M78225</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/400217"&gt;@LaurenBoyd&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;Finally i used chartJS :&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/blaurancin/pen/JjLrKqr" target="_blank" rel="noopener"&gt;https://codepen.io/blaurancin/pen/JjLrKqr&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content" target="_self"&gt;documentation&lt;/A&gt; indicates :&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"&lt;STRONG&gt;function&lt;/STRONG&gt;&amp;nbsp;- Content may be defined with a JavaScript function that returns any of the above-mentioned elements. This is useful when your popup requires additional processing or functionality than what is provided with the four content types listed above.&amp;nbsp;&lt;STRONG&gt;For example, assume that you would like to display charts using third-party JavaScript libraries&lt;/STRONG&gt;&amp;nbsp;or categorize information into separate tabs"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bertrand&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 07:43:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mediacontent-popup-element-contains-a-chart-with/m-p/1200703#M78225</guid>
      <dc:creator>Bertrand_Laurancin</dc:creator>
      <dc:date>2022-08-09T07:43:23Z</dc:date>
    </item>
  </channel>
</rss>

