Make Chart a Link

Thread is closed for posting
2 posts, 0 answers
  1. Joel
    Joel avatar
    166 posts
    Member since:
    Oct 2006

    Posted 06 Mar 2009 Link to this post

    Is there a way to set the entire chart as a hyperlink? I am creating a chart dynamically for every skin at runtime, and want the user to be able to click on the chart itself that they want to choose to save the setting  Much the same as this page , but with actual charts instead of images.   It seems impractical to maintain 20 themes for 20 different kinds of charts via images.

    Any help would be appreciated.  Below is a crude example of what is being attempted.
       Public Sub GetAndDisplaySkins(ByRef _Table As Table, ByVal _charttype As String
            Dim _myrow As New TableRow 
            Dim _mycell As New TableCell 
            Dim _MyType As Telerik.Charting.ChartSeriesType 
            _MyType = util.GetChartType(_charttype) 
            Dim _MyChart As Telerik.Web.UI.RadChart 
            mysql = "exec sp_GetAllSkins" 
            myreader = dal.GetDataReader(mysql) 
            Dim mycounter As Int32 
            mycounter = 0 
            mysql = "exec sp_GetDummyData" 
            Dim _dstable As DataTable 
            _dstable = dal.GetDataTable(mysql) 
     
            If myreader.HasRows Then 
                While myreader.Read 
                    If mycounter = 0 Then 
                        _myrow = New TableRow 
                    End If 
                    _mycell = New TableCell 
                    _MyChart = New Telerik.Web.UI.RadChart 
                    With _MyChart 
                        .DefaultType = _MyType 
                        .DataSource = _dstable 
                        .ChartTitle.TextBlock.Text = myreader("DisplayName"
                        .Skin = myreader("skinname"
                        .DataBind() 
                        .Width = 250 
                        .Height = 220 
                        .PlotArea.XAxis.DataLabelsColumn = "xstuff" 
                        .PlotArea.YAxis.AxisMode = Telerik.Charting.ChartYAxisMode.Extended 
                        If .Skin = "Black" Then 
                            .AutoLayout = False 
                        Else 
                            .AutoLayout = True 
                        End If 
                        .AutoTextWrap = True 
                        .DataBind() 
                        .Legend.Visible = False 
                    End With 
                    _mycell.Controls.Add(_MyChart) 
                    _myrow.Cells.Add(_mycell) 
     
                    If mycounter = 2 Then 
                        mycounter = 0 
                        _Table.Rows.Add(_myrow) 
                    Else 
                        mycounter += 1 
                    End If 
                End While 
                If mycounter <> 0 Then 
                    _Table.Rows.Add(_myrow) 
                End If 
            End If 

  2. Velin
    Admin
    Velin avatar
    391 posts

    Posted 09 Mar 2009 Link to this post

    Hi Joel,

    RadChart is rendered on the client side as a image element within a div element with id matching the id of your RadChart object. What you should do is to find the chart object with a client side script and assign your custom function to the onclick event.

    Hope this will help.

    Regards,
    Velin
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top