I have an issue, my RadChart loads perfectly locally, but after I deploy it just keeps loading but doesn't run. I don't get in the actual chart screen.
I put a messagebox after the whole process and this messagebox shows up, so I am sure that the end of the code is reached. I just don't know why the screen doesn't finish loading.
Any ideas?
Code:
protected void btnSearch_OnClick(object sender, ImageClickEventArgs e) {
try
{
RadChartPOByFactory.Chart.Series.RemoveSeries();
RadChartPOByFactory.ClientSettings.ScrollMode = Telerik.Web.UI.ChartClientScrollMode.Both;
RadChartPOByFactory.DataManager.ValuesXColumn = "FactoryID";
RadChartPOByFactory.DataManager.ValuesYColumns = new String[] { "Value" };
RadChartPOByFactory.DataGroupColumn = "Year";
RadChartPOByFactory.PlotArea.XAxis.DataLabelsColumn = "Factory";
RadChartPOByFactory.Legend.Appearance.GroupNameFormat = "#VALUE";
RadChartPOByFactory.PlotArea.YAxis.Appearance.CustomFormat = "$#,##0,,.00M;;K";
var poReportRawData = from r in report.GetPOHeader_POByFactory_Report(ddlYearFrom.SelectedValue, ddlYearTo.SelectedValue)
select new {
Year = r.Year.ToString(),
Factory = r.Factory,
Value = r.AmountWithDiscount.Value };
var factoryRawIDs = (from f in poReportRawData select f.Factory).Distinct();
List<ListItem> factoryIDs = new List<ListItem>();
int i = 1;
foreach (string s in factoryRawIDs.ToList())
{
factoryIDs.Add(new ListItem(s, i.ToString()));
i++;
}
var poReportData = from po in poReportRawData.ToList()
select new {
Year = po.Year,
FactoryID = factoryIDs.Where(f => f.Text == po.Factory).FirstOrDefault().Value,
Value = po.Value,
Factory = po.Factory };
RadChartPOByFactory.DataSource = poReportData.ToList();
RadChartPOByFactory.DataBind();
foreach (ChartSeries cs in RadChartPOByFactory.Series)
{
cs.DefaultLabelValue = "$#Y{#,##0,}K (#%{#0.###%})";
cs.Appearance.LabelAppearance.LabelLocation = StyleSeriesItemLabel.ItemLabelLocation.Inside;
cs.Appearance.LabelAppearance.Position.AlignedPosition = AlignedPositions.Center;
cs.Appearance.LabelAppearance.RotationAngle = 0;
}
RadChartPOByFactory.Visible = true;
}
catch(ExceptionHandler ex)
{
WriteJSHandledException(ex);
}
}
And this code is also run:
protected void RadChartPOByFactory_OnBeforeLayout(object sender, System.EventArgs e) {
foreach (Telerik.Charting.LabelItem RadChartLegendLabelItem in RadChartPOByFactory.Legend.Items.OrderBy(a=>a.Name)) {
//Remove the top-most item (which then decrements the item count of the legend)
RadChartPOByFactory.Legend.Items.RemoveAt(0);
//Insert the new (reversed) legend item at the end of the list
RadChartPOByFactory.Legend.Items.Insert(RadChartPOByFactory.Legend.Items.Count, RadChartLegendLabelItem);
}
foreach (Telerik.Charting.ChartSeries RadChartSerie in RadChartPOByFactory.Chart.Series.OrderBy(a => a.Name)) {
RadChartSerie.Items.OrderBy(a => a.Parent.Name);
//Remove the top-most item (which then decrements the item count of the legend)
RadChartPOByFactory.Chart.Series.RemoveAt(0);
//Insert the new (reversed) legend item at the end of the list
RadChartPOByFactory.Chart.Series.Insert(RadChartPOByFactory.Chart.Series.Count, RadChartSerie);
}
foreach (Telerik.Charting.ChartSeries RadChartSerie in RadChartPOByFactory.Chart.Series.OrderBy(a => a.Name)) {
foreach (ChartSeriesItem RadChartSerieItem in RadChartSerie.Items.OrderBy(b => b.Name)) {
//Remove the top-most item (which then decrements the item count of the legend)
RadChartSerie.Items.RemoveAt(0);
//Insert the new (reversed) legend item at the end of the list
string tmpTextBlock = RadChartSerieItem.Label.TextBlock.Text;
string[] toMillion = tmpTextBlock.Split(' ');
string tmpValue = toMillion[0].Substring(1, toMillion[0].Length - 2);
decimal tmpInt = decimal.Parse(tmpValue);
if (tmpInt >= 1000) {
RadChartSerieItem.Label.TextBlock.Text = tmpInt.ToString("$#,##0,.00M") + " " + toMillion[1];
}
RadChartSerie.Items.Insert(RadChartSerie.Items.Count, RadChartSerieItem);
}
}
}
If you can't see the
chart image
displayed in the page,check to see
if you haveregistered the correct version of the HTTP Handler
in yourWeb.Config
or add anHTTP Handler
through the smart tag during design-time.It is needed to
manually register the RadControls "HttpHandlers"
, or using theIIS administration
capabilities. Themanual registration
is done the following way:(In web.config file)
For more details about manual register or IIS7 capabilities for
HTTP Handlers
click HERE