Skip to content

Chartist not responsive in node js #21

@adeete

Description

@adeete

` co(function * () {
const options = (Chartist) => ({
showArea:true,
width:'110%',
height:300,
axisX: {
title: 'Timestamp' ,
showGrid:true,
offset:40,
position: 'end',
type: Chartist.AutoScaleAxis,
divisor: 8,
scaleMinSpace: 40,
labelInterpolationFnc: function(value) {
return moment(value).format('MM do,YYY');
}
},
axisY: {
showGrid:true,
title: "temperature" ,
high:100,
scaleMinSpace: 20
},
chartPadding: {
right: 10,
bottom: 0,
left: 0
},
fullWidth: true
} )
const line2 = yield generate('line', options, {
series:[
data.map(function(s) {
return {x: s.transDate, y: s.temperature, meta: s.temperature + ' on ' + moment(s.timestamp).format('YYYY-MM-DD')};
})
],
})
var line3 =line2.replace("ct-chart","ct-chart ct-golden-section");
console.log(line3);

    res.render('index',{line:line3});
})`

Whatever value i give or tweak the css until i specify width in node js in px or simple number it does not work.Even after manually adding ct-chart-golden-section it did not become responsive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions