Articles in this section
Category / Section

How to change the OLAP Chart axis label font-size in Silverlight ?

2 mins read

You can change the font-size of axis label text by using the LabelFontSize property.


public partial class MainPage : UserControl
        private IOlapDataProvider dataProvider;
        public object OlapDataManager;
        public MainPage()
            this.olapchart1.Loaded += new RoutedEventHandler(olapchart1_Loaded);
        private void InitializeConnection()
            Binding customBinding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement { MaxReceivedMessageSize = 2147483647 });
            EndpointAddress address = new EndpointAddress("");
            ChannelFactory<IOlapDataProvider> clientChannel = new ChannelFactory<IOlapDataProvider>(customBinding, address);
            dataProvider = clientChannel.CreateChannel();
            OlapDataManager olapDataManager = new OlapDataManager();
            olapDataManager.DataProvider = dataProvider;
            this.OlapDataManager = olapDataManager;
        void olapChart1_Loaded(object sender, RoutedEventArgs e)
            this.olapChart1.OlapArea.Loaded += new RoutedEventHandler(OlapArea_Loaded);
        void OlapArea_Loaded(object sender, RoutedEventArgs e)
            this.olapChart1.OlapArea.SecondaryAxis.LabelFontSize = 5.0d;



Partial Public Class MainPage
                Inherits UserControl
                Private dataProvider As IOlapDataProvider
                Public OlapDataManager As Object
                Public Sub New()
                                AddHandler olapchart1.Loaded, AddressOf olapchart1_Loaded
                                End Sub
                                Private Sub InitializeConnection()
                                Dim customBinding As Binding = New CustomBinding(New BinaryMessageEncodingBindingElement(), New HttpTransportBindingElement With {.MaxReceivedMessageSize = 2147483647})
                                Dim address As EndpointAddress = New EndpointAddress("")
                                Dim clientChannel As ChannelFactory(Of IOlapDataProvider) = New ChannelFactory(Of IOlapDataProvider)(customBinding, address)
                                dataProvider = clientChannel.CreateChannel()
                                Dim olapDataManager As OlapDataManager = New OlapDataManager()
                                olapDataManager.DataProvider = dataProvider
                                Me.OlapDataManager = olapDataManager
                                End Sub
                                Private Sub olapChart1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
                                AddHandler olapChart1.OlapArea.Loaded, AddressOf OlapArea_Loaded
                                End Sub
                                Private Sub OlapArea_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
                                Me.olapChart1.OlapArea.SecondaryAxis.LabelFontSize = 5.0R
                                End Sub
End Class


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment