I have a custom panel that I need to add some gridlines to. Since I am an infragistics customer, I thought it would be cool to use an empty XamChart and just set the X axis to the min and max that I have.
But so far, the xamchart always shows some default data. Is it possible to just display the X axis gridline?
unfortunately there isn't a way to get rid of this space in the chart... however you can work around this limitation by using a panel to hide the sides of the chart.
<Canvas Height="100" Width="100"> <igChart:XamChart Height="105" Width="115" Canvas.Left="-12" Canvas.Top="-3"> <igChart:XamChart.Series> <igChart:Series ChartType="Bar" /> </igChart:XamChart.Series> <igChart:XamChart.Axes> <igChart:Axis AxisType="PrimaryY" Visible="True" StrokeThickness="0"> <igChart:Axis.MajorTickMark> <igChart:Mark Visible="False" /> </igChart:Axis.MajorTickMark> </igChart:Axis> <igChart:Axis AxisType="PrimaryX" Visible="True" AutoRange="False" Minimum="1" Maximum="2" Unit=".5" StrokeThickness="0"> <igChart:Axis.MajorGridline> <igChart:Mark Visible="False" /> </igChart:Axis.MajorGridline> <igChart:Axis.MajorTickMark> <igChart:Mark Visible="False" /> </igChart:Axis.MajorTickMark> </igChart:Axis> </igChart:XamChart.Axes> <igChart:XamChart.Legend> <igChart:Legend Visible="False" /> </igChart:XamChart.Legend> </igChart:XamChart> </Canvas>
Hi David, thanks for the response!
So this only kind of gets me there- but I dont really know how to use the xamChart very well yet.
The problem is that I have a custom panel needing this grid line. In the example above, the x axis is still bordered on both sides by a significant margin, as well as needing a height > 100 to actually show the labels.
What I am looking for is a control where the width = 100% of the available space, and the labels are still visible even if the axis control is only 50 high or so.
Maybe xamChart can do this and I just dont know how?
this is possible, but you need to fake the chart out by adding an empty series to it.
<igChart:XamChart> <igChart:XamChart.Series> <igChart:Series ChartType="Bar" /> </igChart:XamChart.Series> <igChart:XamChart.Axes> <igChart:Axis AxisType="PrimaryY" Visible="False" /> <igChart:Axis AxisType="PrimaryX" Visible="False" /> </igChart:XamChart.Axes> <igChart:XamChart.Legend> <igChart:Legend Visible="False" /> </igChart:XamChart.Legend> </igChart:XamChart>