Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chartist not responsive in node js #21

Open
adeete opened this issue May 16, 2018 · 1 comment
Open

Chartist not responsive in node js #21

adeete opened this issue May 16, 2018 · 1 comment

Comments

@adeete
Copy link

adeete commented May 16, 2018

` 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.

@AshMcConnell
Copy link

I'm finding the same issue. Unless I specify the width / height explicitly the chart doesn't work properly. Is there any workarounds for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants