On the comparison between automatic maximum and hchart of echart Chart

figure 1 is hchart, figure 2 is echart, their maximum value is 2, but the processing such as hchart is obviously better than echart, I would like to ask if you do not know the maximum value (cannot set the maximum value because the data is uncertain), how can echart set properties like hchart to leave a blank on the maximum value? Or the plug-in comes with it and cannot be set.
God of trouble, take a look. Thank you.

Apr.05,2021

thanks for the invitation.
first of all, there can be no uncertain data.
in the moment you are about to draw, you must have got the exact data
the question can be translated into how to find the maximum

. < H2 > Scheme 1: maximum value of rigid data < / H2 >

assume that the data obtained from the interface is similar

const res = {
    code:0,
    message:"success",
    data:[
        // 01
        [1533698210801,20],
        [1533698212822,30],
        [1533698230844,10],
        [1533698233901,50],
        [1533698236780,20],
    ]
};
// 
const values = res.data.map(([,v])=>v);
// 
const max = Math.max(...values);
// option,
< H2 > Plan 2: read the document < / H2 >

clipboard.png
you write

max: function(value) {
    /*20%*/
    return value.max * 1.2;
}

I wish I could

Menu