Articles in this section
Category / Section

How to change the color of Chart axis header?

1 min read

You can change the color of Chart axis header as follows.


public partial class MainPage : UserControl
        private IOlapDataProvider dataProvider;
        public object OlapDataManager;
        public MainPage()
            this.olapChart1.OnDataRefreshCompleted += new OlapChart.DataRefreshCompleted(olapChart1_OnDataRefreshCompleted);
        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_OnDataRefreshCompleted(object sender, DataRefreshCompletedEventArgs e)
            TextBlock tb = new TextBlock();
            tb.Text = "test";
            tb.Foreground = new SolidColorBrush(Colors.Red);
            this.olapChart1.OlapArea.SecondaryAxis.Header = tb;


    Partial Public Class MainPage
    Inherits UserControl
    Private dataProvider As IOlapDataProvider
    Public OlapDataManager As Object
    Public Sub New()
                Me.olapChart1.OnDataRefreshCompleted += New OlapChart.DataRefreshCompleted(olapChart1_OnDataRefreshCompleted)
    End Sub
    Private Sub InitializeConnection()
            Binding customBinding = New CustomBinding(New BinaryMessageEncodingBindingElement(), New HttpTransportBindingElement 
        MaxReceivedMessageSize = 2147483647
        Dim address As EndpointAddress = New EndpointAddress("")
            Dim clientChannel As ChannelFactory<IOlapDataProvider> =  New ChannelFactory<IOlapDataProvider>(customBinding,address) 
        dataProvider = clientChannel.CreateChannel()
        Dim olapDataManager As OlapDataManager = New OlapDataManager()
        olapDataManager.DataProvider = dataProvider
        Me.OlapDataManager = olapDataManager
    End Sub
Private  Sub olapChart1_OnDataRefreshCompleted(ByVal sender As Object, ByVal e As DataRefreshCompletedEventArgs)
        Dim tb As TextBlock = New TextBlock()
        tb.Text = "test"
        tb.Foreground = New SolidColorBrush(Colors.Red)
        Me.olapChart1.OlapArea.SecondaryAxis.Header = tb
End Sub


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