Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
320 views
Hello,
I want to use Client Template in RadHtmlChart but my data's column name has a special character.
My sample is here (in rune time in c#),
TooltipsAppearance.ClientTemplate = "#=dataItem."+variableX+"#";
VariableX value is "T-001" or "T - 001".

How can i define it?
ahmet
Top achievements
Rank 1
 answered on 16 Sep 2014
1 answer
286 views
I've created a radhtmlchart with an additional Y axis.  The problem is that the axis is displayed left of the original y axis.  I want this additional y axis displayed on the right side of the chart.  Code below.
<telerik:RadHtmlChart ID="RadHtmlChart1" runat="server">
     <ChartTitle Text="Rows Purged by Date"></ChartTitle>
     <PlotArea>
         <Series>
             <telerik:ColumnSeries DataFieldY="PurgeRowCnt">
                 <TooltipsAppearance Color="White"></TooltipsAppearance>
             </telerik:ColumnSeries>
             <telerik:ColumnSeries AxisName="yAxis_Time" Name="E-Time" DataFieldY="PurgeElapsedTime">
                 <TooltipsAppearance Color="Tomato"></TooltipsAppearance>
                 <Appearance FillStyle-BackgroundColor="PowderBlue"></Appearance>
             </telerik:ColumnSeries>
         </Series>
         <XAxis DataLabelsField="PurgeDateDisplay">
             <TitleAppearance Text="Purge Date"></TitleAppearance>
         </XAxis>
         <YAxis>
             <TitleAppearance Text="Purge Row Count"></TitleAppearance>
         </YAxis>
         <AdditionalYAxes>
             <telerik:AxisY Name="yAxis_Time" Color="SlateBlue"></telerik:AxisY>
         </AdditionalYAxes>
     </PlotArea>
</telerik:RadHtmlChart>
Danail Vasilev
Telerik team
 answered on 12 Sep 2014
5 answers
118 views
Hello,

I am using RadChart, and when i apply skin ( LightBlue ), i am try change legend color, and no change.
If i no use skin, its work. Else no work.

Anybody can help?

Partof HTML
                            <td colspan="2" align="center">
                                <telerik:RadChart ID="chtDesempenhoProcesso1" runat="server" Width="970px" Height="420px"  OnDataBound="chtDesempenhoProcesso1_DataBound" Skin="LightBlue" AutoTextWrap="true">
                                    <PlotArea>
                                        <EmptySeriesMessage Visible="True">
                                            <Appearance Visible="True">
                                            </Appearance>
                                        </EmptySeriesMessage>
                                        <Appearance>
                                            <Border Width="0" Visible="true" />
                                        </Appearance>
                                        <XAxis DataLabelsColumn="Area">
                                        </XAxis>
                                        <YAxis MinValue="0" MaxValue="100" AutoScale="false" Step="10" Appearance-MinorGridLines-Visible="false" Appearance-MajorGridLines-Visible="false">
                                        </YAxis>
                                    </PlotArea>
                                    <ChartTitle>
                                        <TextBlock Text="Dimensão">
                                        </TextBlock>
                                    </ChartTitle>

                                </telerik:RadChart>
                            </td>

aspx.cs

    protected void chtDesempenhoProcesso1_DataBound(object sender, EventArgs e)
    {
        chtDesempenhoProcesso1.PlotArea.XAxis[0].TextBlock.Appearance.TextProperties.Font = new System.Drawing.Font(new System.Drawing.Font("Arial", 10), System.Drawing.FontStyle.Bold);

        if (chtDesempenhoProcesso1.Chart.PlotArea.XAxis.Items.Count > 0)
        {
            for (int i = 0; i < chtDesempenhoProcesso1.Chart.PlotArea.XAxis.Items.Count; i++)
            {
                ChartSeriesItem item = chtDesempenhoProcesso1.Series[5].Items[i];
                item.Appearance.FillStyle.MainColor = System.Drawing.Color.DarkGray;
                item.Appearance.FillStyle.SecondColor = System.Drawing.Color.Gray;
                item.Appearance.Shadow.Distance = 155;
                item.Appearance.Border.Color = System.Drawing.Color.Gray;

              }
                // This code no change legend color
            chtDesempenhoProcesso1.Series[5].Appearance.FillStyle.MainColor = System.Drawing.Color.DarkGray;
        }

    }

thx..
Danail Vasilev
Telerik team
 answered on 11 Sep 2014
1 answer
82 views
I am trying to implement the Demo Code given at :  http://demos.telerik.com/aspnet-ajax/htmlchart/examples/drilldownchart/defaultcs.aspx
I am using same Column names in my database.
It only works for "years" but when i clicked on "2004" or any other year it gives following Error. 

An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code

Additional information: Index was out of range. Must be non-negative and less than the size of the collection.


I am really confused about this. Please help me out in this. 

Looking forward for a quick response.
Thank you.
Danail Vasilev
Telerik team
 answered on 10 Sep 2014
1 answer
65 views
I am trying to implement the Demo Code given at :  http://demos.telerik.com/aspnet-ajax/htmlchart/examples/drilldownchart/defaultcs.aspx
I am using same Column names in my database.
It only works for "years" but when i clicked on "2004" or any other year it gives following Error. 

An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code

Additional information: Index was out of range. Must be non-negative and less than the size of the collection.

This error occurs at  the code line :- 

 SqlDataSource2.SelectParameters[0].DefaultValue = Year.ToString();


I am really confused about this. Please help me out in this. 

Looking forward for a quick response. 
Thank you.
Danail Vasilev
Telerik team
 answered on 10 Sep 2014
1 answer
109 views
I am trying to implement the Demo Code given at :  http://demos.telerik.com/aspnet-ajax/htmlchart/examples/drilldownchart/defaultcs.aspx
I am using same Column names in my database.
It only works for "years" but when i clicked on "2004" or any other year it gives following Error. 

An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code

Additional information: Index was out of range. Must be non-negative and less than the size of the collection.

This error occurs at  the code line :- 

 SqlDataSource2.SelectParameters[0].DefaultValue = Year.ToString();


I am really confused about this. Please help me out in this. 

Looking forward for a quick response. 
Thank you.
Danail Vasilev
Telerik team
 answered on 10 Sep 2014
2 answers
161 views
Freinds,

We are using RAD Chart control to display bar graphs in our ASP.NET web application which worked fine on Dev and QA servers. But when it was moved to production box, it worked fine first day but next day it started giving error "Error Loading Chart Image". Please find the trace below for your reference

Request path: /OneViewDashboard/ChartImage.axd    User host address: 172.21.253.97    User: PMSI\SeK4211    Is authenticated: True    Authentication Type: Negotiate    Thread account name: PMSI\oneviewprodsvc Thread information:    Thread ID: 50    Thread account name: PMSI\oneviewprodsvc    Is impersonating: False    Stack trace:    at System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams)   at Telerik.Web.UI.ChartHttpHandler.ProcessRequest(HttpContext context)   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Please note that it started working after restarting application pool but need to know what could have caused this issue. Thanks in advance.

Thanks,
Satish 
Danail Vasilev
Telerik team
 answered on 09 Sep 2014
7 answers
437 views
We have a page that uses a RadChart, and it works fine so long as we have the site's web.config populated with two separate handlers as detailed in the IIS7 and IIS5/6/7 sections here.

To summarize, it says to put this in in the system.webserver/handlers section for IIS7:
<add name="ChartImage.axd_*" path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode,runtimeVersionv2.0" />

And to put this in the system.web/httphandlers section for IIS6:
<add verb="*"path="ChartImage.axd"type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />

We have added these sections and the control works fine.

The problem is that removing either of these config blocks causes the RadChart to break.  We are running in IIS7 integrated mode.  Only the handler in the system.webserver/handlers section should matter, but that is not the case.

If we remove just the httphandler from the system.web IIS6 section, the RadChart renders with this message:

The Chart http handler is not registered. Please, manually add the following line to your Web.config httpHandlers section:
<add path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Version=2009.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />

If we remove just the handler from the system.webserver IIS7 section, we get a javascript pop window that says "Error loading RadChart image."

I don't understand how it is using both handlers.  It should be using either the system.webserver IIS7 integrated mode handler or the system.web IIS6/non-integrated httphandler.  In our case, since we are running IIS7 integrated, we should only have to specify the one handler.

Furthermore, we are using the Rad HTML editor control which requires the DialogHandler and the SpellCheckHandler, and it works totally fine when we specify the handlers in only the system.webserver IIS7 section.  What is different about RadChart?

Thank you.


Marin Bratanov
Telerik team
 answered on 21 Aug 2014
9 answers
483 views

Hi,

I am trying to create a Leave chart for the employees in the company. I am having some problems in grouping data in Telerik Gantt chart. The datasource that is fed to the chart is shown below.

MemberID            MemberName            StartDate            EndDate
----------------------------------------------------------------------------------------
1                          Name1                       30987                 31723
2                          Name1                       31908                 31999
3                          Name2                       35678                 36321
4                          Name3                       34245                 34909
etc...

I want to display the member names on one axis, and the dates on the other axis. If you notice, Name1 has two records, so this should be reflected in the chart by showing two bars for one name (name1). I am getting the correct chart without grouping (however if a member has two leave periods, his name will be shown twice). Unfortunately with grouping, I am not being able to get the results printed on the chart as required. The code I am using is shown below. I am creating two series (assuming that a user has a maximum of two leave periods, so that the group column will divide each leave period on a separate series).

I am using version 2.0.0 of Telerik Controls.

//*********************************************************************************************************

 

 

// YAxis Properties 

 

radChart.YAxis.ValueFormat =

ChartValueFormat.ShortDate;

 

radChart.YAxis.LabelRotationAngle = 90;

radChart.YAxis.Label.Visible =

true;

 

radChart.YAxis.AutoScale =

false;

 

radChart.YAxis.IsZeroBased =

false;

 

radChart.YAxis.AddRange(_from.ToOADate(), _maxDate.Value.ToOADate(), 1);

 


// YAxis2 Properties
 

 

radChart.YAxis2.ValueFormat =

ChartValueFormat.ShortDate;

 

radChart.YAxis2.LabelRotationAngle = 90;

radChart.YAxis2.Label.Visible =

true;

 

radChart.YAxis2.AutoScale =

false;

 

radChart.YAxis2.IsZeroBased =

false;

 

radChart.YAxis2.Visible =

AxisVisibility.True;

 

radChart.YAxis2.AddRange(_from.ToOADate(), _maxDate.Value.ToOADate(), 1);

 


// General Properties

 

radChart.DefaultType =

ChartSeriesType.Gantt;

 

radChart.Legend.Visible =

false;

 

radChart.Titles.Add(

new ChartTitle("NBK WDG Leave Chart"));

 

 


// add data to table
 

 

 

DataTable _table = new DataTable("Leave");

 

_table.Columns.Add(

"MemberId", typeof(Int32));

 

_table.Columns.Add(

"MemberName", typeof(String));

 

_table.Columns.Add(

"StartDate", typeof(Double));

 

_table.Columns.Add(

"EndDate", typeof(Double));

 

 


foreach
(Member _member in Members)

 

{

_table.Rows.Add(_member.MemberId, _member.MemberName, _member.StartDate < _from ? _from.ToOADate() : _member.StartDate.ToOADate(), _member.EndDate.ToOADate());

}

 


// sort by member name

 

 

DataView _view = new DataView();

 

_view.Table = _table;

_view.Sort =

"MemberName";

 

 


// bind data to chart
 

 

radChart.DataSource = _view;

 


// instantiate new series

 

 

ChartSeries _series = new ChartSeries();

 

 


// define series Properties

 

_series.Type =

ChartSeriesType.Gantt;

 

_series.Name =

"Leave Periods";

 

_series.LabelAppearance.Visible =

false;

 

_series.DataYColumn =

"StartDate";

 

_series.DataYColumn2 =

"EndDate";

 

radChart.Series.Add(_series);

 


ChartSeries
_series2 = new ChartSeries();

 

_series2.Type =

ChartSeriesType.Gantt;

 

_series2.Name =

"Leave Periods 2";

 

_series2.LabelAppearance.Visible =

false;

 

_series2.DataYColumn =

"StartDate";

 

_series2.DataYColumn2 =

"EndDate";

 

radChart.Series.Add(_series2);

radChart.SeriesOrientation =

ChartSeriesOrientation.Horizontal;

 

 


 

radChart.DataGroupColumn =

"MemberId";

 

 

 

 

 

// XAxis Properties

 

radChart.XAxis.DataLabelsColumn =

"MemberName";

 

radChart.XAxis.Label.Visible =

true;

 

 


// bind data

 

radChart.DataBind();

 


// show only weekly marks

 

 

int i = 1;

 

 

foreach (ChartAxisItem _item in radChart.YAxis.Items)

 

{

 

if ((i % 7) != 0)

 

{

_item.Visible =

false;

 

}

i++;

}

i = 1;

 

foreach (ChartAxisItem _item in radChart.YAxis2.Items)

 

{

 

if ((i % 7) != 0)

 

{

_item.Visible =

false;

 

}

i++;

}

 

Please help.

Regards,
Ehab

 

Danail Vasilev
Telerik team
 answered on 15 Aug 2014
5 answers
294 views
Pls show me how to achieve that in Bar chart as all the bars in the same serie always have  the same color. It can be done automatically in Pie chart but I cannot figure out how to do that in Bar chart apart from manually assigned colors to every single item.

Thanks in advance
Danail Vasilev
Telerik team
 answered on 14 Aug 2014
Narrow your results
Selected tags
Tags
+123 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?