Click here to Skip to main content
16,018,294 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
i want to show the values of AxisY on right hand side of line chart.

Is it possible ? is there any properties to change

What I have tried:

searched on google but dint find answer.

Chart1.ChartAreas(0).AxisY.Minimum = V_Low
       Chart1.ChartAreas(0).AxisY.Maximum = V_High
       Chart1.ChartAreas(0).AxisX.LabelStyle.Angle = -90
       Chart1.Series("DayClose").BorderWidth = 3


       Chart1.ChartAreas(0).AxisX.MajorGrid.LineColor = Color.LightGray
       Chart1.ChartAreas(0).AxisY.MajorGrid.LineColor = Color.LightGray


       Dim axis = Chart1.ChartAreas(0).AxisX
       Dim yxis = Chart1.ChartAreas(0).AxisY

       axis.Interval = 1

       If V_Range < 40 Then
           yxis.Interval = 1

       Else
           yxis.Interval = CDec(Math.Truncate(V_Range / 40))

       End If
Posted
Updated 23-Sep-23 4:38am
v2
Comments
Graeme_Grant 23-Sep-23 10:25am    
You know that we can't see your code if you don't post it? We also can't view your screen. Also, you do not tell us what type of app or what chart library that you are using.

To quote the help in the yellow box where you post your question:

A few simple rules when posting your question.

1. Be courteous. Everyone here helps because they enjoy helping, not because it's their job.
2. Have you searched or Googled for a solution?
3. Be specific! eg "How do I change the dialog colour?" instead of "My code doesn't work. Help?"
4. Tag your question appropriately.
5. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
6. Do not remove or empty a message if others have replied.
7. Your question may be edited or retagged by others. Anything inappropriate will be removed.

1 solution

Try:
VB
Chart1.ChartAreas(0).AxisY.Enabled = AxisEnabled.[False]
Chart1.ChartAreas(0).AxisY2.Enabled = AxisEnabled.[True]
 
Share this answer
 
Comments
pravin9455 23-Sep-23 14:43pm    
getting error

'AxisEnabled' is not declared. It may be inaccessible due to its protection level.
OriginalGriff 23-Sep-23 15:15pm    
Or you haven't included it's containing class in your Using statements ... you could use it's full name: https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.datavisualization.charting.axisenabled?view=netframework-4.8.1

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