This is a migrated thread and some comments may be shown as answers.

Customize Chart DataTable

1 Answer 119 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Muhammad Jamil Nawaz
Top achievements
Rank 2
Muhammad Jamil Nawaz asked on 05 Sep 2010, 01:48 PM
Hi,

In the chart, I have to show the chart data table. Using Data table property I make it happen. Please see in attachment. Now, problem is, there are two series, which needs to be show n legends and on the chart but don't want to show those in chart table. (in my case, these are Median Score and Trend Line).

I use following code to make this chart:

Chart1.PlotArea.XAxis.DataLabelsColumn = "DateString";
Chart1.PlotArea.YAxis.AutoScale = false;
Chart1.PlotArea.YAxis.Step = 100;
Chart1.PlotArea.YAxis.MinValue = double.Parse(dsData.Tables[0].Rows[0]["MinValue"].ToString());
Chart1.PlotArea.YAxis.MaxValue = double.Parse(dsData.Tables[0].Rows[0]["MaxValue"].ToString());
 
Chart1.Series.Clear();
 
foreach (DataColumn column in dsData.Tables[0].Columns)
{
    if (column.ColumnName.Contains("Series"))
    {
        ChartSeries series = new ChartSeries(column.ColumnName, ChartSeriesType.Point);
 
        series.DefaultLabelValue = "#Y";
        series.DataYColumn = column.ColumnName;
 
        rcCreditSummary.Series.Add(series);
    }
}
 
ChartSeries series1 = new ChartSeries("Median Score", ChartSeriesType.Line);
 
series1.DefaultLabelValue = "#Y";
series1.DataYColumn = "AvgScore";
series1.Visible = true;
series1.Appearance.LabelAppearance.Visible = false;
 
Chart1.Series.Add(series1);
 
ChartSeries trendLineSeries = new ChartSeries("Trend Line", ChartSeriesType.Line);
trendLineSeries.DefaultLabelValue = "#Y";
trendLineSeries.DataYColumn = "TrendLineScore";
trendLineSeries.Visible = true;
trendLineSeries.Appearance.LabelAppearance.Visible = false;
             
Chart1.Series.Add(trendLineSeries);
 
Chart1.DataSource = dsData.Tables[0];
Chart1.IntelligentLabelsEnabled = false;
Chart1.DataBind();


Is there any way to make it happen.

JAMIL

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 08 Sep 2010, 04:17 PM
Hi Jamil,

I am afraid RadChart does not expose such functionality. It is possible to achieve it though -- the workaround is not that robust and flexible but still does the trick -- configure the PlotArea and the DataTable, so that the DataTable is positioned in a way that does not allow all of its content to be shown. The drawback is that you will have to fine-tune the PlotArea and the DataTable manually for the specific size of your chart. I have attached a small example, showing this for the default chart size.

Best regards,
Ves
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart (Obsolete)
Asked by
Muhammad Jamil Nawaz
Top achievements
Rank 2
Answers by
Ves
Telerik team
Share this question
or