Sparklines, decimal, domain data source view

6 posts, 0 answers
  1. Biruh MEKONNEN
    Biruh MEKONNEN avatar
    23 posts
    Member since:
    Apr 2010

    Posted 06 Jan 2011 Link to this post

    Hi,

    first, little question, I wanted to know if it's possible to have sparklines with decimal YValue. I had some problem to do it. I had to change it to double.
    I'm using RIA Service with linq to entities. In my SQL server database, I have to work with money type fields, these fiels become decimal in linq to entites.

    Then, I wanted to adapt this code found here to sparklines:

    http://blogs.telerik.com/rossenhristov/posts/10-01-07/asynchronous_master-details_with_radgridview_for_silverlight_and_wcf_ria_services.aspx

    However, instead of having some details, I have a sparkline column.
    I have a list of projects (mainly ProjectId and ProjectTitle attributes).
    In my converter, I'm doing like in the master-details example:
    - The converter is calling a ria query to get asynchronously a list of entities (from a ProjectId parameter)
    - The converter returns then the corresponding dataview.
    Each entity has a Double attribute Alloc and a DateTime attribute DateAcctPrd.

    Then in the xaml code, I bind the converter like in the following xaml code. However, I have an NullReferenceException when I run my code.
    (If I'm doing a master detail, I can see in the details the list of entities, so my query is working well. If I don't add any YValuePath, I have of course a constant value in the sparklines but I don't have any exception)

    Could you help me with that?
    <telerik:GridViewDataColumn Header="Title" DataMemberBinding="{Binding ProjectTitle}" />
    <telerik:GridViewDataColumn Header="Evolution">
          <telerik:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                 <telerik:RadLinearSparkline ShowFirstPointIndicator="True" ShowLastPointIndicator="True"
    ShowHighPointIndicators
    ="True" ShowLowPointIndicators="True"
      ItemsSource
    ="{Binding Project_ID,Converter={StaticResource SparkConverter}}"
    YValuePath="Alloc" YWidth="200" Height="20"  />             </DataTemplate>
          </telerik:GridViewDataColumn.CellTemplate>
    </telerik:GridViewDataColumn>
  2. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 10 Jan 2011 Link to this post

    Hi Biruh MEKONNEN,

    Thank you for contacting Telerik support!
    We were able to reproduce this strange behavior in Sparklines using decimal values and logged in this issue in our PITS system  here. You can expect a fix in one of the upcoming LIB released every Monday. Your Telerik points have been updated for helping us pinpoint this issue. Until there is a fix you can represent your YValues as doubles.

    Kind regards,
    Yavor Ivanov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. Biruh MEKONNEN
    Biruh MEKONNEN avatar
    23 posts
    Member since:
    Apr 2010

    Posted 10 Jan 2011 Link to this post

    Hi,

    thanks for your answer !!

     I would be also very interested if there is a way to load asynchronously data to sparklines in a gridview with RIA service and LINQ to Entities.
    As I wrote before, I thought about binding a dataview of a DomainDataSource to each sparkline chart via a converter. Then I would run from the DomainDataSource an asynchronous query to get the data. The problem is I guess the view is null(or the corresponding data) at the beginning and so there is a NullReference exception when the sparkline control wants to access to the attributes set in  YValuePath and XValuePath.

    As I haven't found a way to load asynchronously my data, I'm using eager loading in RIA service to have the different points in my sparklines and I found a weird behavior. (a  Layout cycle detected.  Layout could not complete).

    To reproduce this behavior, you should have:
    - a RadGrivew with around 20 lines.
    - Each line is composed of two columns, one represents just a classical GridviewDataColumn with simple bound text  and the other one is represented by a RadLinearSparkLine or a RadAreaSparkLine.
    -
    Each SparkLine control is bound to a List of around 12 measure points. In my case, a measure point is defined by a date (for the XValuePath) and a double (for the YValuePath). A lot of my measure points have the same value (for the YValue). But to reproduce the behavior, you should set all the measure points to have different XValue but all the same YValue (for instance 0). Thus, every point will be considered as a high or a low point.
    - Then you should set the attribute ShowHighPointIndicators (or ShowLowPointIndicators) to true.  So as I just wrote before every point will be a high (or low) point.

    Then normally when you run it, there is a  "Layout cycle detected.  Layout could not complete." error. Sometimes, it's working but there isn't any draw line, only plots are visible.
    It is working when ShowHighPointIndicators (or ShowLowPointIndicators) is set to false.

    With a RadColumnSparkline, nothing is shown but there isn't any error.

    I hope I was clear enough in my explanation.

    Thanks again for everything!


    EDIT: for the Layout cycle detected.  Layout could not complete.
    Instead of having a gridview. You can have directly a RadAreaSparkLine bound with a list of around 300 measure points (with different XValues, but same YValues) with ShowHighPointIndicators (or ShowLowPointIndicators) set to true.
  5. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 12 Jan 2011 Link to this post

    Hello Biruh MEKONNEN,

    Thank you for getting back to us!
    Indeed there is an issue in sparklines when bound to an object that has the same Y value. I have already forwarded your report to our developers for further investigation and logged this issue in our PITS system here. Your Telerik points have been updated as a token of our gratitude for helping us pinpoint this issue.

    Until there is a fix perhaps you can add a dummy item somewhere in your data. This will create a sparkline in which the delta of the range is not 0 and will break the conditions for this bug.

    Hope this helps!

    Kind regards,
    Yavor Ivanov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. cpursley
    cpursley avatar
    6 posts
    Member since:
    Jul 2007

    Posted 14 Jan 2011 Link to this post

    I am also experiencing this issue. Do you know when it will be resolved?
  7. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 20 Jan 2011 Link to this post

    Hello Chris Pursley,

    These issues are logged in our bug tracking system and will be resolved in a timely manner. You can visit our PITS system and vote to increase their priority. When they are resolved the PITS items will be updated so check them regularly.

    Regards,
    Yavor Ivanov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top
DevCraft banner