Second series summed and template dataItem

4 posts, 1 answers
  1. David
    David avatar
    16 posts
    Member since:
    Aug 2014

    Posted 23 May Link to this post

    First thank you Veselin Tsvetanov for your help in my previous questions. I did not expect the api would return a long as a string instead of a number so your help was greatly appreciated. 

    To increase the size of the graph we have to just go with the Code instead of the CodeDesc. However, we would like for the CodeDesc to still appear when the user does a mouseover in the template. I have <div>dataItem.CodeDesc</div><br/> where it would be. I tried #: dataItem.CodeDesc # but it did not recognize dataItem. So I was wondering if I can still grab dataItems from the DataSource in the template. 

    The next item is concerning the column of CountReqs. Currently the TotalValue column is grouped, is it possible to also group CountReqs at the same time? It appears that if I do a label of CountReqs it grabs the first CountReqs it finds and displays that when the label should be a summation of CountReqs. The second item is in relation to grabbing the CountReqs in the template to also display the number next to the TotalValue. I have the placeholder as \\#\\# Opportunities.

    My sample is at http://dojo.telerik.com/@dhighfield/EfuVA. Please update at will.

    Thank you in advance for your assistance.

     

    v/r,

    Dave Highfield

  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    119 posts

    Posted 25 May Link to this post

    Hi David,

    Please see my answers below:

    1.) Accessing dataItem ​in the Kendo UI Chart template
     
    There are two separate Kendo UI Chart Tooltip template configurations - template and sharedTemplate which reveal different fields.

    - Shared template - to access points and category. This is why you cannot display dataItem in your Dojo example

    http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart#configuration-tooltip.sharedTemplate

    - Template - to access category, dataItem, series, value, runningTotal, total

    http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart#configuration-tooltip.template

    2.) I am not sure whether I fully understand the specifics of the scenario, and the desired functionality of the Kendo UI Chart. If you would like to group and stack the data, a demo showing how to use stacked and grouped bars can be found here:

    http://demos.telerik.com/kendo-ui/bar-charts/grouped-stacked-bar

    Should this not suffice, please provide a more detailed explanation so I can assist you further.

    Kind Regards,
    Alex
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. David
    David avatar
    16 posts
    Member since:
    Aug 2014

    Posted 13 Jun in reply to Alex Hajigeorgieva Link to this post

    I've updated the example with your suggestions and it can be found at http://dojo.telerik.com/@dhighfield/EfuVA/2. The popup is not displaying the content as desired. The attached images hopefully give a clearer picture as to what I am trying to achieve. 

    With regards to the second question, if you mouseover on the first column in aforementioned example it will display only 332 opportunities. This should be 336 opportunities based on the column CountReqs in the sample data. The control appears to grab the first record. I am attempting to sum two columns though - CountReqs and TotalValue. So far I am able to only sum the one - TotalValue.

    v/r,
    Dave Highfield

  5. Answer
    Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    119 posts

    Posted 15 Jun Link to this post

    Hi David,

    The Kendo UI Chart calculates aggregates by only one value field out of the box. TotalValue is the respective value field in the provided configuration, that is why it gets calculated correctly. To calculate aggregates by other value fields simultaneously, some custom coding will be required.

    I have updated the Dojo example to show you how to calculate CountReqs. I used the Kendo UI DataSource group aggregate configuration but the data can come from anywhere - remote service, dynamic calculation, etc. - whatever suits the scenario.

    http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-group.aggregates.aggregate

    For your convenience, please find a proof of concept example below:

    http://dojo.telerik.com/ARasE

    Kind Regards,
    Alex
    Telerik
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready