A good way to do this would be to use an object for all of the arguments. Something like:
function plotChart(options) {
// Set defaults
options.chart_type = options.chart_type || '1';
// Check if each required option is set
// Whatever is used by the data
}
Then when the function is called:
plotChart({
data: 'some data',
xlabel: 'some xlabel',
ylabel: 'some ylabel',
chart_type: '5' // This is optional
});