Minimum value at lineseries with label not at the left

Charts for WPF Forum

Posted 6 years ago by Lukas Lober
Version: 14.1.0601
Avatar

Hi,

I´m trying to do something like you can see in this picture (this is an example from another wpf library). I want the minimum value starting at the yaxis. 

Image and video hosting by TinyPic

 If I try that with your chart control there is always the label at the left. And if the label is very large there is also a large gap between the yaxis and the first marker.

Image and video hosting by TinyPic

 

Is there any possibility that it looks like the first picture? (Version is 13.2.591.0)

[Modified 6 years ago]

Comments (3)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Lukas,

Right now there are two main areas that contribute to the whitespace there. 

The first is the XYChart.PaddingPercentage property.  Setting that to zero removes the padding that by default is present around plotted data.  It defaults to 5%.

The second is the label positioning.  In the case you show, the label positioner determines that near half of the label would normally extend past the axis if PaddingPercentage = 0.  So it forces the resolved padding to be increased such that the label doesn't cross the axis.  That is the main logic that causes the problem for your scenario.

What do you think the ideal solution for this is?  Do all other chart libraries that you have used make sure the labels near the left/right always "slide in" instead of centering over the target data point?  It seems like that might not be something people always want to do.

Any information you can provide here would be helpful.


Actipro Software Support

Posted 6 years ago by Lukas Lober
Avatar

Hey,

I don´t have used much chart controls yet but now I need one and I´m looking for that one which includes the most of my needs.

The problem is that I want to use this chart control inside a timeline control. And for that the marker should be at the right time because otherwise the data which is shown doesn´t equals to the the time.

A good solution for me and maybe for others who doesn´t need this would be do make a property like "ForcePadding".

If ForcePadding = false you could check if a label is outside of the bounds(only Xaxis) and if so move it(only the label) along the Xaxis for the value it is outside so that it is inside and than recalculate the positions of the labels to check if there are collisions. 

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Lukas,

I suppose I should ask which of these two options you prefer:

1) An option to do what we do now, where if a label would extend outside of the plot area, it would add more padding around the chart area so that the label fits.  When that option was off, it would ignore labels when measuring and would just use whatever explicit PaddingPercentage was set.  Labels would remain in their default locations, where a minor possible downside here is that long labels might extend over the axes or outside of the charts itself.  That might not be a problem though if you are only showing them on mouse hover.

OR

2) The general logic remains as it is now but another option to try and get labels to not overlap the plot area by sliding them from the edges such as in the scenario you mentioned.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.