I have multiple fields in my attribute table so I want to use one general layer and apply to many fields (same range). The problem is everytime I apply the layer or it`s get the old field and apply to my map or apply to new field but do not get the settings.
I can get the map with the correct range but always do not came with the legend format (in percentage (%)).
import arcpy
import csv
import pythonaddins
TabelaP1 = arcpy.GetParameterAsText(0)
Ano = arcpy.GetParameterAsText(1)
IndexL = int(arcpy.GetParameterAsText(2))
SiglaProduto = arcpy.GetParameterAsText(3)
mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd, "")[0]
lyr = arcpy.mapping.ListLayers(mxd, "", df)[IndexL]
Layer1 = arcpy.mapping.Layer(r'F:\Agro\Layers\PercAPH2.lyr')
arcpy.mapping.UpdateLayer(df, lyr, Layer1, True)
arcpy.AddMessage('Calculando Porcentagem de Area Plantada')
if '2002' < Ano < '2016':
arcpy.AddMessage('Iniciando Calculo para o Ano {0}'.format(Ano))
NovoCampo1 = 'PercAPH_'+SiglaProduto+'_'+Ano
Campo1 = 'APH_'+SiglaProduto+'_'+Ano
arcpy.AddMessage('Campo selecionado: {0}'.format(Campo1))
arcpy.AddField_management(TabelaP1, NovoCampo1, 'Float')
arcpy.CalculateField_management(TabelaP1, NovoCampo1, '(!{0}!/!AreaTotalHec!)*100'.format(Campo1), "PYTHON_9.3")
lyr.symbologyType == "GRADUATED_COLORS"
lyr.symbology.valueField = NovoCampo1
arcpy.RefreshActiveView()
arcpy.RefreshTOC()
if Ano < '2003' or Ano > '2015':
arcpy.AddMessage('O Ano {0} informado nao possui Serie Historica disponivel'.format(Ano))
arcpy.RefreshActiveView()
arcpy.RefreshTOC()
[
The original layer give me the label in % with round(2) for the numbers. I tried many ways, including make by ArcCatolog for the GDB but also do not work. There is any possible way to solve this?