Home > front end >  Echarts need fixed horizontal axis is 12 months. Urgent please
Echarts need fixed horizontal axis is 12 months. Urgent please

Time:09-24

 
Option={
XAxis: [{
Type: 'time',
SplitNumber: 13,
BoundaryGap: false,
//the interval: 2 * 3600 * 1000,
AxisLine: {
Show: false,
Color: 'RGB (141, 149, 160)
},
SplitLine: {
Graphics.linestyle: {
Type: 'dotted'
}
},

AxisLabel: {
//verticalAlign: 'bottom',
ShowMaxLabel: true,
ShowMinLabel: false,
Align: 'right',
VerticalAlign: 'top',
Padding: 4,
The formatter: function (the value index) {
Var date=new date (value);
//let y=date. GetFullYear (),
//m=date getMonth () + 1 & lt; 10? '0' + (date, getMonth () + 1) : date, getMonth () + 1,
//d=date. GetDate () & lt; 10? '0' + date. GetDate () : the date. The getDate ();

The return date, getMonth () + 1 + 'month';
},
Color: 'RGB (141, 149, 160)
//the align: 'left'
}
}
],
YAxis: [{
Type: 'value',

Min: 80,
Max: 200,
Position: 'right',
AxisLine: {
OnZero: false,
Graphics.linestyle: {
Color: 'RGB (141, 149, 160)
}
},
AxisLabel: {
//inside: true
}
},
{
Type: 'value',

Min: 80,
Max: 200,
AxisTick: {
Show: false
},
AxisLine: {
OnZero: false,
Graphics.linestyle: {
Color: 'RGB (141, 149, 160)
}
},
AxisLabel: {
Show: false
},
SplitLine: {
Show: false
}
}
],
Series: [{
Name: 'systolic blood pressure,
Type: 'the line',
Smooth: false,
Animation: false,
Data: [{
Value: [' 2020-01-01 00:00:00 ', ' ', 'mm hg]
}, {
Value: [' 2020-02-01 00:00:00 ', ' ', 'mm hg]
}, {
Value: [' 2020-03-01 00:00:00 ', ' ', 'mm hg]
}, {
Value: [' 02:00:00 2020-04-04 ', '11', 'mm hg]
}, {
Value: [' 2020-05-01 00:00:00 ', ' ', 'mm hg]
}, {
Value: [' 2020-06-01 00:00:00 ', ' ', 'mm hg]
}, {
Value: [' 2020-07-01 00:00:00 ', '12', 'mm hg]
}, {
Value: [' 2020-08-01 00:00:00 ', ' ', 'mm hg]
}, {
Value: [' 2020-09-01 00:00:00 ', ' ', 'mm hg]
}, {
Value: [' 2020-10-01 00:00:00 ', ' ', 'mm hg]
}, {
Value: [' 2020-11-01 00:00:00 ', ' ', 'mm hg]
}, {
Value: [' 2020-12-01 00:00:00 ', ' ', 'mm hg]
},
ConnectNulls: true
},
DataZoom: [{
Type: 'inside',
YAxisIndex: 0,

StartValue: 80,
EndValue: 150,

FilterMode: 'none',
ShowDetail: false,
ZoomLock: false,//control can only translation, can't zoom
PreventDefaultMouseMove: false,
ZoomOnMouseWheel: false
},
The grid: {
Top: '70',
Bottom: '30',
Left: '5%'
}
};

Was missing in the code above, show in April, it is not clear what reason, hope someone help me solve

CodePudding user response:

Isn't it too crowded not displayed

CodePudding user response:

The date extracted with category axis display

CodePudding user response:

reference 1 floor console. The log () response:
is too crowded not displayed

Not too crowded, I found the reason, probably because the system default interval is 30 days, according to the month is 30 days, I now adjust the interval to 31 days can be displayed, but if you fill in the Numbers of April 1, not line, now has yet to find a good method

CodePudding user response:

Change your type type don't use time, to a category, and then customize the horizontal axis label is not good, it is not necessary to death upon the time

CodePudding user response:

reference 4 floor nian_cj response:
your type types don't use time, into a category, and then customize the horizontal axis label is not good, no need to die upon the time


Demand is also show the value of the different time points in a month, that is to say within a month, also want to have a curve, how to also show a curve in the category, not a point?

CodePudding user response:

refer to fifth floor Mr. L 18904261721 response:
Quote: refer to 4th floor nian_cj response:

Change your type type don't use time, to a category, and then customize the horizontal axis label is not good, it is not necessary to screwing time


Demand is also show the value of the different time points in a month, that is to say within a month, also want to have a curve, how to also show a curve in the category, not a point?


https://www.echartsjs.com/examples/zh/editor.html? C=bar - large

You can take a look at this example may help you

CodePudding user response:

And this example, you can consult
https://www.echartsjs.com/examples/zh/editor.html? C=bar - label - rotation
  • Related