How to find and set y-axis value


how do I find out y-axis value from the key [{key:‘abc’, label:‘test1’},{key:‘xyz’, label:‘test2’}] and change the value of label or some other attribute from that key. e.g key: abc I want to change value of label


Hello @ash0602 ,

You can get find the section label by key, using the find method of the Array, after that you will be able to update the label of the found section, and call the updateCollection method:

var sections=[
  {key:1, label:"Apartment 1"},
  {key:2, label:"Apartment 2"},
  {key:3, label:"Apartment 3"},
  {key:4, label:"Apartment 4"}

  name:	"timeline",
  x_unit:	"day",
  x_date:	"%H:%i", 
  x_step:	1,
  x_size: 7,
  x_start: 0,
  x_length: 7,
  y_unit:	scheduler.serverList("sec", sections),
  y_property:	"section_id",
    x_unit: "day", 
    x_date: "%F %d" 
sections.find(x => x.key === 1).label = "apt Foo";

Here is a demo:
(click on the empty space on a section to change its label)

Kind regards,


that’s great, so simple, thanks a ton! :blush::+1: