This is a migrated thread and some comments may be shown as answers.

Chart - Why can't I set the X and Y axis labels?

1 Answer 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 04 Oct 2012, 04:41 PM
I have tried visually and in code.
Why doesn't this work?   thx

    this.tableELECTRIC.DataSource = sqlData;

            this.chartELECTRIC.PlotArea.XAxis.AxisLabel.TextBlock.Text = "Month";
            this.chartELECTRIC.PlotArea.XAxis.AxisLabel.TextBlock.Appearance.TextProperties.Color = System.Drawing.Color.Navy;
            this.chartELECTRIC.PlotArea.XAxis.Appearance.Width = 3;


            this.chartELECTRIC.PlotArea.YAxis.AxisLabel.TextBlock.Text = "KWH";
            this.chartELECTRIC.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.TextProperties.Color = System.Drawing.Color.Navy;
            this.chartELECTRIC.PlotArea.YAxis.Appearance.Width = 3;

1 Answer, 1 is accepted

Sort by
0
Hadib Ahmabi
Top achievements
Rank 1
answered on 09 Oct 2012, 07:41 AM
The first thing i notice is that in the first line you use tableELECTRIC and from then on chartELECTRIC.
Additionally, if you use chart skin, some of the chart properties are overridden run-time, so you need to set the programmatically in the constructor, after the InitializeComponent() call. 

Tags
General Discussions
Asked by
Jon
Top achievements
Rank 1
Answers by
Hadib Ahmabi
Top achievements
Rank 1
Share this question
or