Hello
I am trying to create custom control with Grid and below XamDataChart, bars should be under the corresponding column.
The problem is. I would like to move NumericYAxis outside of XamDataChart control. and put it in FreezeArea.So Labels should be visible despite of scroll position, Scroll should affect only bars.
Could you advice?
Generally it depends on how many votes the idea gets but we don't add new features to components mid release right now. We just released 16.2 so new features won't show up till 17.1 and we have already planned our 17.1 release. So it's safe to say that any new ideas added now won't be considered until after 17.1 is released which is sometime around March or April.
Hi Rob,
I pasted an image in the above reply to illustrate the issue, although it doesn't seem to display (it did when I created it).
That aside, yes, its out by a few pixels, which is fairly critical when someone is performing an important task off the back of the numbers they are reading!
The solution is not one that I would feel comfortable including in production software, since it feels somewhat hacky. If you (Infragistics) were to change the internal margins of the grid at some point, the upgrader would need to somehow know to revisit this code (the reality is, it would likely be missed).
I would also have to dig around in the visual tree to work out if the horizontal scrollbar is shown or not and offset the left axis by its height.
If I provide an idea, what are the timescales to getting this implemented?
I shall investigate whether any other chart providers support it, or write my own.
Kind Regards,
David
Hi David,
You can submit this as a product idea here: http://ideas.infragistics.com. I can't answer as to how difficult it would be to build into the product.
How far out are we talking about? When I ran this sample locally, even with the scrollbar visible it wasn't that far from the chart. Maybe a 10 or so pixels. This is down to margins and such that exist inside the chart. You can try offsetting this by adding margin to both the left and right chart pushing them closer together.
Thanks for the response.
The y axis is out on that and even more so when the scrollbar is shown.
Would it be difficult to build this into the product?
Thanks,
Rendering two charts should be fine since the first chart representing the Y axis isn't actually rendering a series. You actually don't even need to create a series in there like I had suggested before. Just create a XamDataChart with a NumericYAxis and set the MinimumValue and MaximumValue to match the Y axis range in the second chart. Also set the PlotAreaMinWidth property to 0.
<ig:XamDataChart PlotAreaMinWidth="0"> <ig:XamDataChart.Axes> <ig:NumericYAxis x:Name="yAxisFreezeArea" MinimumValue="{Binding ElementName=yAxisScrollingArea, Path=ActualMinimumValue}" MaximumValue="{Binding ElementName=yAxisScrollingArea, Path=ActualMaximumValue}"/> <ig:NumericXAxis x:Name="xAxisFreezeArea"/> </ig:XamDataChart.Axes></ig:XamDataChart>
You can see that I have a NumericXAxis in there. This gives the necessary spacing at the bottom of this chart so the Y axis will line up with the second chart. If you want perfect alignment then your X axis should be synchronized with your second chart X axis as much as possible. In this case you may need to provide a hidden series to the above chart, but for a basic chart this may be enough.
I'm going to address your points below:
- Not sure what you mean by scaled. If you are referring to the Y axis range then it's required to manually set the minimum and maximum value to match the range on the second chart that is rendering. You can use an ElementName binding like above.
- If you use the above XAML you don't actually need to provide a series in order to get the spacing right. With no series, the X axis can't calculate a range so it is left empty.
- This is why I set PlotAreaMinWidth to 0. Not sure if it applies in your case but in my sample it works.
- Are you setting the Visibility property on the Y axis itself or in the LabelSettings? If you set it on the axis itself the chart still allocates space for it. The Visibility property inside LabelSettings is the one you want to set to Collapsed.
I didn't have a sample from when I helped the original poster, I just gave some ideas and hadn't heard back from him. I did, however, throw together a very simple example which I have attached.