How change legend values with param?

Hi , please can you tell me , how i can dynamicly change legend values name when i use load function ???

for example
i have
values:[
{text:“company A”,color:“#3399ff”},
{text:“company B”,color:“#66cc00”, markerType:“item”}
]

Can i use val_count param and show in the legend name ?
same like this

values:[
{text:“company A(number=”+val_count+“)”,color:“#3399ff”},
{text:“company B”,color:“#66cc00”, markerType:“item”}
]

maybe something like this ???

values:function(){

  var val_count=5;
  var ret='{text:"company A(number="+val_count+")",color:"#3399ff"},
   {text:"company B",color:"#66cc00", markerType:"item"}'
  
  return  ret

}

Hi
You can use “template” property for this
docs.dhtmlx.com/chart__legend.html