Add Series with existing data

Sample of how to add a series to a chart using existing masterData objects

by Jon Eyrick

HTML

<link rel="stylesheet" href="http://jsfiddle.chartiq.com/chart/css/stx-chart.css">
<div class="chartContainer" style="width:600px;height:400px;position:relative;"></div>

<script src="http://jsfiddle.chartiq.com/chart/js/chartiq.js"></script>
<script src="http://jsfiddle.chartiq.com/chart/example-data/STX_SAMPLE_DAILY.js"></script>

JavaScript

var stxx = new CIQ.ChartEngine({
  container: $$$(".chartContainer")
});

stxx.chart.legend = {
  x: 400,
  y: 20
};

stxx.newChart("SPY", sampleData, null, function() {
	// use the newChart callback to ensure the chart is loaded before trying to load the series.
  // add a series using data already in the master Data array
  stxx.addSeries("Open", {
    color: "blue"
  });
});