How do I create a Class Breaks Renderer on a Graphic...
I am following this https://community.esri.com/t5/python-questions/create-definition-query/m-p/1060578/thread-id/61196#M61219
But it does the below....... but I want a class breaks renderer
function addGraphics(result) {
graphicsLayer.removeAll();
result.features.forEach(function (feature) {
var g = new Graphic({
geometry: feature.geometry,
attributes: feature.attributes,
symbol: {
type: "simple-marker",
color: [0, 0, 0],
outline: {
width: 2,
color: [0, 255, 255]
},
size: "20px"
},
Can I do something like this?
var less1 = new SimpleFillSymbol({
color: "gray",
style: "none",
outline: {
width: 0,
color: "white"
}
});
var more1 = new SimpleFillSymbol({
color: "green",
style: "solid",
outline: {
width: 0.5,
color: "white"
}
});
var more100 = new SimpleFillSymbol({
color: "Blue",
style: "solid",
outline: {
width: 0.5,
color: "white"
}
});
var renderer = new ClassBreaksRenderer({
field: "SomeField",
defaultSymbol: new SimpleFillSymbol({
color: "red",
outline: {
width: 0.5,
color: "white"
}
}),
defaultLabel: "no data",
classBreakInfos: [
{
minValue: 0,
maxValue: 0.9,
symbol: less1,
label: "< 1"
}, {
minValue: 1.01,
maxValue: 50.0,
symbol: more1,
label: "1 - 50"
}, {
minValue: 50.01,
maxValue: 100.00,
symbol: more100,
label: "> 50"
}]
});
function addGraphics(result) {
graphicsLayer.removeAll();
result.features.forEach(function (feature) {
var g = new Graphic({
geometry: feature.geometry,
attributes: feature.attributes,
renderer : renderer