Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

wpf axes label font size

Solved!
Go to solution

Please is it possible to make the label size in a wpf image smaller or larger?

 

Thank you.

0 Kudos
Message 1 of 3
(5,625 Views)
Solution
Accepted by topic author falopsy

If you want to set the size of all text elements in the graph, you can change the FontSize on the graph:


    <ni:Graph FontSize="22" ...>


If you want to set the size of the major division labels, you can change the FontSize on the LabelPresenter for the MajorDivisions:


    <ni:AxisDouble ...>
        <ni:AxisDouble.MajorDivisions>
            <ni:RangeLabeledDivisions>
                <ni:RangeLabeledDivisions.LabelPresenter>
                    <ni:GeneralValueFormatter FontSize="22" />
                </ni:RangeLabeledDivisions.LabelPresenter>
            </ni:RangeLabeledDivisions>
        </ni:AxisDouble.MajorDivisions>
    </ni:AxisDouble>


Or if you want to set the size of the axis label, you can use a custom LabelTemplate:


    <ni:AxisDouble Label="Label" ...>
        <ni:AxisDouble.LabelTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding}" FontSize="22" />
            </DataTemplate>
        </ni:AxisDouble.LabelTemplate>
    </ni:AxisDouble>

~ Paul H
0 Kudos
Message 2 of 3
(5,618 Views)

Thank you very mush Paul.  That solved my problem.

0 Kudos
Message 3 of 3
(5,596 Views)