Default: Automatically calculated based on StockChart width. Examples: 400, 800, …
Note
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,
.
.
},
.
.
});
stockChart.render();