3 posts, 0 answers
  1. Jan Skovhus
    Jan Skovhus avatar
    7 posts
    Member since:
    Mar 2014

    Posted 11 Dec 2014 Link to this post

    How can I Show Trackball for each series?

    For i = 0 To Me.RadListView1.Items.Count - 1
                    If RadListView1.Items(i).CheckState = Telerik.WinControls.Enumerations.ToggleState.On Then
                       Dim lii As Integer = RadListView1.Items(i).Value
                        Dim liText As String = RadListView1.Items(i).Text
                        ''SingleHistory = MeasureWS.SingleHistory(lii.ToString, TextBoxStart.Text, TextBoxEnd.Text, "120")
                        SingleHistory = MeasureWS.SingleHistory(lii.ToString, "", TextBoxStart.Text, TextBoxEnd.Text, "120")

                        Dim LineSeriesY As New LineSeries()
                        LineSeriesY.LegendTitle = liText
                        'LineSeriesY.Name = liText
                        Dim LineSeriesX As New LinearAxis()
                        LineSeriesX.HorizontalLocation = AxisHorizontalLocation.Left
                        LineSeriesX.AxisType = AxisType.Second
                        'LineSeriesX.Title = ""
                        LineSeriesY.VerticalAxis = LineSeriesX
                        LineSeriesY.HorizontalAxis = horizontalAxis

                        LineSeriesY.CategoryMember = "DateTime"
                        LineSeriesY.ValueMember = "PV"

                        LineSeriesY.DataSource = SingleHistory
                        'Form2.DataGridView1.DataSource = SingleHistory

                        Dim controler As New ChartTrackballController()
                        AddHandler controler.TextNeeded, AddressOf controler_TextNeeded

                    End If

    Private Sub controler_TextNeeded(sender As Object, e As TextNeededEventArgs)
            Dim dataPoint As CategoricalDataPoint = TryCast(e.Points(0).DataPoint, CategoricalDataPoint)
            e.Text = String.Format("{0} : {1}", dataPoint.Category, dataPoint.Value)
    End Sub
  2. Dess
    Dess avatar
    1562 posts

    Posted 16 Dec 2014 Link to this post

    Hello Jan,

    Thank you for writing.

    You should add only one ChartTrackballController to the RadChartView.Controllers collection. Thus, in the ChartTrackballController.TextNeeded event you can specify the text which will be displayed:
    Sub New()
        Dim lineSeries As New LineSeries()
        lineSeries.DataPoints.Add(New CategoricalDataPoint(20, "Jan"))
        lineSeries.DataPoints.Add(New CategoricalDataPoint(22, "Apr"))
        lineSeries.DataPoints.Add(New CategoricalDataPoint(12, "Jul"))
        lineSeries.DataPoints.Add(New CategoricalDataPoint(19, "Oct"))
        Dim lineSeries2 As New LineSeries()
        lineSeries2.DataPoints.Add(New CategoricalDataPoint(18, "Jan"))
        lineSeries2.DataPoints.Add(New CategoricalDataPoint(15, "Apr"))
        lineSeries2.DataPoints.Add(New CategoricalDataPoint(17, "Jul"))
        lineSeries2.DataPoints.Add(New CategoricalDataPoint(22, "Oct"))
        Dim controler As New ChartTrackballController()
        AddHandler controler.TextNeeded, AddressOf controler_TextNeeded
    End Sub
    Private Sub controler_TextNeeded(sender As Object, e As TextNeededEventArgs)
        Dim sb As New StringBuilder()
        For Each point As DataPointInfo In e.Points
            Dim dataPoint As CategoricalDataPoint = TryCast(point.DataPoint, CategoricalDataPoint)
            sb.AppendLine(String.Format("{0} : {1}", dataPoint.Category, dataPoint.Value))
        e.Text = sb.ToString()
    End Sub

    I hope this information helps. Should you have further questions, I would be glad to help.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
  4. Jan Skovhus
    Jan Skovhus avatar
    7 posts
    Member since:
    Mar 2014

    Posted 17 Dec 2014 Link to this post

    It works,

Back to Top