interaction possible

7 posts, 0 answers
  1. smartpcr
    smartpcr avatar
    9 posts
    Member since:
    May 2007

    Posted 07 Dec 2011 Link to this post

    • Can I select a series/item on chart and have it highlighted (different style)
    • Any event such as selection changed?
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 08 Dec 2011 Link to this post

    Hello Smartpcr,

    The current BETA version supports multiple item selection only -- we will be extending the ChartSelectionBehavior with series selection and the ability to specify single item/series selection for the Q1 2012 official release.

    Here is a sample code snippet that demonstrates how you can enable the chart selection:
    • Add ChartSelectionBehavior instance to the RadCartesianChart.Behaviors collection.
    • Define the desired selection color via custom ChartPalette and set it to the RadCartesianChart.SelectionPalette property.
    • You can detect the selection actopn via the RadCartesianChart.SelectionChanged event.

    <telerik:RadCartesianChart x:Name="RadChart1" Palette="Metro" SelectionChanged="RadChart1_SelectionChanged">
        <telerik:RadCartesianChart.Behaviors>
            <telerik:ChartSelectionBehavior />
        </telerik:RadCartesianChart.Behaviors>
     
        <telerik:RadCartesianChart.SelectionPalette>
            <telerik:ChartPalette>
                <telerik:ChartPalette.GlobalEntries>
                    <telerik:PaletteEntry Fill="Red" />
                </telerik:ChartPalette.GlobalEntries>
            </telerik:ChartPalette>
        </telerik:RadCartesianChart.SelectionPalette>
     
        <telerik:BarSeries>
            <telerik:CategoricalDataPoint Value="1" />
            <telerik:CategoricalDataPoint Value="2" />
            <telerik:CategoricalDataPoint Value="6" />
            <telerik:CategoricalDataPoint Value="7" />
        </telerik:BarSeries>
                 
        <telerik:RadCartesianChart.HorizontalAxis>
            <telerik:CategoricalAxis />
        </telerik:RadCartesianChart.HorizontalAxis>
        <telerik:RadCartesianChart.VerticalAxis>
            <telerik:LinearAxis />
        </telerik:RadCartesianChart.VerticalAxis>
     
        <telerik:RadCartesianChart.Grid>
            <telerik:CartesianChartGrid MajorLinesVisibility="Y" />
        </telerik:RadCartesianChart.Grid>
    </telerik:RadCartesianChart>

    All the best,
    Giuseppe
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. SOFIE
    SOFIE avatar
    4 posts
    Member since:
    Mar 2011

    Posted 17 Jan 2012 Link to this post

    Hi Telerik,

    I have been using the new chart engine and I must admit it is so much more simple than the previous one.

    I have implemented the selection behavior and it works well, I can click on any of my bar and raise the selection event.

    Nevertheless, I am trying now to find a way to select on of the bar (from my BarSeries) from code and not from mouse click anymore.

    I tried to set the selectionPoints in the code manually without success.

    Can you tell me how to select one single bar from code ?

    Thanks !
  5. SOFIE
    SOFIE avatar
    4 posts
    Member since:
    Mar 2011

    Posted 18 Jan 2012 Link to this post

    Up ;)
  6. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 20 Jan 2012 Link to this post

    Hello Sofie,

    RadChart.SelectionPoints is a read-only collection that is generally useful if you would like to use the chart selection in a different control (i.e. you will bind ListBox.ItemsSource to RadChart.SelectionPoints).

    You can use the respective DataPoint.IsSelected boolean property to achieve the desired effect:
    (RadChart1.Series[0] as BarSeries).DataPoints[2].IsSelected = true;

    Hope this helps.


    All the best,
    Giuseppe
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. smartpcr
    smartpcr avatar
    9 posts
    Member since:
    May 2007

    Posted 18 May 2012 Link to this post

    Which future release support selection behavior on chart series? thanks!
  8. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 23 May 2012 Link to this post

    Hello Xiaodong,

    Could you elaborate a bit more on the desired selection behavior -- if you are looking for series-wide selection e.g. for a LineSeries to highlight the whole polyline in a different color, unfortunately this functionality is not available yet.


    All the best,
    Giuseppe
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner