cant access dataItem properties in chart.series.notes.label.template

2 posts, 0 answers
  1. Morten
    Morten avatar
    304 posts
    Member since:
    Jul 2012

    Posted 20 Jan 2016 Link to this post

    after upgrading to "2016.1.118" my code (see below) produce an "Uncaught TypeError: Cannot read property 'date' of undefined" when trying to access dataItem properties in chart.series.notes.label.template:

    The code:

    var devChart = $("#chart").kendoStockChart({
        theme: "bootstrap",
        dataSource: chartDs,
        dateField: "date",
        series: [{
            type: "line",
            style: "smooth",
            field: "pct",
            noteTextField: "date", // keep, however overruled by label.template
            notes: {
                position: "bottom",
                icon: {
                    visible: false
                label: {
                    color: "white",
                    border: {
                        dashType: "dash"
                    background: "#777",
                    rotation: -90,
                    position: "inside",
                    template: "#:kendo.toString(category, 'dd-MMM-yyyy')#" // this code works in "2016.1.118" version
                    //template: "#:kendo.toString(, 'dd-MMM-yyyy')#" // this code worked in pre-"2016.1.118" version


    My dataset:

    [{"rId":6789,"date":"2015-05-06T12:28:33.643+02:00","max":160.00,"score":140.0,"pct":88.0,"survey":"survey 1"},{"rId":7228,"date":"2015-05-29T11:14:42.047+02:00","max":160.00,"score":150.0,"pct":94.0,"survey":"survey 1"},{"rId":9590,"date":"2015-08-11T13:53:27+02:00","max":160.00,"score":160.0,"pct":100.0,"survey":"survey 1"},{"rId":12770,"date":"2015-10-02T10:53:55+02:00","max":160.00,"score":140.0,"pct":88.0,"survey":"survey 1"},{"rId":14890,"date":"2015-10-28T12:41:27+01:00","max":160.00,"score":140.0,"pct":88.0,"survey":"survey 1"},{"rId":16222,"date":"2015-11-06T13:12:12+01:00","max":365.00,"score":365.0,"pct":100.0,"survey":"survey 2"}]

  2. EZ
    EZ avatar
    65 posts
    Member since:
    May 2015

    Posted 21 Jan 2016 Link to this post

    It seems like the date in the dataItem is not being parsed properly. You can change your template to


    template: "#:kendo.toString(kendo.parseDate(, 'dd-MMM-yyyy')#"   

     Even better is to add an explicit schema to the datasource specifying that the field is a date:

    dataSource: {
        data: chartDS,
        schema: {
          model: {
              fields: {
                  date: {
                      type: "date"


    Here is a DOJO demo

Back to Top