public async Task HandlePointOnclick(IPointEventArgs args)
        {
            //if (this.Widget.AllowFiltrationSource == false)
            //	return;

            var series   = this.ReportChartData.Series[(int)args.SeriesIndex];
            var category = series.Name;
            ReportSeriesChartDataItem currentData = series.Data[(int)args.PointIndex];

            var data = this.DashboardVm.ObtainFilterGroup(this.Widget);

            bool didModify = false;

            if (this.Widget.AllowFiltrationSource_TextCategory)
            {
                var filters = new string[] { category.ToUpper() };
                if (data.FilterLabels == null)
                {
                    data.FilterLabels = filters;
                }
                else
                {
                    data.FilterLabels = data.FilterLabels.Concat(filters).Distinct().ToArray();
                }

                data.FilterTarget = ReportFilterInstruction.Targets.Column;

                didModify = true;
            }

            if (this.Widget.AllowFiltrationSource_DateTime && series.Data.Count > 1)
            {
                didModify = true;

                data.StartTime = currentData.StartTime;
                data.EndTime   = currentData.EndTime;

                //if (series.Data.Count == args.PointIndex + 1)
                //{// Last one
                //	var prevData = series.Data[(int)args.PointIndex - 1];

                //	var delta = currentData.DatePosition - prevData.DatePosition;

                //	data.StartTime = currentData.DatePosition;
                //	data.EndTime = currentData.DatePosition + delta;

                //	didModify = true;
                //}
                //else
                //{// First or a middle one.
                //	var nextData = series.Data[(int)args.PointIndex + 1];

                //	data.StartTime = currentData.DatePosition;
                //	data.EndTime = nextData.DatePosition;

                //	didModify = true;
                //}
            }

            if (didModify && data.AllowDynamicFiltration)
            {
                await this.DashboardVm.UpdateDynamicWidgetsFilteringAsync();
            }
        }
        ReportChartData LoadReportChartData(Report report,
                                            string[] includeCategoryFilters,
                                            string[] excludeCategoryFilters,
                                            bool toUpper = false)
        {
            var result = new ReportChartData();

            if (report == null)
            {
                return(result);
            }

            try
            {
                if (report.ColumnsDefinitions == null)
                {
                    return(result);
                }

                var columns = report.ColumnsDefinitions;
                var rowData = report.Rows;

                var resultCategoryRange = new List <string>();

                for (var columnIndex = 0; columnIndex < columns.Length; columnIndex++)
                {
                    var columnTemplate = columns[columnIndex];
                    var columnTitle    = columnTemplate.Title;

                    if (includeCategoryFilters?.Any() == true && !includeCategoryFilters.Contains(columnTitle))
                    {
                        continue;
                    }

                    if (excludeCategoryFilters?.Any() == true && excludeCategoryFilters.Contains(columnTitle))
                    {
                        continue;
                    }

                    if (toUpper)
                    {
                        columnTitle = columnTitle.ToUpper();
                    }

                    var chartSeries    = new ReportSeriesChartData();
                    var existingSeries = result.Series.FirstOrDefault(it => it.Name == columnTitle);

                    if (existingSeries != null)
                    {
                        chartSeries = existingSeries;
                    }
                    else
                    {
                        chartSeries.Name = columnTitle;
                        resultCategoryRange.Add(columnTitle);
                    }

                    for (var rowIndex = 0; rowIndex < rowData.Length; rowIndex++)
                    {
                        var row = rowData[rowIndex];

                        var label = report.RowsDefinitions[rowIndex].Title;
                        if (string.IsNullOrWhiteSpace(label))
                        {
                            label = row.Template.Title;
                        }

                        var cell = row.Cells[columnIndex];
                        var data = cell.Values.FirstOrDefault();

                        ReportSeriesChartDataItem chartItem = null;
                        var existingChartItem = chartSeries.Data.FirstOrDefault(it => it.Label == label);
                        if (chartItem == null)
                        {
                            chartItem = new ReportSeriesChartDataItem
                            {
                                CategoryName = columnTitle,
                                Value        = FormatData(data),
                                Label        = label,

                                RowTemplate    = row.Template,
                                ColumnTemplate = columnTemplate,

                                Cell = cell,
                            };

                            if (result.IsDateAxis)
                            {
                                try
                                {
                                    result.IsDateAxis = row.Template?.StartDateTime.HasValue == true;

                                    //var position = Report.ParseTimePosition(label);
                                    //if (!position.HasValue)
                                    //{
                                    //	result.IsDateAxis = false;
                                    //}
                                    //else
                                    //{
                                    //	chartItem.DatePosition = position.Value;
                                    //	chartItem.StreamPosition = Report.ParseStreamPosition(label);
                                    //}
                                }
                                catch (Exception ex)
                                {
                                    result.IsDateAxis = false;
                                }
                            }

                            chartSeries.Data.Add(chartItem);
                        }
                        else
                        {
                            chartItem.Value += Convert.ToUInt16(data.ToString());
                        }
                    }

                    result.AddCategoryRange(resultCategoryRange.ToArray());
                    result.Series.Add(chartSeries);
                }
            }
            catch (Exception ex)
            {
                Logger.Instance.Error(typeof(ReportWidgetVm <>), nameof(LoadReportChartData), ex);
                System.Diagnostics.Debug.Assert(false, ex.Message);
            }

            return(result);
        }