Series without primary instrument

Sample of how to add a series to a chart without having a primary instrument

by ChartIQ Library

HTML

<link rel="stylesheet" type="text/css" href="https://jsfiddle.chartiq.com/chart/css/stx-chart.css" media="screen" />

<div class="chartContainer" style="width:100%;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);

// Declare a CIQ.ChartEngine object. This is the main object for drawing charts.
const stxx = new CIQ.ChartEngine({ container: document.querySelector(".chartContainer") }); 

// Set the periodicity to match what is in your series
stxx.setPeriodicity(1,"day");

// render a chart with no primary series:
stxx.loadBlankChart();

// Now add each series. 
// 'shareYAxis' puts each series on the same y-axis
// 'permanent' prevents users from deleting a series by right clicking

stxx.addSeries("AAPL", {
  color:"#FF0000", 
  data:[{Date:"20160210",Close:140},{Date:"20160211",Close:141},{Date:"20160212",Close:141.2},{Date:"20160220",Close:138},{Date:"20160221",Close:141.5}], 
  shareYAxis:true, 
  permanent:true
});

stxx.addSeries("SPY", {
  color:"#00FF00", 
  data:[{Date:"20160218",Close:138},{Date:"20161108",Close:137},{Date:"20161109",Close:135}], 
  shareYAxis:true, 
  permanent:true
});

stxx.addSeries("GOOG", {
  color:"#0000FF", 
  data:[{Date:"20161022",Close:142},{Date:"20161023",Close:140},{Date:"20161024",Close:141}], 
  shareYAxis:true,
  permanent:true
});