Hello,
how can I hide the x Axis empty space between the chart and the scroll bar?
Hello Markus,
From the attached screenshot, I am rather curious how you are going about hiding your X axis for your XamDataChart, but from how it looks, it looks like you are setting the Visibility property of the axis itself, which would still accommodate some room for where the labels would be on your x axis. Although, unless you were setting a label extent or something along those lines, I can't see why the space would be so much.
If this is the case, and you are setting the Visibility property on your axis, I would recommend writing a new AxisLabelSettings object for your axis instead and setting the Visibility property to "Collapsed" there. This will eliminate the space allotted for the x axis labels. Assuming you are using the CategoryXAxis, sample code for this could look like the following:
<ig:CategoryXAxis><ig:CategoryXAxis.LabelSettings><ig:AxisLabelSettings Visibility="Collapsed" />
I hope this helps. Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Thank you for your answer. I am creating the chart series in code, and cannot set the .LabelSettings.Visibility, because I get an exception that is in a read only mode.
Here is the code snipped:
private void SetChart(XamDataChart chart) { var data = CreateData(); var xAxis = new CategoryXAxis(); var yAxis = new NumericYAxis(); xAxis.ItemsSource = data; chart.HorizontalZoomable = true; chart.HorizontalZoombarVisibility = Visibility.Visible; var series = new LineSeries(); series.ItemsSource = data; series.XAxis = xAxis; series.YAxis = yAxis; series.MarkerType = MarkerType.None; chart.Series.Add(series); chart.Axes.Add(xAxis); chart.Axes.Add(yAxis); //Throws exception: Cannot set property on object '.AxisLabelSettings' because it is in a read only state. //xAxis.LabelSettings.Visibility = Visibility.Collapsed; chart.WindowRect = new Rect(0.25, 1, 0.1, 1); }
Attached is the whole sample project.