Josh Gilbert
Josh Gilbert

Reputation: 89

Chart options in angularJs (NodeRed Charts)

I'm trying to display stacked data in my node chart. When I set the options to stack the data using:

ui= {
    options: {
        scales: {
            xAxes: [{
                stacked: true
            }],
            yAxes: [{
                stacked: true,
            }]
        }
    }
    
} 

I lose the Fixed axis specified in the node options. I have tried setting the min/max values in multiple different formats and I cant get the chart to stack the data and fix the axis limits, its always one or the other

Upvotes: 0

Views: 224

Answers (1)

Josh Gilbert
Josh Gilbert

Reputation: 89

My installation of node red isn't using the latest and greatest angular-chartjs library, going through some of the ancient documentation I've found the ticks option which allows you to set the max axis, this was changed in Version 3 of chartJS.

Solution below:

ui= {
    options: {
        scales: {
            xAxes: [{
                stacked: true
            }],
            yAxes: [{
                stacked: true,
                ticks: {
                    max: 60,
                    min: -140
                }
            }]
        }
    }    
}

Upvotes: 0

Related Questions