How to repositionate a button after chart resizing

 

I want to ask you the proper way to get a object (in example a Button) repositionate after changing the size of the chart.

Thanks

 

did you try ObjectMove() to repositionate after chart event 

void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam){
        //...
        ObjectMove(...      
}
 

This work for me:


void OnChartEvent(const int id,

                  const long &lparam,

                  const double &dparam,

                  const string &sparam) {

   if (id == CHARTEVENT_CHART_CHANGE) {                 
      int width = ChartGetInteger(0, CHART_WIDTH_IN_PIXELS, 0);
      int nuevaPos = width - 70;
      ObjectSetInteger(0, InpName, OBJPROP_XDISTANCE, nuevaPos);
      ChartRedraw();
   }
     
}