Telerik Cockpit problem, cannot click 1 value!!

7 posts, 0 answers
  1. TURKALP
    TURKALP avatar
    14 posts
    Member since:
    Jan 2014

    Posted 01 Oct 2014 Link to this post

    Hello friends, we are using Telerik so fine.
    However, there is one little problem. when we get cockpit report, the 1 values cannot be clicked. Our customers cannot be able to find out the 1 values since they could not be clicked!!!
    I have attached an image to show myself clear. Please help.
  2. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 06 Oct 2014 Link to this post

    Hi Turkalp,

    The bars value 1 are not visible because their size compared to the biggest value (in your case 427) is too small. Instead of clicking on the bar you can implement logic for clicking on the chart's items labels.

    As first glance the chart on the image looks like RadChart, not RadChartView. Can you confirm that? If so, you can define a ContentTemplate for the labels through the SeriesItemLabelStyle of the series definition. Then inside this template you can place a TextBlock for the label and subscribe for its MouseLeftButtonDown event and inside its handler you can implement your click logic.

    <telerik:BarSeriesDefinition.SeriesItemLabelStyle>
        <Style TargetType="telerik:SeriesItemLabel">
            <Setter Property="IsHitTestVisible" Value="True" />
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" MouseLeftButtonDown="TextBlock_MouseLeftButtonDown" />
                    </DataTemplate>
                </Setter.Value>
            </Setter>                                               
        </Style>
    </telerik:BarSeriesDefinition.SeriesItemLabelStyle>

    If you are using RadChartView you can use similar approach, but the definition of the custom labels is created through the LabelDefinitions collection of the series, as demonstrated in the Label Template Customization demo.

    I also attached a sample project demonstrating this approach with RadChart. Please give it a try and let me know if it helps.

    As a side note, RadChart is our old charting control which has many known issue and limitations. Many of them are resolved in our new charting solution - RadChartView. The new components have improved performance and better implementation which allows easier set up and great flexibility. You can read about the differences between the charts in the RadChart vs. RadChartView help article.

    Regards,
    Martin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. DevCraft banner
  4. TURKALP
    TURKALP avatar
    14 posts
    Member since:
    Jan 2014

    Posted 14 Oct 2014 Link to this post

    Thanks Martin, it is Radchart. Now I am trying to implement your code to my code. 
  5. TURKALP
    TURKALP avatar
    14 posts
    Member since:
    Jan 2014

    Posted 14 Oct 2014 Link to this post

    My code is like 

     <telerik:RadChart x:Name="Chart"  />

    how can I implement it?



  6. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 17 Oct 2014 Link to this post

    Hello Turkalp,

    The attached project from my last reply demonstrates an implementation of the described approach. Please take a look at it and modify it to fit in your project.

    Regards,
    Martin
    Telerik
     

    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.

     
  7. TURKALP
    TURKALP avatar
    14 posts
    Member since:
    Jan 2014

    Posted 22 Nov 2014 in reply to Martin Link to this post

    Thank you Martin!.. right now I have implemented to my code. However there is such a problem;  something overrides Textblock, which is not displayed and not triggered. I am working on it.
  8. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 26 Nov 2014 Link to this post

    Hello,

    I am glad to hear that you managed to implement this approach in your application. Please let me know If you need any further assistance.

    Regards,
    Martin
    Telerik
     

    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.

     
Back to Top
DevCraft banner