Click here to Skip to main content
15,909,530 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Kindly find my following code,
C#
protected void Page_Load(object sender, EventArgs e)
        
            if (!IsPostBack)
            {
                BindChart();
            }
            
        }
        protected void BindChart()
        {
            string[] counteries = { "India", "Sri Lanka", "England", "South Africa"};
            int[] ODIpoints = {60,40,50,30};
            Chart1.Series[0].Points.DataBindXY(counteries,ODIpoints);
            Chart1.Series[0].ChartType = SeriesChartType.Column;          
            Chart1.ChartAreas[0].AxisX.Maximum = 120;
            Chart1.ChartAreas[0].AxisX.Minimum = 20;
            Chart1.ChartAreas[0].AxisX.ScaleBreakStyle.Enabled = true;
            Chart1.ChartAreas[0].AxisX.ScaleBreakStyle.StartFromZero = StartFromZero.No;          
            Chart1.ChartAreas[0].AxisY.IsReversed = true;
            Chart1.Series[0].XAxisType = AxisType.Secondary;
            Chart1.Series[0].YAxisType = AxisType.Primary;        

        }


this produced the output which reversed the Y-Axis values but my column rendered as up side down So I want to show the column down side up,
like, should started from maximum value of Y-Axis ,
please help me.
Posted
Comments
kbrandwijk 3-Sep-14 9:38am    
The problem described does not correspond to the title, or I'm misunderstanding your problem

1 solution

Untested solution. Add Crossing property to the Y-Axis to move the X-Axis to the top:
C#
Chart1.ChartAreas[0].AxisY.Crossing = Double.Minimum;
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900