Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
178 views
I have 2 charts on my web page (see attached code blocks).

I can set a ToolTip and URL for each point in each series.

This works fine if I only have one chart on my page.

If I have two charts, then only the second charts ToolTips and URL links work.

Any idea what I am doing wrong?

Any help appreciated.

Regards,

Paul.

using System;  
using System.Data;  
using System.Configuration;  
using System.Collections;  
using System.Drawing;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
using Telerik.Charting;  
using Telerik.WebControls;  
 
public partial class Default5 : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!Page.IsPostBack)  
        {  
            CreateChart(RadChart1);  
            CreateChart(RadChart2);  
 
        }  
    }  
 
    private void CreateChart(RadChart radChart)  
    {  
        const double hourStep = 1 / 24.0;  
        const double minuteStep = hourStep / 60;  
        const double fiveMinuteStep = minuteStep * 5;  
 
        double startTime = new DateTime(2008, 1, 1, 19, 0, 0, 0).ToOADate();  
        double endTime = new DateTime(2008, 1, 2, 7, 0, 0, 0).ToOADate();  
 
        radChart.ChartTitle.TextBlock.Text = "Trend Chart";  
 
        radChart.PlotArea.XAxis.AddRange(startTime, endTime, hourStep);  
        radChart.PlotArea.YAxis.AutoScale = false;  
        radChart.PlotArea.YAxis.MaxValue = 70;  
        radChart.PlotArea.YAxis.MinValue = -70;  
 
        radChart.PlotArea.YAxis.AxisLabel.TextBlock.Text = "UOM";  
        radChart.PlotArea.YAxis.AxisLabel.TextBlock.Visible = true;  
 
        radChart.PlotArea.XAxis.AutoScale = false;  
 
        Random r = new Random();  
        ChartSeries s = radChart.CreateSeries(radChart.ID + "Series 1", Color.Empty, Color.Empty, ChartSeriesType.Line);  
 
        Int32 testResultId = 0;  
        for (double currentTime = startTime; currentTime < endTime; currentTime += fiveMinuteStep)  
        {  
            testResultId += 1;  
            ChartSeriesItem item = new ChartSeriesItem();  
            item.XValue = currentTime + (r.NextDouble() - 0.5) * fiveMinuteStep;  
            item.YValue = 0 + (r.NextDouble() - 0.5) * 90;  
 
            item.Label.ActiveRegion.Tooltip = "value=" + item.YValue + ", time=" + DateTime.FromOADate(item.XValue).ToShortTimeString();  
            item.Label.ActiveRegion.Url = "http://localhost/ChartTest/Default2.aspx?TestResultId=" + testResultId;  
            item.Label.TextBlock.Text = " ";  
            s.Appearance.LineSeriesAppearance.Color = Color.Blue;  
 
 
            s.Items.Add(item);  
        }  
 
        s = radChart.CreateSeries(radChart.ID + "Series 2", Color.Empty, Color.Empty, ChartSeriesType.Line);  
 
        testResultId = 0;  
        for (double currentTime = startTime; currentTime < endTime; currentTime += fiveMinuteStep)  
        {  
            testResultId += 1;  
            ChartSeriesItem item = new ChartSeriesItem();  
            item.XValue = currentTime + (r.NextDouble() - 0.5) * fiveMinuteStep;  
            item.YValue = 0 + (r.NextDouble() - 0.5) * 90;  
 
            item.Label.ActiveRegion.Tooltip = "value=" + item.YValue + ", time=" + DateTime.FromOADate(item.XValue).ToShortTimeString();  
            item.Label.ActiveRegion.Url = "http://localhost/ChartTest/Default2.aspx?TestResultId=" + testResultId;  
            item.Label.TextBlock.Text = " ";  
            s.Appearance.LineSeriesAppearance.Color = Color.Green;  
 
            s.Items.Add(item);  
        }  
 
    }  
 
}  
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default5.aspx.cs" Inherits="Default5" %> 
 
<%@ Register Assembly="RadChart.Net2" Namespace="Telerik.WebControls" TagPrefix="radC" %> 
<%@ Register Assembly="RadChart.Net2" Namespace="Telerik.Charting" TagPrefix="radC" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <radC:RadChart ID="RadChart1" runat="server"  Width="1082px" Height="807px" DefaultType="Line" > 
            <ChartTitle> 
                <TextBlock Text="Trend Chart">  
                </TextBlock> 
                <Appearance> 
                    <FillStyle MainColor="Azure">  
                    </FillStyle> 
                </Appearance> 
            </ChartTitle> 
            <Appearance TextQuality="AntiAlias">  
                <FillStyle MainColor="Azure">  
                </FillStyle> 
            </Appearance> 
            <PlotArea> 
                <Appearance Dimensions-Margins="10%, 10%, 10%, 10%" > 
                    <FillStyle MainColor="Azure" SecondColor="">  
                    </FillStyle> 
                </Appearance> 
                <XAxis LayoutMode="Inside" AutoScale="False">  
                <AxisLabel> 
                    <TextBlock Text="Time" Visible="True">  
                    </TextBlock> 
                </AxisLabel> 
                    <Appearance ValueFormat="ShortTime">  
                        <LabelAppearance RotationAngle="45" Position-AlignedPosition="Top">                          
                        </LabelAppearance> 
                        <MajorGridLines Visible="False" /> 
                    </Appearance> 
                    <Items> 
                        <radC:ChartAxisItem> 
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="1">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="2">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="3">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="4">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="5">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="6">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="7">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                    </Items> 
                </XAxis> 
                <YAxis IsZeroBased="False" MaxValue="100" Step="10">  
                </YAxis> 
                <DataTable> 
                    <Appearance RenderType="PlotAreaRelative" TextHorizontalAlign="Center" TextVerticalAlign="Middle">  
                    </Appearance> 
                </DataTable> 
                <YAxis2 MinValue="1">  
                </YAxis2> 
                <EmptySeriesMessage Visible="True">  
                </EmptySeriesMessage> 
            </PlotArea> 
            <Legend> 
                <Appearance Position-AlignedPosition="None">  
                </Appearance> 
            </Legend> 
        </radC:RadChart> 
      
        <radC:RadChart ID="RadChart2" runat="server"  Width="1082px" Height="807px" DefaultType="Line" > 
            <ChartTitle> 
                <TextBlock Text="Trend Chart">  
                </TextBlock> 
                <Appearance> 
                    <FillStyle MainColor="Azure">  
                    </FillStyle> 
                </Appearance> 
            </ChartTitle> 
            <Appearance TextQuality="AntiAlias">  
                <FillStyle MainColor="Azure">  
                </FillStyle> 
            </Appearance> 
            <PlotArea> 
                <Appearance Dimensions-Margins="10%, 10%, 10%, 10%" > 
                    <FillStyle MainColor="Azure" SecondColor="">  
                    </FillStyle> 
                </Appearance> 
                <XAxis LayoutMode="Inside" AutoScale="False">  
                <AxisLabel> 
                    <TextBlock Text="Time" Visible="True">  
                    </TextBlock> 
                </AxisLabel> 
                    <Appearance ValueFormat="ShortTime">  
                        <LabelAppearance RotationAngle="45" Position-AlignedPosition="Top">                          
                        </LabelAppearance> 
                        <MajorGridLines Visible="False" /> 
                    </Appearance> 
                    <Items> 
                        <radC:ChartAxisItem> 
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="1">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="2">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="3">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="4">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="5">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="6">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                        <radC:ChartAxisItem Value="7">  
                            <Appearance Position-AlignedPosition="Top" RotationAngle="45">  
                            </Appearance> 
                        </radC:ChartAxisItem> 
                    </Items> 
                </XAxis> 
                <YAxis IsZeroBased="False" MaxValue="100" Step="10">  
                </YAxis> 
                <DataTable> 
                    <Appearance RenderType="PlotAreaRelative" TextHorizontalAlign="Center" TextVerticalAlign="Middle">  
                    </Appearance> 
                </DataTable> 
                <YAxis2 MinValue="1">  
                </YAxis2> 
                <EmptySeriesMessage Visible="True">  
                </EmptySeriesMessage> 
            </PlotArea> 
            <Legend> 
                <Appearance Position-AlignedPosition="None">  
                </Appearance> 
            </Legend> 
        </radC:RadChart> 
      
    </div> 
    </form> 
</body> 
</html> 
 
Giuseppe
Telerik team
 answered on 12 Jun 2008
1 answer
264 views
Using a RadGrid I'd like to raise a postback  from the client side on the event RowDblClick.

My difficulty is to pass the DataKey value of the row who was raise by dbl click and should be pass as argument to the postback.

Thanks for help

<ClientSettings AllowKeyboardNavigation="true">

<ClientEvents OnRowDblClick="ctrlListeSejourGV_RowDblClick"/>

</ClientSettings>

function

ctrlListeSejourGV_RowDblClick(rowIndex){

var  dataKeyValue  = {....} <<< the code i'm looking for

_doPostBack(

"<%= ctrlListeSejourGV.UniqueID %>", "RowDblClick:" + dataKeyValue );

}

Vlad
Telerik team
 answered on 12 Jun 2008
1 answer
158 views
Hi:
I just installed RadControls for ASP.NET AJAX and when I try to run some sample I get this error:

Method not found: 'Void System.Web.UI.ScriptManager.RegisterStartupScript(System.Web.UI.Page, System.Type, System.String, System.String, Boolean)

How can I fix it?

Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 12 Jun 2008
1 answer
168 views
In the previous version of tabstrip (non-AJAX), you could grab the EventObject in the OnClientMouseOver event to show a mouse-over menu. See http://www.telerik.com/community/forums/thread/b311D-baccak.aspx for an example.
The EventObject is no longer a property of the eventArgs ... how do I accomplish this in RadControls AJAX?
Is the get_domEvent() the correct method?

Also, how do I get the client ID that caused the event. Previously, I used tab.ID but this no longer works. Should I use sender.get_id()?

Thanks!
Paul
Telerik team
 answered on 12 Jun 2008
12 answers
305 views
At the blank page date picker control is working...
Why when i add the control at my web page i can't see the date picker pop up button?
Yoni Dagan
Top achievements
Rank 1
 answered on 12 Jun 2008
1 answer
204 views
How do you select an item after manually firing a requestItems callback?  I'm calling:

combo.requestItems(valueToSelect, false); 

The valueToSelect is the value I want selected in the combo box.  I've tried selecting the item when populating the list on the server during the callback, but this doesn't work.  It used to work in RadControls for ASP.NET, but in this version it does not work.  I've read several posts about how you can't do this. 

So, my question is, how do I select the item in the combo box without using a global javascript variable?

Thanks,
Sara
Simon
Telerik team
 answered on 12 Jun 2008
1 answer
112 views
When I place a RadComboBox inside a RadToolTip, the RadComboBox dropdown items list appears under the tooltip.

Obviously, I would like to have it appear on top of the tooltip.

Thanks,
Simon
Telerik team
 answered on 12 Jun 2008
3 answers
192 views
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Scheduler/Examples/RadToolTip/DefaultCS.aspx

Under the demo, line
Dim aptId As Integer = Integer.Parse(e.TargetControlID.Split("_")(1))
would not pass when there is master page present, value for e.TargetControlID.Split("_")(1) would ring up "ContentPlaceHolder1", Is there anyway to fix it? such as loading strings some other way. Please help.
Thank you
Thank you
Best Regards
Peter

Tsvetie
Telerik team
 answered on 12 Jun 2008
1 answer
135 views
Hello,

I am using the RadScheduler control and was wondering if it's possible to determine programmatically the date range for the current display.  For example, if I have the weekly view on, and then I press the arrow to move to the following week, I'd like to get the beginning date of the following week.  Since I am using a dynamic data source, I want to use date to streamline my SQL query for better performance.

Thanks,

Antonio.
Dimitar Milushev
Telerik team
 answered on 12 Jun 2008
3 answers
158 views

Hello,


Does anyone knows how to get the resources between the specified start and end time instead of getting all the resources from resource collection?  I'm trying to get the resources durring scheduler FormCreatingEvent and then hide the available resources so user cannot reserve the same resource again between that time.

Please help any suggestion or comments would be appereciated.

Thank you.
-Sal

Dimitar Milushev
Telerik team
 answered on 12 Jun 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?