22.09.2022, 18:02
Hello
I don't know what the scaling is enabled plan is, where is it?
In my wiser it works perfectly with the two url's.
I have added the suggested code and the graph is drawn, the data axis is scaled but the graph is empty of data.
full script
Thank you
I don't know what the scaling is enabled plan is, where is it?
In my wiser it works perfectly with the two url's.
I have added the suggested code and the graph is drawn, the data axis is scaled but the graph is empty of data.
full script
Code:
$(function() {
$('<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chartist/0.11.4/chartist.min.css" type="text/css">').appendTo('head');
$.getScript('https://cdnjs.cloudflare.com/ajax/libs/chartist/0.11.4/chartist.min.js', function() {
var el = $('<div></div>').css({
position: 'absolute',
width: '600px',
height: '300px',
left: '700px',
top: '50px',
zIndex: 999
}).appendTo('#plan-4');
$.getJSON('/user/data.lp', function(data) {
var labels = [];
for (var i = 0; i < 24; i++) {
var label = i.toString();
if (label.length == 1) {
label = '0' + label;
}
labels.push(label);
}
for (var i = 0; i < data.length; i++) {
data[ i ] = data[ i ] / 1000;
}
var chart = new Chartist.Line(
el.get(0),
{
labels: labels,
series: [ data ]
},
{
low: 0,
showArea: true
}
);
$('body').on('showplan', function() {
chart.resizeListener();
});
});
});
});
Thank you