/// <summary>
        /// 创建图表
        /// </summary>
        /// <param name="chartEx"></param>
        private static void CreateBarChart(BarChartEx chartEx)
        {
            foreach (var item in chartEx.dataSource)
            {
                System.Reflection.PropertyInfo[] properties = item.GetType().GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public);
                dynamic xValue = 0, yValue = 0;

                xValue = item.GetType().GetProperty(chartEx.XValuePath).GetValue(item);
                yValue = item.GetType().GetProperty(chartEx.YValuePath).GetValue(item);

                var bar = chartEx.GetBar(yValue, xValue);
                bar.Height = chartEx._Content.Height;
                chartEx._Content.Children.Add(bar);
            }
        }
        /// <summary>
        /// 创建图表
        /// </summary>
        /// <param name="chartEx"></param>
        private static void CreateBarChart(BarChartEx chartEx)
        {
            foreach (var item in chartEx.dataSource)
            {
                dynamic xValue = 0, yValue = 0;

                //通过映射获取数据集中的值
                xValue = item.GetType().GetProperty(chartEx.XValuePath).GetValue(item);
                yValue = item.GetType().GetProperty(chartEx.YValuePath).GetValue(item);

                var bar = chartEx.GetBar(yValue, xValue);
                bar.Height = chartEx._Content.Height;
                chartEx._Content.Children.Add(bar);
            }
        }
 /// <summary>
 /// 计算Y的数据值和条图高像素设置的比例
 /// </summary>
 /// <param name="chartEx"></param>
 private static void Calulate_Data2Height_Value(BarChartEx chartEx)
 {
     if (chartEx.dataSource != null)
     {
         double maxValue = 0;
         //遍历取得数据源中最大的Y值
         foreach (var item in chartEx.dataSource)
         {
             dynamic temp = item.GetType().GetProperty(chartEx.YValuePath).GetValue(item);
             try
             {
                 double flag = temp;
                 maxValue = maxValue > flag ? maxValue : flag;
             }
             catch (Exception)
             {
                 MessageBox.Show("Y数据类型错误");
             }
         }
         //将条图区域的高和Y值的比例作为换算比例
         //50在这用作Y数据Text和X轴数据Text的控件高总和的估值 (暂时没必要精确)
         chartEx._data2BarHeight = int.Parse(((chartEx._Content.ActualHeight - 50) / maxValue).ToString());
     }
 }