chartist-js / chartist

Simple responsive charts
https://chartist.dev
MIT License
13.34k stars 2.53k forks source link

Height value is an integer not a string #1278

Closed RubenRubioM closed 2 years ago

RubenRubioM commented 3 years ago

In the documentation says that width and height value in the Bar chart has to be a string like '100px' (here) but only works if I specity it as an integer

image

new Chartist.Bar('#ct-chart-bar-channel', {
        labels: dateLabels,
        series: [dateValues]
        }, {
        axisX: {
            offset: 20,
            position: 'end',
            labelOffset: {
                x: 0,
                y: 0,
            },
            showLabel: true,
            showGrid: true,
            labelInterpolationFnc: Chartist.noop,
            scaleMinSpace: 30,
            onlyInteger: false
        },
        axisY: {
            offset: 50,
            position: 'start',
            labelOffset: {
                x: 0,
                y: 0,
            },
            showLabel: true,
            showGrid: true,
            labelInterpolationFnc: Chartist.noop,
            scaleMinSpace: 30,
            onlyInteger: false
        },
        width: undefined,
        height: 550, // <--- Doesn't work if '550px'
        high: undefined,
        low: undefined,
        referenceValue: 0,
        chartPadding: {
            top: 30,
            right: 15,
            bottom: 5,
            left: 30
        },
        seriesBarDistance: 15,
        stackBars: false,
        stackMode: 'accumulate',
        horizontalBars: false,
        distributedSeries: false,
        reverseData: false,
        showGridBackground: false,
    }, {
        //Options
    }, [
        //ResponsiveOptions
    ]);
Arantiryo commented 2 years ago

It's fixed now.