我要像把六个数据分别放进这个柱状图,但我数据库里面没有横坐标这几个id,所以我要用到过滤器,转换一下json接收格式
下面是我的sql语句
接下来我要在过滤器选项加入下面的语句就能解决问题
return data.flatMap((item, index) => ([{
"x": "国联证券",
"y": item.guolianTradeVolume.toString()
},
{
"x": "通达信",
"y": item.tongdaxinTradeVolume.toString()
},
{
"x": "长城证券",
"y": item.changchengTradeVolume.toString()
},
{
"x": "国泰君安证券",
"y": item.guotaijunanTradeVolume.toString()
},
{
"x": "银河证券",
"y": item.yinheTradeVolume.toString()
},
{
"x": "同花顺",
"y": item.tonghuashunTradeVolume.toString()
}
]))