set(String propertyName, Mixed value [,Boolean updateStockChart = true])

Sets the value of specified style property of inputFields.

Parameters:
        propertyName: Name of the property
        value: Value to be set on property
        updateStockChart: When true, updates the StockChart after setting the value. Default value is true.
Example: stockChart.rangeSelector.inputFields.style.set(“borderThickness “, 1, true);
Note:
  • You can refer to Style Element for complete list of properties available.
  • StockChart should be rendered before you can use set method.
  • By default StockChart gets updated / re-rendered, whenever set method is called. If you have multiple properties, it is recommended to disable auto update by setting updateStockChart to false till the last step. Otherwise, the performance might be affected because of rendering StockChart repeatedly. You can see the example below.
var stockChart = new CanvasJS.StockChart("container",
{
 .
 .
 rangeSelector: {
   inputFields: {
     style: {
       .
       //style properties of inputFields
       .
     }
     .
   }
   .
 }
 .
 . 
});
stockChart.render();

stockChart.rangeSelector.inputFields.style.set("borderThickness ", 1, false);
stockChart.rangeSelector.inputFields.style.set("fontColor", "#F084C2", true);

Properties accessible via set method

Please refer to Style Element for the complete list of properties that can be accessed via set method.

Try Editing The Code

  Also See:    


If you have any questions, please feel free to ask in our forums.Ask Question