Set range and freeze screen
by sonylnagale
HTML
<link rel="stylesheet" type="text/css" href="https://jsfiddle.chartiq.com/chart/css/stx-chart.css" media="screen" />
<div class="chartContainer" style="width:600px;height:400px;position:relative;"></div>
JavaScript
import { CIQ } from "https://jsfiddle.chartiq.com/chart/js/advanced.js";
// Activate the License Key
import getLicenseKey from "https://jsfiddle.chartiq.com/chart/key.js";
getLicenseKey(CIQ);
import sampleData from "https://jsfiddle.chartiq.com/chart/examples/data/STX_SAMPLE_5MIN.js";
const stxx = new CIQ.ChartEngine({
container: document.querySelector(".chartContainer")
}); // Declare a CIQ.ChartEngine object. This is the main object for drawing charts.
// disable zoom and scroll
stxx.allowZoom = false;
stxx.allowScroll = false;
//remove the zoom and home buttons from the screen
stxx.controls["chartControls"] = null;
stxx.controls["home"] = null;
stxx.loadChart(
"SPY",
{
masterData: sampleData,
/* range: {
dtLeft: new Date(2012, 10, 15),
dtRight: new Date(2012, 10, 16),
} */
}
);