kendo pie & angular - tooltip & labels templates issue

6 posts, 0 answers
  1. Lev
    Lev avatar
    6 posts
    Member since:
    Jun 2016

    Posted 14 Jun Link to this post

    Hi!

    Environment

    2016.2.607 version

    Latest Chrome (Windows)

     

    kendo pie & angular -  tooltip & labels templates issue

    I configured pie chart with code below 

    tooltip: {
                    visible: true,
                    template: "#= year # - test"
                },
                labels: {
                    template: "#= year # - test",
                    position: "outsideEnd",
                    visible: true,
                    background: "transparent"
                }

    part 1 - labels template commented, kendo fails to create tooltips template (Line 48)

    http://codepen.io/lev-savranskiy/pen/dXMErZ?editors=1000

    part 2- when labels template uncommented , kendo fails completely

    http://codepen.io/lev-savranskiy/pen/xOVowL?editors=1000

     

    Any ideas?

     

    THanks

     

     

     

     

  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 16 Jun Link to this post

    Hi Lev,

    In the tooltip / labels templates you could reach the original data via the dataItem. I.e. the correct configuration is:
    //....
    tooltip: {
          visible: true,
          template: "#= dataItem.year # - test"
    },
    labels: {
          template: "#= dataItem.year # - test",
          position: "outsideEnd",
          visible: true,
          background: "transparent"
    }
     

    Regards,
    Iliana Nikolova
    Telerik
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
  4. Lev
    Lev avatar
    6 posts
    Member since:
    Jun 2016

    Posted 16 Jun in reply to Iliana Nikolova Link to this post

    i see this doc. where is dataItem?
  5. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 20 Jun Link to this post

    Hi Lev,

    You should use the dataItem field to reach the original point data. Take a look at the updated example: 

    http://dojo.telerik.com/@Iliana/uJeQe

    Regards,
    Iliana Nikolova
    Telerik
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  6. Lev
    Lev avatar
    6 posts
    Member since:
    Jun 2016

    Posted 20 Jun in reply to Iliana Nikolova Link to this post

    i repeat.

    i do not see dataitem in official documentatio

    http://demos.telerik.com/kendo-ui/pie-charts/index

    i do not quite understand why i should browse forums to get answers which should be described in API

     

    thanks

  7. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 22 Jun Link to this post

    Hi Lev,

    As pointed in the online documentation, in series.labels.template you could directly reach category and value - in the online demo which you pointed these are respectively continents and values. In the dojo examples which you provided "year" is none of these - therefore you need to use the dataItem to reach it in the template.

    Regards,
    Iliana Nikolova
    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