Exemple #1
0
        /// <summary>
        /// Gets value for chart's X Axis.
        /// </summary>
        private object GetXAxisValue(IDataReader dataReader, ChartSerieDashboardItemSelectBuilder chartSerieDashboardSelectBuilder)
        {
            var xAxis = new JObject();

            foreach (var map in chartSerieDashboardSelectBuilder.EntityColumnsMap)
            {
                if (map.Key != chartSerieDashboardSelectBuilder.GroupColumnPath)
                {
                    var    columnMap = (Dictionary <string, object>)map.Value;
                    object value     = GetValueByColumnMap(dataReader, columnMap);
                    if (chartSerieDashboardSelectBuilder.HasDateTimeFormat)
                    {
                        xAxis.Add(new JProperty((string)columnMap["format"], value));
                    }
                    else
                    {
                        return(value);
                    }
                }
            }
            if (chartSerieDashboardSelectBuilder.HasDateTimeFormat)
            {
                return(xAxis);
            }
            return(null);
        }
Exemple #2
0
        /// <summary>
        /// Gets value for chart's Y Axis.
        /// </summary>
        private object GetYAxisValue(IDataReader dataReader, ChartSerieDashboardItemSelectBuilder chartSerieDashboardSelectBuilder)
        {
            var    entityColumnsMap = chartSerieDashboardSelectBuilder.EntityColumnsMap;
            var    columnMap        = (Dictionary <string, object>)entityColumnsMap[chartSerieDashboardSelectBuilder.GroupColumnPath];
            object value            = GetValueByColumnMap(dataReader, columnMap);

            return(value);
        }
Exemple #3
0
        /// <summary>
        /// Returns instance of select builder.
        /// </summary>
        public virtual ChartSerieDashboardItemSelectBuilder GetSelectBuilder(string schemaName, JToken serieParameters,
                                                                             JObject serieConfig)
        {
            string orderBy           = Parameters.Value <string>("orderBy");
            bool   orderByGroupField = (orderBy == "GroupByField");
            var    chartSerieDashboardSelectBuilder = new ChartSerieDashboardItemSelectBuilder(UserConnection, schemaName,
                                                                                               TimeZoneOffset, Parameters, serieParameters, orderByGroupField);

            chartSerieDashboardSelectBuilder.SerieConfig = serieConfig;
            return(chartSerieDashboardSelectBuilder);
        }