2014年7月13日 星期日

[RESOLVED] Display chart y axis titles on top of chart


Hi,


     How to display the chart Y axis in the top of chart? 














Im having months in the y axis. How to move this to top? Also is there a way to display the each bar value in bottom of bars?





hi ,


From what I understand  that you want to display chart y axis titles on top of chart.


I would suggest you to follow the workground:


1.the HTML source :



BorderWidth = "2" BorderColor = "#cc9900" OnLoad="ChartBar_Load" >


















2.the  code-behind below :


public void BingData()

{

this.ChartBar.ChartAreas[0].AxisX.MajorGrid.Enabled = false;

this.ChartBar.ChartAreas[0].AxisY.MajorGrid.Enabled = false;

// 1.Custom User Attributes but display axes

this.ChartBar.ChartAreas[0].AxisY.CustomLabels.Add(1, 1, "1");

this.ChartBar.ChartAreas[0].AxisY.CustomLabels.Add(2, 2, "2");

this.ChartBar.ChartAreas[0].AxisY.CustomLabels.Add(3, 3, "3");

//2.disabled AxisY not display axes

//this.ChartBar.ChartAreas[0].AxisY.Enabled = AxisEnabled.False;

this.ChartBar.Width = 300;

this.ChartBar.Height = 300;

Series myHorizontalSeries = new Series();

myHorizontalSeries.Color = System.Drawing.Color.Blue;

myHorizontalSeries.ChartType = SeriesChartType.Bar;

myHorizontalSeries.IsValueShownAsLabel = true;

myHorizontalSeries.Points.DataBindXY(new string[] { "one", "two","three" }, new int[] { 1, 2, 3 });

this.ChartBar.Series.Add(myHorizontalSeries);

}

If you need more assistance ,please let me know.


沒有留言:

張貼留言