-
Mar 30th, 2018, 11:40 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] MS Chart tick mark labels help
I cant figure out where the setting is to specify the value for the label tick marks on the X axis. Could someone please point me in the right direction?
Thanks
~Frab
-
Mar 30th, 2018, 01:22 PM
#2
Re: MS Chart tick mark labels help
you mean the labels along the x axis? if bound to a datatable you set the .XValueMember for one of your series.
-
Mar 30th, 2018, 02:47 PM
#3
Thread Starter
Hyperactive Member
Re: MS Chart tick mark labels help
Here is the problem. I have the scale on the X axis not continuing to the end of the graph (please see image). I thought that maybe I had changed the X axis somewhere in the programming because the Y axis is fine. I checked the .XValueMembers for both Y and X and they are the same. What else could cause this?
-
Mar 30th, 2018, 03:15 PM
#4
Re: MS Chart tick mark labels help
How did you set up the chart.
Your Y tick marks are on 100 unit boundaries, I wonder if your chart's X size is also based on being on a 100 boundary.
The chart itself looks to be 300 wide, so 285 shows up where it is suppose to be on a 300 unit wide chart.
-
Mar 30th, 2018, 03:51 PM
#5
Thread Starter
Hyperactive Member
Re: MS Chart tick mark labels help
The chart is setup as 300x8000. Yes it is graphing correctly, but the 285 tick mark is bothering me. I would like it to be on the end of the graph and cant figure out why its not.
I tried to add in 'Chart1.ChartAreas(0).AxisX.LabelStyle.IsEndLabelVisible = True' but to no avail.
Best case I would prefer multiple tick marks like on the Y axis. I just cant figure out what setting I have/need to change to get this result.
-
Mar 30th, 2018, 04:34 PM
#6
Addicted Member
Re: MS Chart tick mark labels help
If you want to set the chart maximum and grid lines manually you could do the following at run time (form load event) or you could do it by modifying the chart axis properties at design time. Uncomment the MinorGrid.Interval property if you need another level of measurement.
Code:
With Chart1.ChartAreas(0).AxisX
.Minimum = 0
.Maximum = 300
.MajorGrid.Interval = 5
'.MinorGrid.Interval = 1
End With
-
Mar 30th, 2018, 04:40 PM
#7
Thread Starter
Hyperactive Member
Re: MS Chart tick mark labels help
Originally Posted by Mc_VB
If you want to set the chart maximum and grid lines manually you could do the following at run time (form load event) or you could do it by modifying the chart axis properties at design time. Uncomment the MinorGrid.Interval property if you need another level of measurement.
I have previously done that. I currently have the graph set as the following:
Code:
Chart1.ChartAreas(0).AxisX.MajorGrid.Interval = Chart1.ChartAreas(0).AxisX.Maximum
Chart1.ChartAreas(0).AxisY.MajorGrid.Interval = Chart1.ChartAreas(0).AxisY.Maximum / 4
This results in the lines inside of the graph to be placed at the corresponding intervals. However I am curious about the placement of the X axis labels.
Last edited by Frabulator; Mar 30th, 2018 at 04:45 PM.
-
Mar 30th, 2018, 05:02 PM
#8
Addicted Member
Re: MS Chart tick mark labels help
If I wanted my labels to align with the grid marks on my last post for example I would add corresponding tick marks and then a label that aligned with those tick marks
Code:
With Chart1.ChartAreas(0).AxisX
.Minimum = 0
.Maximum = 300
.MajorGrid.Interval = 5
.MajorTickMark.Enabled = True
.MajorTickMark.Interval = 5
.LabelStyle.Enabled = True
.LabelStyle.Interval = 5
End With
Last edited by Mc_VB; Mar 30th, 2018 at 05:05 PM.
Reason: removed reference to minor grid
-
Mar 30th, 2018, 05:10 PM
#9
Thread Starter
Hyperactive Member
Re: MS Chart tick mark labels help
Originally Posted by Mc_VB
If I wanted my labels to align with the grid marks on my last post for example I would add corresponding tick marks and then a label that aligned with those tick marks
Code:
With Chart1.ChartAreas(0).AxisX
.Minimum = 0
.Maximum = 300
.MajorGrid.Interval = 5
.MajorTickMark.Enabled = True
.MajorTickMark.Interval = 5
.LabelStyle.Enabled = True
.LabelStyle.Interval = 5
End With
That did it! Thank you very much !
-
Mar 30th, 2018, 05:12 PM
#10
Addicted Member
Re: [RESOLVED] MS Chart tick mark labels help
If you need to zoom and scroll try this in the form load
Code:
Chart1.ChartAreas(0).CursorX.IsUserEnabled = True
Chart1.ChartAreas(0).CursorX.IsUserSelectionEnabled = True
Chart1.ChartAreas(0).AxisX.ScaleView.Zoomable = True
Chart1.ChartAreas(0).AxisX.ScrollBar.IsPositionedInside = True
Chart1.ChartAreas(0).AxisX.ScaleView.Zoom(0, 300)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|