springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-19 14:12:36
117
我是HTML和JavaScript的新手。我正试图用我的数据文件填充下拉列表,并做一个饼图。我的js数据如下所示:
const businessData =
[ { '\ufeffbusiness_id': 'y2gFcAVBXmVxFXAugRe5ig'
, name : 'Scrumptious Crumpets'
, address : '7414 SE Milwaukie Ave'
, city : 'Portland'
, state : 'OR'
, latitude : '45.47107'
, longitude : '-122.64827'
, stars : '5'
, review_count : '23'
, is_open : '0'
, category : 'Coffee & Tea'
, attr_key : 'restaurantspricerange2'
, attr_value : '1'
}
下面是我的下拉列表:
const businessData =
[ { '\ufeffbusiness_id': 'y2gFcAVBXmVxFXAugRe5ig'
, name : 'Scrumptious Crumpets'
, address : '7414 SE Milwaukie Ave'
, city : 'Portland'
, state : 'OR'
, latitude : '45.47107'
, longitude : '-122.64827'
, stars : '5'
, review_count : '23'
, is_open : '0'
, category : 'Coffee & Tea'
, attr_key : 'restaurantspricerange2'
, attr_value : '1'
}
我想创建一个下拉菜单,它允许我从多个状态中选择数据,并将该状态中的数据绘制成图形。到目前为止,我只能通过一次硬编码一个状态来使图工作。
我如何将数据取到我的下拉列表中,这样它就像... 如果选择CA,则显示CA饼图。如果选择OR,则显示或饼图等..
const businessData =
[ { '\ufeffbusiness_id': 'y2gFcAVBXmVxFXAugRe5ig'
, name : 'Scrumptious Crumpets'
, address : '7414 SE Milwaukie Ave'
, city : 'Portland'
, state : 'OR'
, latitude : '45.47107'
, longitude : '-122.64827'
, stars : '5'
, review_count : '23'
, is_open : '0'
, category : 'Coffee & Tea'
, attr_key : 'restaurantspricerange2'
, attr_value : '1'
}
顺晟科技:
开始...
作为答案的补充,您可以创建一个函数来更新图表,如下所示。
在HTML中
const businessData =
[ { '\ufeffbusiness_id': 'y2gFcAVBXmVxFXAugRe5ig'
, name : 'Scrumptious Crumpets'
, address : '7414 SE Milwaukie Ave'
, city : 'Portland'
, state : 'OR'
, latitude : '45.47107'
, longitude : '-122.64827'
, stars : '5'
, review_count : '23'
, is_open : '0'
, category : 'Coffee & Tea'
, attr_key : 'restaurantspricerange2'
, attr_value : '1'
}
然后在script.js中
const businessData =
[ { '\ufeffbusiness_id': 'y2gFcAVBXmVxFXAugRe5ig'
, name : 'Scrumptious Crumpets'
, address : '7414 SE Milwaukie Ave'
, city : 'Portland'
, state : 'OR'
, latitude : '45.47107'
, longitude : '-122.64827'
, stars : '5'
, review_count : '23'
, is_open : '0'
, category : 'Coffee & Tea'
, attr_key : 'restaurantspricerange2'
, attr_value : '1'
}
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11