问题描述
求个动态加载的柱图和曲线图的例子,谢谢。100分求好心人.
解决方案
解决方案二:
http://blog.csdn.net/zhengzhichen/article/details/6614600ASP.NET中动态获取数据使用Highcharts图表控件
解决方案三:
其中的DataTabledt修改为你的数据库的数据就可
解决方案四:
series:[{type:'spline',name:'人数',marker:{symbol:'url(images/02.png)'},data:<%=returnValue%>,yAxis:0,color:'#FF9C23'},{type:'column',name:'分数',data:<%=returnValue1%>,yAxis:1,color:'#FFFFFF'}] 这样有曲线与柱状图
解决方案五:
去看我之前做过项目的一例子吧,,,http://blog.csdn.net/make1828/article/details/41745513
解决方案六:
去看我之前做过项目的一例子吧,,,http://blog.csdn.net/make1828/article/details/41745513
解决方案七:
前端参考代码:<scripttype="text/javascript">functionshowSale(startTime,endTime){varsaleChart;$("#Loading").show();varoptions={chart:{renderTo:'containerSale',type:'column'},title:{text:'各销售团队销售量'},subtitle:{text:'--数据为各团队成员销售量的总和'},xAxis:{categories:[]},yAxis:{min:0,title:{text:'单位(单)'}},legend:{layout:'vertical',backgroundColor:'#FFFFFF',align:'left',verticalAlign:'top',x:100,y:70,floating:true,shadow:true},tooltip:{formatter:function(){return''+this.x+':'+this.y+'单';}},plotOptions:{column:{pointPadding:0.2,borderWidth:0}},series:[]};//读取部门数据$.ajax({type:"POST",url:"/Tool/GetBusinessDept",success:function(msg){dept=[];$.each(msg,function(i,d){dept.push([d.DeptName]);});options.xAxis.categories=dept;//读取销售数据$.ajax({type:"POST",url:"/Tool/GetSaleByDept",data:{startTime:startTime,endTime:endTime},success:function(result){varseries={name:'销售量',data:[]};$.each(result,function(itemNo,item){series.data.push(item.SaleCount);});options.series.push(series);saleChart=newHighcharts.Chart(options);$("#Loading").hide();}});}});}</script><divid="containerSale"style="min-width:100%;height:400px;margin:0auto;"></div><divid="Loading"style="position:absolute;z-index:100;top:300px;left:431.5px;display:none;height:25px;"><tablecellspacing="0"cellpadding="0"border="1"width="215"style="font-family:Arial;background-color:#ffff99"><tbody><tr><td><palign="center"><imgborder="0"src="../../Content/loading.gif"alt=""/><br/><fontcolor="Red">读取数据…</font></p></td></tr></tbody></table></div>
后端参考代码:[HttpPost]publicActionResultGetSaleByDept(stringstartTime,stringendTime){List<ListSaleByDept>listSaleCountByDept=newList<ListSaleByDept>();DateTimestart=System.DateTime.Now;DateTimeend=System.DateTime.Now;if(startTime!=""&&endTime!=""){start=DateTime.Parse(startTime);end=DateTime.Parse(endTime);}stringpid=IDepartmentsR.Departments.FirstOrDefault(x=>x.DeptName=="业务部").ID.ToString();varqueryDept=IDepartmentsR.Departments.Where(x=>x.ParentID==pid).OrderByDescending(x=>x.CreateTime).ToList();foreach(varitemDeptinqueryDept){intsaleCount=0;vardeptUsers=IUsersR.Users.Where(x=>x.Department.DeptName==itemDept.DeptName&&x.UserState=="在职").ToList();foreach(varitemUserindeptUsers){varqueryItem=ISaleItemLogR.SaleItemLogs.ToList();List<SaleLog>querySale=newList<SaleLog>();if(startTime!=""&&endTime!=""){querySale=ISaleLogR.SaleLogs.Where(x=>x.LadingBillType!="减工号"&&x.LadingBillType!="转白银").Where(x=>x.LadingBillPeople==itemUser.UserName).Where(x=>x.LadingBillDate>=start&&x.LadingBillDate<end).ToList();}else{querySale=ISaleLogR.SaleLogs.Where(x=>x.LadingBillType!="减工号"&&x.LadingBillType!="转白银").Where(x=>x.LadingBillPeople==itemUser.UserName).ToList();}intquery=(fromqinquerySalejoinsinqueryItemonq.IDequalss.saleLog.IDselectnew{UserName=q.LadingBillPeople,ActualIntegral=s.ActualIntegral}).ToList().Count();saleCount+=query;}ListSaleByDeptm=newListSaleByDept();m.DeptName=itemDept.DeptName;m.SaleCount=saleCount;listSaleCountByDept.Add(m);}returnJson(listSaleCountByDept);}[HttpPost]publicActionResultGetBusinessDept(){stringpid=IDepartmentsR.Departments.FirstOrDefault(x=>x.DeptName=="业务部").ID.ToString();varqueryDept=IDepartmentsR.Departments.Where(x=>x.ParentID==pid).OrderByDescending(x=>x.CreateTime).ToList();List<ListBusinessDept>listBusinessDept=newList<ListBusinessDept>();foreach(variteminqueryDept){ListBusinessDeptm=newListBusinessDept();m.DeptName=item.DeptName;listBusinessDept.Add(m);}returnJson(listBusinessDept);}
解决方案八:
基础百度图表开发的Echarts有图有真像
解决方案:
友情帮顶,做个记号
解决方案:
引用7楼kongwei521的回复:
基础百度图表开发的Echarts有图有真像
头像是本人和女朋友吗,