static chart with multiple series
This is the jsfiddle implementation of a basic static chart with a primary ad secondly series
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>
CSS
.stx-panel-title {
display: none;
}
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.
// Here is where you set all required defaults.
const stxx = new CIQ.ChartEngine({
container: document.querySelector(".chartContainer"),
layout: {
"chartType": "line",
"periodicity": 1,
"interval": 'minute',
},
preferences: {
"currentPriceLine": true,
"whitespace": 0
},
chart: {
yAxis: {
//width: 0, // remove y axis
initialMarginTop: 15, // adjust top margin - useful on very narrow charts.
initialMarginBottom: 15 // adjust top margin - useful on very narrow charts.
},
xAxis: {
displayGridLines: true // remove x axis grid lines
}
},
/* manageTouchAndMouse: true, // disable chart interactivity
xaxisHeight: 0 // remove x axis */
});
stxx.setGapLines(true);
//position legend
stxx.chart.legend = {
x: 300,
y: 20
};
console.log('hi');
//Now load a chart with its data
stxx.loadChart(
"", {
masterData:
[
{
"Value": 183.9413147,
"Date": "2023-03-23 15:00"
},
{
"Value": 184.4400024,
"Date": "2023-03-23 16:00"
},
{
"Value": 182,
"Date": "2023-03-23 8:00"
},
{
"Value": 180.7758789,
"Date": "2023-03-23 9:00"
},
{
"Value": 182.9249268,
"Date": "2023-03-24 10:00"
},
{
"Value": 183.3089142,
"Date": "2023-03-24 11:00"
},
{
"Value": 184.6514282,
"Date": "2023-03-24 12:00"
},
{
"Value": 184.8745117,
"Date": "2023-03-24 13:00"
},
{
"Value": 185.2463226,
"Date": "2023-03-24 14:00"
},
{
"Value": 185.3342438,
"Date": "2023-03-24 15:00"
},
{
"Value": 185.6598816,
...