This is a migrated thread and some comments may be shown as answers.

Add notes dynamically on line chart (not stock chart) category axis

2 Answers 314 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Raghu
Top achievements
Rank 1
Raghu asked on 17 May 2014, 12:00 AM
Hi,

I'm trying to display hourly data on a line chart for multiple days.

Currently the CategoryAxis just displays the time (hour) which is what I want, How can i add a note on category axis with full date? (at each day 24:00 hour interval)

I saw some example in forum which add static notes on the category axis.

is there a way to add the note dynamically? (with Javascript/html code)

Thanks!

2 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 20 May 2014, 01:49 PM
Hello,

The axis notes currently can't be bound to a data source so the only option is to use setOptions to update them:
    chart.setOptions({
      categoryAxis: {
        notes: {
          data: notesData
        }
      }
    });

-- Live demo --

I hope this helps.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Raghu
Top achievements
Rank 1
answered on 27 May 2014, 06:10 PM
Thanks. That works!

        var notesData = [{
            value: new Date("01/01/2010"),
            label: {
                text: (new Date("01/01/2010")).getFullYear(),
                font: "10px sans-serif"
            }
        }];
Tags
Charts
Asked by
Raghu
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Raghu
Top achievements
Rank 1
Share this question
or