Hi I have a generic list of objects that I would like to bind to a bar graph that have the following properties:
If you look at the attached graphic, really all I want is the totalvalue displayed.not the month number or the totalhours. how do I get rid of these other two series? here is my code so far:
I thought about creating the series manually but then I lose the X-axis labels so ideally I'd like to be able to databind to only one property of the object in the underlying list. Her is the declaration:
thanks for the help
public decimal TotalValue{ get { return _totalValue; } set { _totalValue = value; }}public decimal TotalHours{ get { return _totalHours; } set { _totalHours = value; }}public string FieldActivityNameWUnit{ get { return _fieldActivityNameWUnit; } set { _fieldActivityNameWUnit = value; }}public int ActivityMonth{ get { return _activityMonth; } set { _activityMonth = value; }}public string ActivityMonthName{ get { return _activityMonthName; } set { _activityMonthName = value; }}public string FieldActivity{ get { return _fieldActivity; } set { _fieldActivity = value; }}If you look at the attached graphic, really all I want is the totalvalue displayed.not the month number or the totalhours. how do I get rid of these other two series? here is my code so far:
protected void CreateYearChart() { RadChartProjectActivityYearly.Legend.Clear(); RadChartProjectActivityYearly.Series.Clear(); FieldActivity _activity = FieldActivityService.GetByID(Int32.Parse(ddlFieldActivity.SelectedValue.ToString())); RadChartProjectActivityYearly.ChartTitle.TextBlock.Text = _activity.Unit + " in " + ddlDetailYear.SelectedItem.Text; List<FactProjectActivityTotalsByMonth> _factsBar1 = FactProjectActivityTotalsByMonthService.GetForYear(Int32.Parse(ddlDetailYear.SelectedItem.Text), Int32.Parse(ddlFieldActivity.SelectedValue.ToString())); RadChartProjectActivityYearly.DataSource = _factsBar1; RadChartProjectActivityYearly.Legend.Visible = true;// RadChartProjectActivityYearly.Series[0].DataYColumn = "TotalValue"; RadChartProjectActivityYearly.PlotArea.XAxis.DataLabelsColumn = "ActivityMonthName"; RadChartProjectActivityYearly.DataBind(); RadChartProjectActivityYearly.AutoLayout = true; foreach (Telerik.Charting.ChartSeries series in RadChartProjectActivityYearly.Series) { Debug.WriteLine(series.Name); //if (series.Name != "TotalValue") //{ // RadChartProjectActivityYearly.Series.Remove(series); //} } //RadChartProjectActivityYearly.RemoveSeriesAt(2); //RadChartProjectActivityYearly.RemoveSeriesAt(0);I thought about creating the series manually but then I lose the X-axis labels so ideally I'd like to be able to databind to only one property of the object in the underlying list. Her is the declaration:
<telerik:RadChart ID="RadChartProjectActivityYearly" runat="server" skin="Forest" Width="1000px" ><Legend> <Appearance Position-AlignedPosition="TopRight"></Appearance> </Legend> <PlotArea> <XAxis AutoScale="False" DataLabelsColumn="ActivityMonthName" ></XAxis> </PlotArea></telerik:RadChart>