problem with auto-calculation of viewportMinimum/Maximum for navigator
Despite the documentation saying that viewportMaximum and viewportMinimum are auto-calculated for the navigator: https://canvasjs.com/docs/stockcharts/stockchart-options/navigator/axisx/ Their values seem to remain constant even when we use the navigator to zoom into a very small region. This can be very problematic for users as it becomes almost impossible to zoom into a small region using the navigator . For example, try zooming into the data of the attached fiddle using only the navigator. This combined with my previously submitted bug of not being able to zoom into "open-ended" regions means that it is effectively impossible for a user to zoom into the given region. I understand that I could potentially adjust the viewportMaximum and viewportMinimum of the navigator programatically/manually but for something that is supposed to be auto-calculated it would be nice if this just worked out of the box.
by jcmalek
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.stock.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the StockChart -->
<div id="stockChartContainer" style="height: 450px; width: 100%;"></div>
JavaScript
var dataPoints = [
{ x: new Date(2018, 01, 1, 0, 5), y: 55 },
{ x: new Date(2018, 01, 1, 0, 10), y: 50 },
{ x: new Date(2018, 01, 1, 0, 15), y: 65 },
{ x: new Date(2018, 01, 1, 0, 20), y: 95 },
{ x: new Date(2018, 01, 1, 0, 25), y: 68 },
{ x: new Date(2018, 01, 1, 0, 30), y: 28 },
{ x: new Date(2018, 01, 1, 0, 35), y: 34 },
{ x: new Date(2018, 01, 1, 0, 40), y: 14 },
{ x: new Date(2018, 01, 1, 0, 45), y: 71 },
{ x: new Date(2018, 01, 1, 0, 50), y: 55 },
{ x: new Date(2018, 01, 1, 0, 55), y: 50 },
{ x: new Date(2018, 01, 1, 1, 0), y: 71 },
{ x: new Date(2018, 01, 1, 1, 5), y: 55 },
{ x: new Date(2018, 01, 1, 1, 10), y: 50 },
{ x: new Date(2018, 01, 1, 1, 15), y: 65 },
{ x: new Date(2018, 01, 1, 1, 20), y: 95 },
{ x: new Date(2018, 01, 1, 1, 25), y: 68 },
{ x: new Date(2018, 01, 1, 1, 30), y: 28 },
{ x: new Date(2018, 01, 1, 1, 35), y: 34 },
{ x: new Date(2018, 01, 1, 1, 40), y: 14 },
{ x: new Date(2018, 01, 1, 1, 45), y: 71 },
{ x: new Date(2018, 01, 1, 1, 50), y: 55 },
{ x: new Date(2018, 01, 1, 1, 55), y: 50 },
];
var dataPointsExtended = [{x: new Date(2017, 01, 1), y: 0}];
dataPointsExtended.push(...dataPoints);
dataPointsExtended.push({x: new Date(2020, 11, 01), y: 0});
var stockChart = new CanvasJS.StockChart("stockChartContainer", {
title:{
text: "Basic StockChart"
},
exportEnabled: true,
charts: [{
zoomEnabled: true,
data: [{
type: "line",
dataPoints: dataPoints
}]
}],
navigator: {
slider: {
minimum: new Date(2017, 12, 15),
maximum: new Date(2018, 01, 15)
},
data: [{
dataPoints: dataPointsExtended,
}]
}
});
stockChart.render();