Hi All,
I have a custom web part which includes RAD Chart control.
Chart is created dynamically as per the web part configuration settings.
We have a data table as shown in below figure, which is used as chart's data source.
Status |
ADMIN |
ATL-API |
BACKEND |
DESKTOP |
CLOSED |
|
|
3 |
1 |
DEFERRED |
|
2 |
12 |
|
NOT A BUG |
1 |
12 |
23 |
I create a multiple series chart (Type - Bar).
For each column (column 1 and onward), a new series is created. Series name is same as column name.
Series DataYColumn is set as column name.
Name of first column is set in 'radChartObj.PlotArea.XAxis.DataLabelsColumn' value.
Then data is bind with chart.
Please refer the following code for details:
***************************************************************************************************************************
// Set chart's skin
radChartObj.Skin = "Vista";
radChartObj.Width = new Unit("600 px");
// Set Chart's attributes.
radChartObj.AutoLayout = true;
radChartObj.IntelligentLabelsEnabled = true;
radChartObj.DefaultType = ChartSeriesType.Bar;
// Set chart's data source.
radChartObj.DataSource = chartingDataTable;
// Set chart's x-axis data labels column name.
radChartObj.PlotArea.XAxis.DataLabelsColumn = chartingDataTable.Columns[0].ColumnName;
// For each column (column 1 and onward), add a new series.
for (int colIndex = 1; colIndex < chartingDataTable.Columns.Count; colIndex++)
{
string columnName = chartingDataTable.Columns[colIndex].ColumnName;
// Prepare chart series name.
string seriesName = columnName;
// Create chart series.
ChartSeries chartSeriesObj = new ChartSeries(seriesName);
// Set chart series' type and its DataYColumn name.
chartSeriesObj.Type = ChartSeriesType.Bar;
chartSeriesObj.DataYColumn = columnName;
// Set chart series' tooltip.
chartSeriesObj.ActiveRegionToolTip = "#SERIES: #Y";
// Set chart series' empty value mode as 'Zero'.
chartSeriesObj.Appearance.EmptyValue.Mode = Telerik.Charting.Styles.EmtyValuesMode.Zero;
// Add chart series to chart object.
radChartObj.Series.Add(chartSeriesObj);
}
// Bind data with chart.
radChartObj.DataBind();
***************************************************************************************************************************
If i create a multiple series chart for more values (like 12 series) i.e. data table has more than 10 columns.
Also, first column of data table has 8-9 values.
Then X-Axis labels overlap each other.
If i set radChartObj.AutoTextWrap = true, so that X-Axis labels do not overlap each other, then Web Part page in which my web part is added, takes too much time to load the page and finally, Request Timed Out error occurs.
If i increase the time out value, then page is loaded successfully but it takes a lot to load.
Page should not take more time to load.
Please suggest a solution and let me know why page takes too much time to load if data table size increases.