private void FlexChartDateTimeFilter_GroupByChanged(object sender, EventArgs e)
 {
     if (UseCustomGroups)
     {
         var customGroups = new GroupByEventArgs();
         GroupByChanged?.Invoke(this, customGroups);
         items = customGroups.ItemsSource == null ? source : customGroups.ItemsSource;
         dtFilterView.ChangeDataSource(items, customGroups.BindingX, customGroups.Binding);
     }
     else
     {
         GroupByChanged?.Invoke(this, null);
         UpdateView();
     }
 }
        private void CustomDtFilter_GroupByChangedChanged(object sender, GroupByEventArgs e)
        {
            var dtFilter = sender as FlexChartDateTimeFilter;

            switch (dtFilter.GroupBy)
            {
            case DateTimeGroupOption.ShowAll:
                e.BindingX = "Date";
                dtFilter.ShowRangeSlider = true;
                break;

            case DateTimeGroupOption.Yearly:
                e.BindingX               = "XValue";
                e.ItemsSource            = GetGroupByYear(dtFilter);
                dtFilter.ShowRangeSlider = false;
                break;

            case DateTimeGroupOption.Quarterly:
                e.BindingX               = "XValue";
                e.ItemsSource            = GetGroupByQuarter(dtFilter);
                dtFilter.ShowRangeSlider = false;
                break;

            case DateTimeGroupOption.Monthly:
                e.BindingX               = "XValue";
                e.ItemsSource            = GetGroupByMonth(dtFilter);
                dtFilter.ShowRangeSlider = true;
                break;

            case DateTimeGroupOption.Weekly:
                e.BindingX               = "XValue";
                e.ItemsSource            = GetGroupByWeek(dtFilter);
                dtFilter.ShowRangeSlider = true;
                break;
            }
        }