<?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 Change pie chart slice colors? in ArcGIS Hub Questions</title>
    <link>https://community.esri.com/t5/arcgis-hub-questions/change-pie-chart-slice-colors/m-p/1099016#M4802</link>
    <description>&lt;P&gt;I am creating a hub for aquatic barrier data, and I would like my pie chart to be color coded from green to red. Is it possible to change the pie slice colors within the chart?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 16 Sep 2021 17:50:23 GMT</pubDate>
    <dc:creator>KathleenHoenke</dc:creator>
    <dc:date>2021-09-16T17:50:23Z</dc:date>
    <item>
      <title>Change pie chart slice colors?</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/change-pie-chart-slice-colors/m-p/1099016#M4802</link>
      <description>&lt;P&gt;I am creating a hub for aquatic barrier data, and I would like my pie chart to be color coded from green to red. Is it possible to change the pie slice colors within the chart?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 17:50:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/change-pie-chart-slice-colors/m-p/1099016#M4802</guid>
      <dc:creator>KathleenHoenke</dc:creator>
      <dc:date>2021-09-16T17:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change pie chart slice colors?</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/change-pie-chart-slice-colors/m-p/1099523#M4807</link>
      <description>&lt;P&gt;Hi Kathleen,&lt;/P&gt;&lt;P&gt;Yes it is possible.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Once you selected the chart on the page, change the "Chart Type" to JSON.&lt;/LI&gt;&lt;LI&gt;Near the end of the JSON code, you can add the &lt;EM&gt;styles&lt;/EM&gt; tag and then the &lt;EM&gt;colors&lt;/EM&gt; option with the various colours in hex code.&lt;/LI&gt;&lt;LI&gt;In the example below, you will see the addition I made starting at line 31 to line 41.&lt;/LI&gt;&lt;LI&gt;Don't forget to add a comma like I did at line 30 or you'll will get an error.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "type": "pie",
  "datasets": [
    {
      "url": "https://services.arcgis.com/uDTUpUPbk8X8mXwl/arcgis/rest/services/Public_Schools_in_Onondaga_County/FeatureServer/0",
      "query": {
        "orderByFields": "Number_of_SUM DESC",
        "groupByFieldsForStatistics": "Type",
        "outStatistics": [
          {
            "statisticType": "sum",
            "onStatisticField": "Number_of",
            "outStatisticFieldName": "Number_of_SUM"
          }
        ]
      }
    }
  ],
  "series": [
    {
      "category": {
        "field": "Type",
        "label": "Type"
      },
      "value": {
        "field": "Number_of_SUM",
        "label": "Number of Students"
      }
    }
  ],
  /* Add in this style piece. You will want as many hex colours as items in your pie chart.  It colours the slices in the same order as they're listed */
  "style": {
    "colors": [
      "#f6eff7",
      "#dbc9e1",
      "#67a9cf",
      "#02818a",
      "#1c9099",
      "#016c59"
    ]
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;*Edited to add some more clarity&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 19:38:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/change-pie-chart-slice-colors/m-p/1099523#M4807</guid>
      <dc:creator>Kevin_Peel</dc:creator>
      <dc:date>2021-09-17T19:38:50Z</dc:date>
    </item>
  </channel>
</rss>

