AnsweredAssumed Answered

Cannot set breakCount for 'ManualInterval' symbology

Question asked by coudert on Jan 30, 2019
Latest reply on Jan 31, 2019 by coudert

Hello,

 

I am unable to set the BreakCount for 'ManualInterval' symbology.  The value remains zero.  What is the proper way to set the number of breaks?

 

It works for 'NaturalBreaks' classificationMethod but not for 'ManualInterval'.  Changing the classification method in the code below and removing the references to classBreaks will work as expected.

 

 

 

#ArcGIS Pro 2.1.2
#Python 3.6.2, 64 bit
aprx = arcpy.mp.ArcGISProject('CURRENT')
cwd = 'c:\\temp'
workingLayer = aprx.listMaps()[0].listLayers()[0]
sourceTable = arcpy.ListTables()[0]
sourceLayout = aprx.listLayouts()[0]
metric = ('Calc01Perc',(-0.5,0.5)) # (Field name, (min,max values))

sym = workingLayer.symbology
sym.updateRenderer('GraduatedColorsRenderer')
sym.renderer.classificationMethod = 'ManualInterval'
sym.renderer.classificationField = sourceTable + '_' + metric[0]
print('DEBUG   fieldname: ' + sym.renderer.classificationField)
sym.renderer.colorRamp = aprx.listColorRamps('Bathymetric Scale')[0]
sym.renderer.breakCount = 10 # This does not stick for 'ManualInterval' or unspecified classificationMethod
print('DEBUG   breakCount: ' + str(sym.renderer.breakCount) + '= 10 ?')
step = 0.1
breakVal = -0.5
print('DEBUG   len(classBreaks) = ' + str(len(sym.renderer.classBreaks)))
for brk in sym.renderer.classBreaks:
    brk.upperBound = breakVal
    breakVal += step
    print('DEBUG   next break: ' + str(breakVal))
workingLayer.symbology = sym

Outcomes