width: number

Sets the width of Range Selector in pixels.

Default: Automatically calculated based on StockChart width.
Examples: 400, 800, …

  • We suggest not to set width/height property unless it is really required. When you don’t set width/height, CanvasJS automatically takes the size of range selector proportionate to StockChart. This helps you create responsive charts which adapts to varying screen sizes.

var stockChart = new CanvasJS.StockChart("container",
 rangeSelector: {
   width: 400,

Try it Yourself by Editing the Code below.

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