Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Telerik Report Graph

$
0
0
Hello all,
I have a reportviewer on aspx page to which i m getting a login report. 
On the report i have a graph named graph_LoginByDate. I have a dataset coming from a stored procedure.
DataSet ds_LoginsCount = Sql.GetDataset("[SP_LoginsByDate]");
graph_LoginByDate_ImpactsByDate.DataSource = ds_LoginsCount ; This dataset has just two columns "Date" and the "count". Can some one explain how i an assign date to the X-axis and Count to the Y-axis. 
I have tried this: (there is not category. All i am trying to to just plot the date vs logins count)
var countDateGroup = new Telerik.Reporting.GraphGroup();
countDateGroup .Name = "seriesGroup1";
countDateGroup.Groupings.Add(new Telerik.Reporting.Grouping("=Fields.Date"));
countDateGroup.Sortings.Add(new Telerik.Reporting.Sorting("=Fields.Date", Telerik.Reporting.SortDirection.Asc));
graph_LoginByDate.SeriesGroups.Add(countDateGroup );


var graphAxisNumericScale = new Telerik.Reporting.GraphAxis();
graphAxisNumericScale.Name = "GraphAxis2";                    
graphAxisNumericScale.Scale = new Telerik.Reporting.NumericalScale();

var cartesianCoordinateSystem1 = new Telerik.Reporting.CartesianCoordinateSystem();
cartesianCoordinateSystem1.Name = "cartesianCoordinateSystem1";
cartesianCoordinateSystem1.XAxis = graphAxisNumericScale;
cartesianCoordinateSystem1.YAxis = graphAxisNumericScale;
graph_LoginByDate.CoordinateSystems.Add(cartesianCoordinateSystem1);

var lineSeries1 = new Telerik.Reporting.LineSeries();

lineSeries1.CoordinateSystem = cartesianCoordinateSystem1;
lineSeries1.LegendItem.Value = "= Fields.Date";
lineSeries1.SeriesGroup = countDateGroup;
lineSeries1.Y = "=Fields.Count";
graph_LoginByDate.Series.Add(lineSeries1);
I cant do this through properties. It has to be done programatically. Please let me know where i m doing the mistake.
Thank you,

Viewing all articles
Browse latest Browse all 78072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>