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

YAxis DataLabelsField?

6 Answers 145 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Hunter
Top achievements
Rank 1
Hunter asked on 03 Jul 2012, 05:47 PM
The "Configuring the axes" section of the HtmlChart documentation seems to suggest that a YAxis DataLabelsField should exist however I can't seem to find one on the control (found the XAxis)? I'm using the bar chart type and need to show a different label value on the y axis then the incoming data (the label value is provided by my data source). Example, y value (data field) is productive days out in decimal form, while the data label needs to be a properly formatted string of productive days out (ex. Days, Hours, Minutes). Thanks.

6 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 04 Jul 2012, 07:57 AM
Hello Hunter,

Indeed this is not explained in the best way in the documentation and I will make sure it is updated.

On your question - the Y axis (if not configured explicitly) autoadjusts to accommodate the values the series have. These are all numerical values and they depend on the series' values, which is why they cannot be taken explicitly from the datasource. What  you can do is to set the MinValue and MaxValue from the code-behind according to your data. The DataFormatString for the labels on the Y axis series is also located in the LabelsAppearance inner tag and you can see it in action in this online demo (expand the Y axis configurator, on the top right is the Labels Data Format String textbox). I am sorry to say, however, that date strings are not supported at the moment and this is a significant challenge for JavaScript and this type of rendering.


Kind regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Hunter
Top achievements
Rank 1
answered on 05 Jul 2012, 04:37 PM
Thank you for the response! Just to be clear, I cannot provide an arbitrary value (ex. "Hello World") to a Y Axis Label like I can with the X Axis? In my scenario I am not interested in formatting the Y Axis value to then be displayed in the label, instead I want to provide a completely different Y label value (provided by the datasource). I can see how this wouldn't be an issue in many cases however we've used an independent y label value across our site with your standard charts and have grown accustom to them :). The new HTML Chart is a great addition and I would love to see it built upon to include this functionality. You had mentioned that date strings are not supported in the label format string and that this was a significant challenge for JavaScript/type of rendering. I'm not sure if this applies to my request but would you suggest that I add my request to PITS or is this out of scope for this control? Thanks again!
0
Accepted
Svetlina Anati
Telerik team
answered on 10 Jul 2012, 11:38 AM
Hello Hunter,

 Indeed, we currently do not provide ability to bind labels to different database information. The scenario you say is a bit unusual because usually the labels should be related to the values. We are planning to add template features for the labels and once this is available, you will be able to modify the values with additional strings.

Providing a  template, however, will not provide the ability to bind the labels and we are not sure how useful adding such ability is. That is why we decided to create a PITS issue based on your suggestion, so that we can gather feedback about it and we will decide whether to add it as feature and when based on that.

Here you can find the PITS Issue: Public URL

As to the datetime formatting, if you want to format the labels of XAxis with a date format string, this is easy and possible through the property in mention. For Y axis this is not possible due to the fact that it is numeric only for the time being, while the X axis is categorical /uses strings/.

I hope that my reply is helpful, let us know how it goes.

Regards,
Svetlina Anati
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Hunter
Top achievements
Rank 1
answered on 10 Jul 2012, 11:04 PM
Thank you for the help on this, I appreciate it. While the template doesn't give me binding, I am interested in seeing how I might be able to leverage this in my scenario. Thank you again.
0
Jeff
Top achievements
Rank 1
answered on 31 Jan 2014, 08:41 PM
I too would like to see this. I have to display a chart where the values are pretty arbitrary but I need to show whether something is good option or not.

0
Danail Vasilev
Telerik team
answered on 03 Feb 2014, 03:33 PM
Hello Jeff,

I have already replied to the same question asked by you in this forum thread, so that we can continue our discussion there.

Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Chart (HTML5)
Asked by
Hunter
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Hunter
Top achievements
Rank 1
Svetlina Anati
Telerik team
Jeff
Top achievements
Rank 1
Danail Vasilev
Telerik team
Share this question
or