WPF柱状统计图

WPF柱状统计图_第1张图片

引用的dll: LiveCharts.Wpf.dll   LiveCharts.dll  Arthas.dll

下载地址:https://download.csdn.net/download/m0_37137902/12560883

界面代码:

  xmlns:Metro="clr-namespace:Arthas.Controls.Metro;assembly=Arthas"
      xmlns:ms="clr-namespace:Mindscape.WpfElements.Charting;assembly=Mindscape.WpfElements"
      xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"

                    
                        
                            
                        
                        
                    
                    
                        
                            
                            
                        
                        
                            
                        
                        
                            
                                
                                
                            
                            
                                

                                

                                
                            
                            
                                
                                    
                                    
                                    
                                
                                
                                    
                                        
                                            
                                        
                                    
                                
                            
                        
                        
                            
                                
                                    
                                    
                                
                            
                        
                    
                

后台赋值:

  var boyvals = new List();
                var grilvals = new List();
                var allvals = new List();

                foreach (var item in dicXySex)
                {
                    boyvals.Add(item.Value[0]);
                    grilvals.Add(item.Value[1]);
                    allvals.Add(item.Value[2]);
                }


                colBoy.Values = new ChartValues(boyvals);
                colgril.Values = new ChartValues(grilvals);
                colAll.Values = new ChartValues(allvals);

 

你可能感兴趣的:(WPF)