How to fix plot area width and yAxis position

4 posts, 0 answers
  1. EY
    EY avatar
    7 posts
    Member since:
    Nov 2014

    Posted 04 Dec 2014 Link to this post

    I have a TKChartAreaSeries and implemented data source protocol.
    I can display the chart and change its datapoints by using a segmented button and reloading the chart.

    As I change the datapoints using the segmented button and reload the chart, yAxis item labels resize themselves horizontally (increase or decrease widths considering the value they are going to display) and yAxis position gets changed. 
    So the does the plot area. Its size increases or decreases horizontally following yAxis position.

    What I want is to have fixed yAxis position and plot area size, no matter what datapoints it displays.

    Actually I can achieve that behaviour by using TKChartLineSeries instead of TKChartAreaSeries, but it is not possible to fill under the line with a color as in TKChartAreaSeries.

    So, I need a way to fix plot area size and y axis position for TKChartAreaSeries, or a way to fill under the TKChartLineSeries with a color.


    And is there a setting axis item label positions. I don't mean axis' own title label. I mean axis item labels (major, minor) and positioning them on the left side of the yAxis or the right side. The same goes for the xAxis positioning below or above.
  2. Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 05 Dec 2014 Link to this post

    Hi Erkan,

    The easiest way to have fixed axis that is not dependant on its ticks width is to align the axis line on the outer side of the chart and the axis labels on the inner side. This can be achieved by using textAlignment property of TKChartAxisLabelStyle. This property is responsible for aligning the labels on left or right side of the y axis and above or below the x axis. The code snippet below shows how to align the labels on the right side of left position y axis, so that the axis position will always be fixed:
    _chart.yAxis.style.labelStyle.textAlignment = TKChartAxisLabelAlignmentRight;

    Here is an example how to align the x axis labels above the axis:
    _chart.xAxis.style.labelStyle.textAlignment = TKChartAxisLabelAlignmentTop;

    I hope this helps. If you have further questions, I will be glad to assist you.

    Regards,
    Adrian
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
  4. EY
    EY avatar
    7 posts
    Member since:
    Nov 2014

    Posted 05 Dec 2014 in reply to Adrian Link to this post

    Thanks, it kinda works.

    Can I achieve the same when the labels are on the left side of the axis.
    I don't want that labels to resize in width, they should have fix size and position and adjust their font size regarding their value.

    Is it possible?

    I had a look at TKChartAxisLabelFitMode's but there is not an option like AutoResizeFont, only Rotate and MultiLine.

  5. Adrian
    Admin
    Adrian avatar
    167 posts

    Posted 08 Dec 2014 Link to this post

    Hi Erkan,

    Currently axis labels do not support this functionality. I logged your suggestion in our feedback portal and we will consider implementing it in a future version. Feel free to vote/comment the issue. I updated also your Telerik points for this suggestion.

    If you have other questions, I will be glad to help.

    Regards,
    Adrian
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner