'commit'
This commit is contained in:
@@ -23,3 +23,7 @@ async def get_urbanization_rate_chart_config():
|
|||||||
async def get_preschool_education_chart_config():
|
async def get_preschool_education_chart_config():
|
||||||
return RuYuanZaiYuanModel.generate_preschool_education_config()
|
return RuYuanZaiYuanModel.generate_preschool_education_config()
|
||||||
|
|
||||||
|
@router.get("/school/preschool/inschool/chart")
|
||||||
|
async def get_preschool_in_school_chart_config():
|
||||||
|
return RuYuanZaiYuanModel.generate_in_school_education_config()
|
||||||
|
|
||||||
|
Binary file not shown.
502
Log/1.log
502
Log/1.log
@@ -1,316 +1,186 @@
|
|||||||
{
|
C:\Users\Administrator\.conda\envs\yunnan\python.exe D:\dsWork\YunNanProject\Start.py
|
||||||
"animation": true,
|
INFO: Started server process [2204]
|
||||||
"animationThreshold": 2000,
|
INFO: Waiting for application startup.
|
||||||
"animationDuration": 1000,
|
INFO: Application startup complete.
|
||||||
"animationEasing": "cubicOut",
|
INFO: Uvicorn running on http://0.0.0.0:8100 (Press CTRL+C to quit)
|
||||||
"animationDelay": 0,
|
INFO: 127.0.0.1:62068 - "GET /static/preschool_education.html HTTP/1.1" 200 OK
|
||||||
"animationDurationUpdate": 300,
|
INFO: 127.0.0.1:62068 - "GET /bigscreen/school/preschool/chart HTTP/1.1" 200 OK
|
||||||
"animationEasingUpdate": "cubicOut",
|
INFO: 127.0.0.1:62068 - "GET /bigscreen/school/preschool/inschool/chart HTTP/1.1" 500 Internal Server Error
|
||||||
"animationDelayUpdate": 0,
|
ERROR: Exception in ASGI application
|
||||||
"aria": {
|
Traceback (most recent call last):
|
||||||
"enabled": false
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi
|
||||||
},
|
result = await app( # type: ignore[func-returns-value]
|
||||||
"color": [
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__
|
||||||
"#5470c6",
|
return await self.app(scope, receive, send)
|
||||||
"#91cc75",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\applications.py", line 1054, in __call__
|
||||||
"#fac858",
|
await super().__call__(scope, receive, send)
|
||||||
"#ee6666",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\applications.py", line 113, in __call__
|
||||||
"#73c0de",
|
await self.middleware_stack(scope, receive, send)
|
||||||
"#3ba272",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\errors.py", line 186, in __call__
|
||||||
"#fc8452",
|
raise exc
|
||||||
"#9a60b4",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\errors.py", line 164, in __call__
|
||||||
"#ea7ccc"
|
await self.app(scope, receive, _send)
|
||||||
],
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__
|
||||||
"series": [
|
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
|
||||||
{
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
|
||||||
"type": "bar",
|
raise exc
|
||||||
"name": "总人口",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
|
||||||
"legendHoverLink": true,
|
await app(scope, receive, sender)
|
||||||
"data": [],
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 716, in __call__
|
||||||
"realtimeSort": false,
|
await self.middleware_stack(scope, receive, send)
|
||||||
"showBackground": false,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 736, in app
|
||||||
"stack": "stack1",
|
await route.handle(scope, receive, send)
|
||||||
"stackStrategy": "samesign",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 290, in handle
|
||||||
"cursor": "pointer",
|
await self.app(scope, receive, send)
|
||||||
"barMinHeight": 0,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 78, in app
|
||||||
"barCategoryGap": "20%",
|
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
|
||||||
"barGap": "30%",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
|
||||||
"large": false,
|
raise exc
|
||||||
"largeThreshold": 400,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
|
||||||
"seriesLayoutBy": "column",
|
await app(scope, receive, sender)
|
||||||
"datasetIndex": 0,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 75, in app
|
||||||
"clip": true,
|
response = await f(request)
|
||||||
"zlevel": 0,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\routing.py", line 302, in app
|
||||||
"z": 2,
|
raw_response = await run_endpoint_function(
|
||||||
"label": {
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\routing.py", line 213, in run_endpoint_function
|
||||||
"show": false,
|
return await dependant.call(**values)
|
||||||
"margin": 8,
|
File "D:\dsWork\YunNanProject\Controller\BigScreenController.py", line 28, in get_preschool_in_school_chart_config
|
||||||
"valueAnimation": false
|
return RuYuanZaiYuanModel.generate_in_school_education_config()
|
||||||
},
|
File "D:\dsWork\YunNanProject\Model\RuYuanZaiYuanCount.py", line 197, in generate_in_school_education_config
|
||||||
"markLine": {
|
in_school_year_data = yunnan_in_school["education_data"]["preschool"].get(year, {})
|
||||||
"silent": false,
|
KeyError: 'education_data'
|
||||||
"precision": 2,
|
INFO: 127.0.0.1:62715 - "GET /bigscreen/school/preschool/chart HTTP/1.1" 200 OK
|
||||||
"label": {
|
ERROR: Exception in ASGI application
|
||||||
"show": true,
|
Traceback (most recent call last):
|
||||||
"margin": 8,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi
|
||||||
"valueAnimation": false
|
result = await app( # type: ignore[func-returns-value]
|
||||||
},
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__
|
||||||
"data": [
|
return await self.app(scope, receive, send)
|
||||||
{
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\applications.py", line 1054, in __call__
|
||||||
"name": "平均值",
|
await super().__call__(scope, receive, send)
|
||||||
"type": "average"
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\applications.py", line 113, in __call__
|
||||||
}
|
await self.middleware_stack(scope, receive, send)
|
||||||
]
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\errors.py", line 186, in __call__
|
||||||
},
|
raise exc
|
||||||
"rippleEffect": {
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\errors.py", line 164, in __call__
|
||||||
"show": true,
|
await self.app(scope, receive, _send)
|
||||||
"brushType": "stroke",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__
|
||||||
"scale": 2.5,
|
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
|
||||||
"period": 4
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
|
||||||
}
|
raise exc
|
||||||
},
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
|
||||||
{
|
await app(scope, receive, sender)
|
||||||
"type": "bar",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 716, in __call__
|
||||||
"name": "城镇人口",
|
await self.middleware_stack(scope, receive, send)
|
||||||
"legendHoverLink": true,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 736, in app
|
||||||
"data": [],
|
await route.handle(scope, receive, send)
|
||||||
"realtimeSort": false,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 290, in handle
|
||||||
"showBackground": false,
|
await self.app(scope, receive, send)
|
||||||
"stack": "stack1",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 78, in app
|
||||||
"stackStrategy": "samesign",
|
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
|
||||||
"cursor": "pointer",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
|
||||||
"barMinHeight": 0,
|
raise exc
|
||||||
"barCategoryGap": "20%",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
|
||||||
"barGap": "30%",
|
await app(scope, receive, sender)
|
||||||
"large": false,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 75, in app
|
||||||
"largeThreshold": 400,
|
response = await f(request)
|
||||||
"seriesLayoutBy": "column",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\routing.py", line 302, in app
|
||||||
"datasetIndex": 0,
|
raw_response = await run_endpoint_function(
|
||||||
"clip": true,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\routing.py", line 213, in run_endpoint_function
|
||||||
"zlevel": 0,
|
return await dependant.call(**values)
|
||||||
"z": 2,
|
File "D:\dsWork\YunNanProject\Controller\BigScreenController.py", line 28, in get_preschool_in_school_chart_config
|
||||||
"label": {
|
return RuYuanZaiYuanModel.generate_in_school_education_config()
|
||||||
"show": false,
|
File "D:\dsWork\YunNanProject\Model\RuYuanZaiYuanCount.py", line 197, in generate_in_school_education_config
|
||||||
"margin": 8,
|
in_school_year_data = yunnan_in_school["education_data"]["preschool"].get(year, {})
|
||||||
"valueAnimation": false
|
KeyError: 'education_data'
|
||||||
},
|
INFO: 127.0.0.1:62715 - "GET /bigscreen/school/preschool/inschool/chart HTTP/1.1" 500 Internal Server Error
|
||||||
"markLine": {
|
INFO: 127.0.0.1:54014 - "GET /bigscreen/school/preschool/chart HTTP/1.1" 200 OK
|
||||||
"silent": false,
|
INFO: 127.0.0.1:54014 - "GET /bigscreen/school/preschool/inschool/chart HTTP/1.1" 500 Internal Server Error
|
||||||
"precision": 2,
|
ERROR: Exception in ASGI application
|
||||||
"label": {
|
Traceback (most recent call last):
|
||||||
"show": true,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi
|
||||||
"margin": 8,
|
result = await app( # type: ignore[func-returns-value]
|
||||||
"valueAnimation": false
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__
|
||||||
},
|
return await self.app(scope, receive, send)
|
||||||
"data": [
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\applications.py", line 1054, in __call__
|
||||||
{
|
await super().__call__(scope, receive, send)
|
||||||
"name": "平均值",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\applications.py", line 113, in __call__
|
||||||
"type": "average"
|
await self.middleware_stack(scope, receive, send)
|
||||||
}
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\errors.py", line 186, in __call__
|
||||||
]
|
raise exc
|
||||||
},
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\errors.py", line 164, in __call__
|
||||||
"rippleEffect": {
|
await self.app(scope, receive, _send)
|
||||||
"show": true,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__
|
||||||
"brushType": "stroke",
|
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
|
||||||
"scale": 2.5,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
|
||||||
"period": 4
|
raise exc
|
||||||
}
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
|
||||||
},
|
await app(scope, receive, sender)
|
||||||
{
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 716, in __call__
|
||||||
"type": "bar",
|
await self.middleware_stack(scope, receive, send)
|
||||||
"name": "农村人口",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 736, in app
|
||||||
"legendHoverLink": true,
|
await route.handle(scope, receive, send)
|
||||||
"data": [],
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 290, in handle
|
||||||
"realtimeSort": false,
|
await self.app(scope, receive, send)
|
||||||
"showBackground": false,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 78, in app
|
||||||
"stack": "stack1",
|
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
|
||||||
"stackStrategy": "samesign",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
|
||||||
"cursor": "pointer",
|
raise exc
|
||||||
"barMinHeight": 0,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
|
||||||
"barCategoryGap": "20%",
|
await app(scope, receive, sender)
|
||||||
"barGap": "30%",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 75, in app
|
||||||
"large": false,
|
response = await f(request)
|
||||||
"largeThreshold": 400,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\routing.py", line 302, in app
|
||||||
"seriesLayoutBy": "column",
|
raw_response = await run_endpoint_function(
|
||||||
"datasetIndex": 0,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\routing.py", line 213, in run_endpoint_function
|
||||||
"clip": true,
|
return await dependant.call(**values)
|
||||||
"zlevel": 0,
|
File "D:\dsWork\YunNanProject\Controller\BigScreenController.py", line 28, in get_preschool_in_school_chart_config
|
||||||
"z": 2,
|
return RuYuanZaiYuanModel.generate_in_school_education_config()
|
||||||
"label": {
|
File "D:\dsWork\YunNanProject\Model\RuYuanZaiYuanCount.py", line 197, in generate_in_school_education_config
|
||||||
"show": false,
|
in_school_year_data = yunnan_in_school["education_data"]["preschool"].get(year, {})
|
||||||
"margin": 8,
|
KeyError: 'education_data'
|
||||||
"valueAnimation": false
|
INFO: 127.0.0.1:59952 - "GET /bigscreen/school/preschool/chart HTTP/1.1" 200 OK
|
||||||
},
|
INFO: 127.0.0.1:59952 - "GET /bigscreen/school/preschool/inschool/chart HTTP/1.1" 500 Internal Server Error
|
||||||
"markLine": {
|
ERROR: Exception in ASGI application
|
||||||
"silent": false,
|
Traceback (most recent call last):
|
||||||
"precision": 2,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi
|
||||||
"label": {
|
result = await app( # type: ignore[func-returns-value]
|
||||||
"show": true,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__
|
||||||
"margin": 8,
|
return await self.app(scope, receive, send)
|
||||||
"valueAnimation": false
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\applications.py", line 1054, in __call__
|
||||||
},
|
await super().__call__(scope, receive, send)
|
||||||
"data": [
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\applications.py", line 113, in __call__
|
||||||
{
|
await self.middleware_stack(scope, receive, send)
|
||||||
"name": "平均值",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\errors.py", line 186, in __call__
|
||||||
"type": "average"
|
raise exc
|
||||||
}
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\errors.py", line 164, in __call__
|
||||||
]
|
await self.app(scope, receive, _send)
|
||||||
},
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__
|
||||||
"rippleEffect": {
|
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
|
||||||
"show": true,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
|
||||||
"brushType": "stroke",
|
raise exc
|
||||||
"scale": 2.5,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
|
||||||
"period": 4
|
await app(scope, receive, sender)
|
||||||
}
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 716, in __call__
|
||||||
}
|
await self.middleware_stack(scope, receive, send)
|
||||||
],
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 736, in app
|
||||||
"legend": [
|
await route.handle(scope, receive, send)
|
||||||
{
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 290, in handle
|
||||||
"data": [
|
await self.app(scope, receive, send)
|
||||||
"总人口",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 78, in app
|
||||||
"城镇人口",
|
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
|
||||||
"农村人口"
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
|
||||||
],
|
raise exc
|
||||||
"selected": {},
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
|
||||||
"show": true,
|
await app(scope, receive, sender)
|
||||||
"top": "5%",
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\starlette\routing.py", line 75, in app
|
||||||
"padding": 5,
|
response = await f(request)
|
||||||
"itemGap": 10,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\routing.py", line 302, in app
|
||||||
"itemWidth": 25,
|
raw_response = await run_endpoint_function(
|
||||||
"itemHeight": 14,
|
File "C:\Users\Administrator\.conda\envs\yunnan\lib\site-packages\fastapi\routing.py", line 213, in run_endpoint_function
|
||||||
"backgroundColor": "transparent",
|
return await dependant.call(**values)
|
||||||
"borderColor": "#ccc",
|
File "D:\dsWork\YunNanProject\Controller\BigScreenController.py", line 28, in get_preschool_in_school_chart_config
|
||||||
"borderRadius": 0,
|
return RuYuanZaiYuanModel.generate_in_school_education_config()
|
||||||
"pageButtonItemGap": 5,
|
File "D:\dsWork\YunNanProject\Model\RuYuanZaiYuanCount.py", line 197, in generate_in_school_education_config
|
||||||
"pageButtonPosition": "end",
|
in_school_year_data = yunnan_in_school["education_data"]["preschool"].get(year, {})
|
||||||
"pageFormatter": "{current}/{total}",
|
KeyError: 'education_data'
|
||||||
"pageIconColor": "#2f4554",
|
|
||||||
"pageIconInactiveColor": "#aaa",
|
|
||||||
"pageIconSize": 15,
|
|
||||||
"animationDurationUpdate": 800,
|
|
||||||
"selector": false,
|
|
||||||
"selectorPosition": "auto",
|
|
||||||
"selectorItemGap": 7,
|
|
||||||
"selectorButtonGap": 10
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"tooltip": {
|
|
||||||
"show": true,
|
|
||||||
"trigger": "axis",
|
|
||||||
"triggerOn": "mousemove|click",
|
|
||||||
"axisPointer": {
|
|
||||||
"type": "shadow"
|
|
||||||
},
|
|
||||||
"showContent": true,
|
|
||||||
"alwaysShowContent": false,
|
|
||||||
"showDelay": 0,
|
|
||||||
"hideDelay": 100,
|
|
||||||
"enterable": false,
|
|
||||||
"confine": false,
|
|
||||||
"appendToBody": false,
|
|
||||||
"transitionDuration": 0.4,
|
|
||||||
"textStyle": {
|
|
||||||
"fontSize": 14
|
|
||||||
},
|
|
||||||
"borderWidth": 0,
|
|
||||||
"padding": 5,
|
|
||||||
"order": "seriesAsc"
|
|
||||||
},
|
|
||||||
"xAxis": [
|
|
||||||
{
|
|
||||||
"show": true,
|
|
||||||
"scale": false,
|
|
||||||
"nameLocation": "end",
|
|
||||||
"nameGap": 15,
|
|
||||||
"gridIndex": 0,
|
|
||||||
"axisLabel": {
|
|
||||||
"show": true,
|
|
||||||
"rotate": 45,
|
|
||||||
"margin": 8,
|
|
||||||
"valueAnimation": false
|
|
||||||
},
|
|
||||||
"inverse": false,
|
|
||||||
"offset": 0,
|
|
||||||
"splitNumber": 5,
|
|
||||||
"minInterval": 0,
|
|
||||||
"splitLine": {
|
|
||||||
"show": true,
|
|
||||||
"lineStyle": {
|
|
||||||
"show": true,
|
|
||||||
"width": 1,
|
|
||||||
"opacity": 1,
|
|
||||||
"curveness": 0,
|
|
||||||
"type": "solid"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"animation": true,
|
|
||||||
"animationThreshold": 2000,
|
|
||||||
"animationDuration": 1000,
|
|
||||||
"animationEasing": "cubicOut",
|
|
||||||
"animationDelay": 0,
|
|
||||||
"animationDurationUpdate": 300,
|
|
||||||
"animationEasingUpdate": "cubicOut",
|
|
||||||
"animationDelayUpdate": 0,
|
|
||||||
"data": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"yAxis": [
|
|
||||||
{
|
|
||||||
"name": "人口数量(万人)",
|
|
||||||
"show": true,
|
|
||||||
"scale": false,
|
|
||||||
"nameLocation": "middle",
|
|
||||||
"nameGap": 40,
|
|
||||||
"gridIndex": 0,
|
|
||||||
"inverse": false,
|
|
||||||
"offset": 0,
|
|
||||||
"splitNumber": 5,
|
|
||||||
"minInterval": 0,
|
|
||||||
"splitLine": {
|
|
||||||
"show": true,
|
|
||||||
"lineStyle": {
|
|
||||||
"show": true,
|
|
||||||
"width": 1,
|
|
||||||
"opacity": 1,
|
|
||||||
"curveness": 0,
|
|
||||||
"type": "solid"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"animation": true,
|
|
||||||
"animationThreshold": 2000,
|
|
||||||
"animationDuration": 1000,
|
|
||||||
"animationEasing": "cubicOut",
|
|
||||||
"animationDelay": 0,
|
|
||||||
"animationDurationUpdate": 300,
|
|
||||||
"animationEasingUpdate": "cubicOut",
|
|
||||||
"animationDelayUpdate": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"title": [
|
|
||||||
{
|
|
||||||
"show": true,
|
|
||||||
"text": "云南省各州市人口分布图(2024年)",
|
|
||||||
"target": "blank",
|
|
||||||
"subtarget": "blank",
|
|
||||||
"padding": 5,
|
|
||||||
"itemGap": 10,
|
|
||||||
"textAlign": "auto",
|
|
||||||
"textVerticalAlign": "auto",
|
|
||||||
"triggerEvent": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dataZoom": [
|
|
||||||
{
|
|
||||||
"show": true,
|
|
||||||
"type": "slider",
|
|
||||||
"showDetail": true,
|
|
||||||
"showDataShadow": true,
|
|
||||||
"realtime": true,
|
|
||||||
"start": 20,
|
|
||||||
"end": 80,
|
|
||||||
"orient": "horizontal",
|
|
||||||
"zoomLock": false,
|
|
||||||
"filterMode": "filter"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@@ -51,11 +51,7 @@ class RuYuanZaiYuanModel:
|
|||||||
# 计算总和作为总入园数,而非使用文件中的total字段
|
# 计算总和作为总入园数,而非使用文件中的total字段
|
||||||
calculated_total = enroll_data.get("urban", 0) + enroll_data.get("town", 0) + enroll_data.get("rural", 0)
|
calculated_total = enroll_data.get("urban", 0) + enroll_data.get("town", 0) + enroll_data.get("rural", 0)
|
||||||
total_enroll.append(calculated_total / 10000) # 转换为万人
|
total_enroll.append(calculated_total / 10000) # 转换为万人
|
||||||
# print(f"{year}年城区入园数: {enroll_data.get('urban', 0)}")
|
|
||||||
# print(f"{year}年镇区入园数: {enroll_data.get('town', 0)}")
|
|
||||||
# print(f"{year}年乡村入园数: {enroll_data.get('rural', 0)}")
|
|
||||||
# print(f"{year}年入园数: {calculated_total}")
|
|
||||||
|
|
||||||
# 构建ECharts配置
|
# 构建ECharts配置
|
||||||
option = {
|
option = {
|
||||||
# "title": {
|
# "title": {
|
||||||
@@ -109,7 +105,7 @@ class RuYuanZaiYuanModel:
|
|||||||
"type": "value",
|
"type": "value",
|
||||||
"name": "总入园数",
|
"name": "总入园数",
|
||||||
"min": 0,
|
"min": 0,
|
||||||
"max": 140, # 增加最大值以留出更多空间
|
"max": 140,
|
||||||
"interval": 20,
|
"interval": 20,
|
||||||
"position": "right",
|
"position": "right",
|
||||||
"nameLocation": "end", # 将名称放在轴末端
|
"nameLocation": "end", # 将名称放在轴末端
|
||||||
@@ -175,4 +171,150 @@ class RuYuanZaiYuanModel:
|
|||||||
"containLabel": True
|
"containLabel": True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return option
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def generate_in_school_education_config():
|
||||||
|
# 获取学前教育相关数据
|
||||||
|
enrollment_data, in_school_data = RuYuanZaiYuanModel.load_student_data()
|
||||||
|
|
||||||
|
# 提取云南省级数据
|
||||||
|
yunnan_in_school = next((item for item in in_school_data if item["area_name"] == "云南省"), None)
|
||||||
|
|
||||||
|
if not yunnan_in_school:
|
||||||
|
return {}
|
||||||
|
|
||||||
|
# 提取年份数据(2015-2024)
|
||||||
|
years = [str(year) for year in range(2015, 2025)]
|
||||||
|
|
||||||
|
# 构建学前教育数据
|
||||||
|
urban_data = [] # 城区数据
|
||||||
|
town_data = [] # 镇区数据
|
||||||
|
rural_data = [] # 乡村数据
|
||||||
|
total_in_school = [] # 总在园数
|
||||||
|
|
||||||
|
for year in years:
|
||||||
|
# 将education_data改为student_data
|
||||||
|
in_school_year_data = yunnan_in_school["student_data"]["preschool"].get(year, {})
|
||||||
|
urban_data.append(in_school_year_data.get("urban", 0) / 10000) # 转换为万人
|
||||||
|
town_data.append(in_school_year_data.get("town", 0) / 10000) # 转换为万人
|
||||||
|
rural_data.append(in_school_year_data.get("rural", 0) / 10000) # 转换为万人
|
||||||
|
# 计算总和作为总在园数
|
||||||
|
calculated_total = in_school_year_data.get("urban", 0) + in_school_year_data.get("town", 0) + in_school_year_data.get("rural", 0)
|
||||||
|
total_in_school.append(calculated_total / 10000) # 转换为万人
|
||||||
|
|
||||||
|
# 构建ECharts配置
|
||||||
|
option = {
|
||||||
|
"tooltip": {
|
||||||
|
"trigger": "axis",
|
||||||
|
"axisPointer": {
|
||||||
|
"type": "cross",
|
||||||
|
"crossStyle": {"color": "#999"}
|
||||||
|
},
|
||||||
|
"textStyle": {"color": "#333"},
|
||||||
|
"backgroundColor": "rgba(255, 255, 255, 0.8)",
|
||||||
|
"borderColor": "rgba(0, 0, 0, 0.2)",
|
||||||
|
"borderWidth": 1
|
||||||
|
},
|
||||||
|
"legend": {
|
||||||
|
"data": ["城区", "镇区", "乡村", "总在园数"],
|
||||||
|
"top": 30,
|
||||||
|
"textStyle": {"color": "#333"},
|
||||||
|
"icon": "roundRect",
|
||||||
|
"itemWidth": 12,
|
||||||
|
"itemHeight": 12
|
||||||
|
},
|
||||||
|
"xAxis": [
|
||||||
|
{
|
||||||
|
"type": "category",
|
||||||
|
"data": years,
|
||||||
|
"axisPointer": {"type": "shadow"},
|
||||||
|
"axisLabel": {"color": "#333"},
|
||||||
|
"axisLine": {"lineStyle": {"color": "#333"}}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"yAxis": [
|
||||||
|
{
|
||||||
|
"type": "value",
|
||||||
|
"name": "人数",
|
||||||
|
"min": 0,
|
||||||
|
"max": 100,
|
||||||
|
"interval": 20,
|
||||||
|
"axisLabel": {
|
||||||
|
"formatter": "{value} 万人",
|
||||||
|
"color": "#333"
|
||||||
|
},
|
||||||
|
"axisLine": {"lineStyle": {"color": "#333"}},
|
||||||
|
"splitLine": {"lineStyle": {"color": "rgba(0,0,0,0.1)"}}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "value",
|
||||||
|
"name": "总在园数",
|
||||||
|
"min": 0,
|
||||||
|
"max": 140,
|
||||||
|
"interval": 20,
|
||||||
|
"position": "right",
|
||||||
|
"nameLocation": "end",
|
||||||
|
"nameGap": 30,
|
||||||
|
"axisLabel": {
|
||||||
|
"formatter": "{value} 万人",
|
||||||
|
"color": "#ee6666"
|
||||||
|
},
|
||||||
|
"axisLine": {"show": True, "lineStyle": {"color": "#ee6666"}},
|
||||||
|
"axisTick": {"show": True},
|
||||||
|
"splitLine": {"show": False}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"series": [
|
||||||
|
{
|
||||||
|
"name": "城区",
|
||||||
|
"type": "bar",
|
||||||
|
"data": urban_data,
|
||||||
|
"itemStyle": {
|
||||||
|
"color": "#5470c6",
|
||||||
|
"borderRadius": [6, 6, 0, 0]
|
||||||
|
},
|
||||||
|
"barWidth": "25%",
|
||||||
|
"barGap": "-10%"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "镇区",
|
||||||
|
"type": "bar",
|
||||||
|
"data": town_data,
|
||||||
|
"itemStyle": {
|
||||||
|
"color": "#91cc75",
|
||||||
|
"borderRadius": [6, 6, 0, 0]
|
||||||
|
},
|
||||||
|
"barWidth": "25%",
|
||||||
|
"barGap": "-10%"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "乡村",
|
||||||
|
"type": "bar",
|
||||||
|
"data": rural_data,
|
||||||
|
"itemStyle": {
|
||||||
|
"color": "#fac858",
|
||||||
|
"borderRadius": [6, 6, 0, 0]
|
||||||
|
},
|
||||||
|
"barWidth": "25%",
|
||||||
|
"barGap": "-10%"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "总在园数",
|
||||||
|
"type": "line",
|
||||||
|
"yAxisIndex": 1,
|
||||||
|
"data": total_in_school,
|
||||||
|
"lineStyle": {"color": "#ee6666", "width": 3},
|
||||||
|
"symbol": "circle",
|
||||||
|
"symbolSize": 8,
|
||||||
|
"itemStyle": {"color": "#ee6666"}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"grid": {
|
||||||
|
"left": "3%",
|
||||||
|
"right": "8%",
|
||||||
|
"bottom": "3%",
|
||||||
|
"containLabel": True
|
||||||
|
}
|
||||||
|
}
|
||||||
return option
|
return option
|
Binary file not shown.
2
Start.py
2
Start.py
@@ -17,4 +17,4 @@ app.include_router(bigscreen_router)
|
|||||||
# 主程序入口
|
# 主程序入口
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# 启动 FastAPI 应用,监听 8200 端口
|
# 启动 FastAPI 应用,监听 8200 端口
|
||||||
uvicorn.run(app, host="0.0.0.0", port=8200)
|
uvicorn.run(app, host="0.0.0.0", port=8100)
|
@@ -95,7 +95,13 @@
|
|||||||
// 加载学前教育数据
|
// 加载学前教育数据
|
||||||
function loadPreschoolData() {
|
function loadPreschoolData() {
|
||||||
showLoading();
|
showLoading();
|
||||||
$.getJSON('/bigscreen/school/preschool/chart')
|
|
||||||
|
// 根据当前类型加载不同数据
|
||||||
|
var url = currentType === 'enroll' ?
|
||||||
|
'/bigscreen/school/preschool/chart' :
|
||||||
|
'/bigscreen/school/preschool/inschool/chart';
|
||||||
|
|
||||||
|
$.getJSON(url)
|
||||||
.done(function(data) {
|
.done(function(data) {
|
||||||
chartData = data;
|
chartData = data;
|
||||||
renderChart();
|
renderChart();
|
||||||
@@ -116,7 +122,7 @@
|
|||||||
$('.btn').removeClass('active');
|
$('.btn').removeClass('active');
|
||||||
$(this).addClass('active');
|
$(this).addClass('active');
|
||||||
currentType = $(this).data('type');
|
currentType = $(this).data('type');
|
||||||
renderChart();
|
loadPreschoolData(); // 点击按钮后重新加载数据,而不是只渲染
|
||||||
});
|
});
|
||||||
|
|
||||||
// 窗口大小变化时调整图表
|
// 窗口大小变化时调整图表
|
||||||
|
Reference in New Issue
Block a user