AnsweredAssumed Answered

How to define ColorScheme in ArcGIS API Javascript 4.9?

Question asked by Landcor on Dec 2, 2018
Latest reply on Dec 4, 2018 by Landcor


I am developing a custom web map application using ArcGIS API for JavaScript 4.9 and trying to utilize smartmapping functionality (createContinuousRenderer()) -> generating data-driven continuous color visualization based on data from a numeric field in a FeatureLayer.


To the point....the data I would like to visualize is simply % of market share by municipality.  The goal is to create a continuous renderer that would look like this: 



 However, currently, I am getting the following : 



Based on the API description (continuous renderer), the user may select a pre-defined color scheme. -> "Pass the scheme object to this property to avoid getting one based on a theme and the basemap"..this is exactly what I would like to avoid to!!!


My code snippet below:


function generateRenderer(){
var fieldLabel = fieldSelect.options[fieldSelect.selectedIndex].text;

var colorParams = {
layer: AssessmentStat,
basemap: map.basemap,
view: view,
field: fieldSelect.value,
normalizationField: null,
theme: "above-and-below",
ColorScheme: ......???,
defaultSymbolEnabled: true,
legendOptions: {
title: "% Market Share in " + fieldLabel
AssessmentStat.renderer = response.renderer;


Would anyone know how such colorscheme parameter is defined?


Thank you in advance.