import { CIQ } from "https://jsfiddle.chartiq.com/chart/js/advanced.js";
import quoteFeedSimulator from "https://jsfiddle.chartiq.com/chart/examples/feeds/quoteFeedSimulator.js";
// Activate the License Key
import getLicenseKey from "https://jsfiddle.chartiq.com/chart/key.js";
getLicenseKey(CIQ);
// start the chart engine
const stxx = new CIQ.ChartEngine({
container: document.querySelector(".chartContainer")
});
// there will be no primary series so hide its axis
stxx.setYAxisPosition(stxx.chart.yAxis,"none");
// see spacial changes below required on update and pagination calls
// when there will be no primary series.
stxx.attachQuoteFeed(quoteFeedSimulator, {
refreshInterval: 3
});
// render a chart with no primary series:
// 1- set an empty symbol
// 2- set an empty data array
stxx.loadChart(" ", [], function() {
stxx.addSeries("^AEDAFN", {
color: "green",
yAxis:{position:"right"} // give the series its own y-axis
});
stxx.addSeries("^AEDAFR", {
color: "red",
yAxis:{position:"right"} // give the series its own y-axis
});
stxx.addSeries("^AEDAFQ", {
color: "blue",
yAxis:{position:"right"} // give the series its own y-axis
});
});
/***************************************************************************/
/*********** Here is a modification of the quoteFeedSimulator *************/
/*********** to allow for a chart with no primary series. *****************/
/*********** Make sure updates or pagination requests for the **************/
/*********** empty symbol (" ") never return any data to guarantee *********/
/*********** nothing displays for the primary series ***********************/
/***************************************************************************/
quoteFeedSimulator.fetchUpdateData = function(symbol, startDate, params, cb) {
if(symbol == " ") { // !!! force no data for primary series
cb({
quotes: [] // always return an empty array on the callback
});
return;
}
const...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.