12-10-2012 03:14 AM
How do I configure the graph to show only first and last label on the axis? I think it's somehow should be done by modifying RangeLabeledDivisions.Mode property...
<ni:AxisDouble x:Name="horizontalAxis1" Orientation="Horizontal" Label="X" BaselineStroke="{x:Null}"> <ni:AxisDouble.MinorDivisions> <ni:RangeDivisions TickVisibility="Hidden" /> </ni:AxisDouble.MinorDivisions> <ni:AxisDouble.MajorGridLines> <ni:GridLines Stroke="{StaticResource GraphGridLinesColorBrush}" /> </ni:AxisDouble.MajorGridLines> <ni:AxisDouble.MajorDivisions> <ni:RangeLabeledDivisions TickVisibility="Hidden"> <ni:RangeLabeledDivisions.LabelPresenter> <ni:GeneralValueFormatter Format="0.00" /> </ni:RangeLabeledDivisions.LabelPresenter> </ni:RangeLabeledDivisions> </ni:AxisDouble.MajorDivisions> </ni:AxisDouble>
Solved! Go to Solution.
12-10-2012 09:44 AM
You can set the Mode
on the MajorDivisions
to a Count mode of two:
<ni:AxisDouble.MajorDivisions>
<ni:RangeLabeledDivisions Mode="Count: 2" TickVisibility="Hidden">
...
</ni:RangeLabeledDivisions>
</ni:AxisDouble.MajorDivisions>
This will show just the minimum and maximum divisions for the range.
12-10-2012 10:03 AM
thanks!
How do I make left label aligned left at 0 and right label aligned right at max? Now they both are aligned center.
12-10-2012 10:12 AM
Have a look at this question.
12-10-2012 10:57 AM
got it, works!
12-11-2012 05:37 AM
Another clarification: when I use count:2, all gridlines are also gone. How can I get both gridlines and 2 labels?
12-11-2012 09:15 AM
The grid lines are tied to the major divisions shown by the axis. To show the divisions without the labels, you can leave Mode
set to Auto
and use the opacity technique from the hide labels question, switching the logic so the opacity is changed for the non-extreme labels.