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

how to make the beginning and end label of Y-Axis editable

3 Answers 77 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
mao
Top achievements
Rank 1
mao asked on 04 Oct 2016, 02:49 PM

how to make  the beginning and end label  of Y-Axis editable (if could assgin a template to edit, it will be nicer)

 

Thank you

3 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 07 Oct 2016, 07:34 AM
Hello Mao,

In order to change the appearance of the first and last label of the axis you can use its LabelTemplateSelector property and based on a condition (if first or last label in your case) choose a different template. 

About the "editable" part, I am not sure what exactly you want to edit? Note that if you edit the values of the first and last labels without editing the labels between them the visualization will be incorrect. In order to make the edit meaningful in a numeric axis, you might need to also update the Minimum/Maximum and the MajorStep of the axis.

Regards,
Martin
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
mao
Top achievements
Rank 1
answered on 07 Oct 2016, 02:45 PM
Thank you so much, Martin. LabelTemplateSelector is doing its work. But how to know the label is the first or the end? Thank you
0
Accepted
Martin Ivanov
Telerik team
answered on 10 Oct 2016, 07:02 AM
Hi Mao,

This depends on the set up of the axis - the minimum, maximum and the major step. You can get or set those via the Maximum, Minimum, MajorStep, ActualRange, ActualMajorStep properties. You can use the properties to set up or calculate the first/last label. 

Another approach could be to get the first and the last text blocks representing the labels in the visual tree of the axis.

Regards,
Martin
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
ChartView
Asked by
mao
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
mao
Top achievements
Rank 1
Share this question
or