static "stamp" like chart
This is the jsfiddle implementation of a basic small static chart
by sonylnagale
HTML
<link rel="stylesheet" href="https://jsfiddle.chartiq.com/chart/css/stx-chart.css">
<div class="chartContainer" style="width:150px;height:100px;position:relative; border:1px"></div>
<script src="https://jsfiddle.chartiq.com/chart/js/chartiq.js"></script>
CSS
.stx-panel-title {
display: none;
}
JavaScript
// Declare a CIQ.ChartEngine object.
// This is the main object for drawing charts.
// Here is where you set all required defaults.
var stxx = new CIQ.ChartEngine({
container: $$$(".chartContainer"),
layout: {
"chartType": "line",
"candleWidth": 10,
"periodicity": 1,
"interval": 'day',
},
preferences: {
"currentPriceLine": false,
"whitespace": 0
},
chart: {
yAxis: {
width: 0 // remove y axis
},
xAxis: {
displayGridLines: false // remove x axis grid lines
}
},
manageTouchAndMouse: false, // disable chart interactivity
xaxisHeight: 0 // remove x axis
});
CIQ.postAjax({
url: 'https://httpbin.org/post',
payload: '{ hello: "hello" }',
contentType: 'application/json',
cb: (data) => { console.log(data); }
});
CIQ.postAjax('https://httpbin.org/post', 'arg1',(data) => { console.log(data); });
//Now load a chart with its data
stxx.loadChart(
"SPY", [{
"Date": "1993-01-29",
"Close": 43.94,
"Volume": 1003200,
}, {
"Date": "1993-02-01",
"Close": 44.25,
"Volume": 480500,
}, {
"Date": "1993-02-02",
"Close": 44.34,
"Volume": 201300,
}, {
"Date": "1993-02-03",
"Close": 44.81,
"Volume": 529400,
}, {
"Date": "1993-02-04",
"Close": 45,
"Volume": 531500,
}, {
"Date": "1993-02-05",
"Close": 44.97,
"Volume": 492100,
}, {
"Date": "1993-02-08",
"Close": 44.97,
"Volume": 596100,
}, {
"Date": "1993-02-09",
"Close": 44.66,
"Volume": 122100,
}, {
"Date": "1993-02-10",
"Close": 44.72,
"Volume": 379600,
}, {
"Date": "1993-02-11",
"Close": 44.64,
"Volume": 371000,
}, {
"Date": "1993-02-12",
"Close": 44.60,
"Volume": 366500,
}, {
"Date": "1993-02-13",
"Close": 44.51,
"Volume": 339100,
}, {
"Date": "1993-02-14",
"Close": 44.72,
"Volume": 357910,
}],
function() {
CIQ.Studies.addStudy(stxx, "vol undr"); // optional volume underlay
...