data_x = ['交通运输','传媒','公用事业','农林牧渔','医药生物','商贸零售','国防军工','基础化工','家用电器','建筑材料','建筑装饰','房地产',"有色金属",'机械设备','汽车','煤炭','环保','电力设备','电子','石油石化','社会服务','纺织服饰','综合','美容护理','计算机','轻工制造','通信','钢铁','银行','非银金融','食品饮料']
data_y = [-13.82183,-3.729319,-1.477519,-1.591932,5.814713,-0.814032,-3.012844,-11.14995,-0.1117546,-6.742334,10.4521,-17.26782,-17.71696,9.208321,19.97887,3.898234,0.06728736,20.35393,-26.27193,-1.402413,-0.5946488,1.053912,0.02353604,-3.306619,-4.391807,-0.8792794,-1.16261,4.724177,-120.1028,-19.63006,-18.96372]
data_y_1 = [-2.49,-4.38,-0.48,-3.56,-4.06,-3.83,-2.22,-3.81,-2.35,-4.79,-1.47,-6.07,-5.91,-1.91,-0.88,-5.64,-0.39,1.15,-4.81,-2.85,-2.42,-4.88,-3.12,-1.35,-5.01,-4.60,0.02,-4.78,-7.17,-5.08,-2.95]
df = pd.DataFrame()
df["name"] = data_x
df["行业净流入总计"] = data_y
df["区间涨跌幅"] = data_y_1
options = {
'chart': {
'zoomType': 'xy'
},
'title': {
'text': '行业涨幅与净流入'
},
'xAxis': [{
'categories':data_x
}],
'yAxis': [{
'labels': {
'format': '{value} °C',
'style': {
'color': "Highcharts.getOptions().colors[1]"
}
},
'title': {
'text': '温度',
'style': {
'color': "Highcharts.getOptions().colors[1]" # 通过设置color配置改变数据颜色Highcharts.getOptions().colors 参考文档:https://www.highcharts.com.cn/docs/basic-color
}
}
}, {
'title': {
'text': '降水',
'style': {
'color': "Highcharts.getOptions().colors[0]" # 通过设置color配置改变数据颜色Highcharts.getOptions().colors 参考文档:https://www.highcharts.com.cn/docs/basic-color
}
},
'labels': {
'format': '{value} mm',
'style': {
'color': "Highcharts.getOptions().colors[0]"
}
},
'opposite': 'true'
}],
'tooltip': {
'shared': 'true'
},
'series': [{
'name': '行业净流入总计',
'type': 'column',
'yAxis': 1,
'data': data_y,
}, {
'name': '区间涨跌幅',
'type': 'spline',
'data': data_y_1,
# }
}]
}
T.plot(df,options=options)