Add Series with left y axis
Sample of how to add series to a chart and have their y axis on the left
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:100%;height:400px;position:relative;"></div>
JavaScript
import { CIQ } from "https://jsfiddle.chartiq.com/chart/js/advanced.js";
import quoteFeedSimulator from "https://jsfiddle.chartiq.com/chart/examples/feeds/quoteFeedSimulator.js";
// Declare a CIQ.ChartEngine object. This is the main object for drawing charts.
const stxx = new CIQ.ChartEngine({
container: document.querySelector(".chartContainer")
});
// connect the chart to the feed
stxx.attachQuoteFeed(quoteFeedSimulator, {
refreshInterval: 15
});
stxx.setChartType('line');
// Load the primary chart
stxx.loadChart(
" ", { symbol: "SPY" },
function() {
stxx.addSeries(
null, {
color: "#FFBE00",
display: "SPY Second",
symbolObject: {
symbol: "SPY"
}
},
);
}
);