YAxis DataLabelsField?

7 posts, 1 answers
  1. Hunter
    Hunter avatar
    44 posts
    Member since:
    Aug 2012

    Posted 03 Jul 2012 Link to this post

    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.
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 04 Jul 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Hunter
    Hunter avatar
    44 posts
    Member since:
    Aug 2012

    Posted 05 Jul 2012 Link to this post

    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!
  5. Answer
    Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 10 Jul 2012 Link to this post

    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.
  6. Hunter
    Hunter avatar
    44 posts
    Member since:
    Aug 2012

    Posted 10 Jul 2012 Link to this post

    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.
  7. Jeff
    Jeff avatar
    5 posts
    Member since:
    Jan 2014

    Posted 31 Jan 2014 Link to this post

    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.

  8. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 03 Feb 2014 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017