This is a migrated thread and some comments may be shown as answers.

Make Chart a Link

1 Answer 62 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Joel asked on 06 Mar 2009, 07:05 PM
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 

1 Answer, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 09 Mar 2009, 05:43 PM
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.
Tags
Chart (Obsolete)
Asked by
Joel
Top achievements
Rank 2
Answers by
Velin
Telerik team
Share this question
or