Json 修改为下面的,一个月是一个json对象,里面的再有每个医院的值
- data = '{"stateCode":0,"stateMsg":"请求(或处理)成功","recordCount":"28","pageMaxNo":"3","list":[{"Month":"1月","玉田县医院":"2584","江南区医院":"8384","江北区医院":"5884","江东区医院":"6884"},{"Month":"2月","玉田县医院":"2584","江南区医院":"8384","江北区医院":"5884","江东区医院":"6884"},{"Month":"3月","玉田县医院":"2584","江南区医院":"8384","江北区医院":"5884","江东区医院":"6884"},{"Month":"4月","玉田县医院":"2584","江南区医院":"8384","江北区医院":"5884","江东区医院":"6884"}]}';
复制代码
然后绑定的代码修改为下面的,BindingX需要是月份,然后才能X轴显示月份
- @(Html.C1().FlexChart().Id("gettingStartedChart")
- .BindingX("Month").Series(sers =>
- {
- sers.Add().Binding("玉田县医院").Name("玉田县医院");
- sers.Add().Binding("江南区医院").Name("江南区医院");
- sers.Add().Binding("江北区医院").Name("江北区医院");
- sers.Add().Binding("江东区医院").Name("江东区医院");
- })
- )
复制代码
|