Hi,
Many thanks for the teams help for getting me going on my chart as detailed here http://es.infragistics.com/community/forums/t/92741.aspx
The team helped provide an example solution that I've now managed to incorporate into my own solution. It looks as follows:
I've adapted the code to use a CategoryDateTimeXAxis for the contact data. What I'd like to do is show date values against the x axis and also close up the white space between the -6 Y axis value and the strokes on the x axis.
I've constructed my x axis as follows but I'm obviously missing something:
Dim categoryX As CategoryDateTimeXAxis = New CategoryDateTimeXAxis() categoryX.DateTimeMemberPath = "ActivityDate" categoryX.DisplayType = TimeAxisDisplayType.Continuous categoryX.LabelExtent = 30 categoryX.LabelsVisible = TruecategoryX.LabelFontSize = 8categoryX.Interval = New TimeSpan(7, 0, 0, 0) categoryX.Label = "ActivityDate" categoryX.DataSource = posContacts categoryX.MajorStroke = Brushes.Transparent categoryX.MinorStroke = Brushes.Transparent categoryX.Stroke = Brushes.Black categoryX.StrokeThickness = 2
Your help, as ever, will be much appreciated.
Many thanks,
Nathan
I've managed to now get the labels displaying.
I added an event handler to the x axis FormatLabel event and formatted my text as below:
Private Function OnAxisXFormatLabel(info As AxisLabelInfo) As String Return info.DateValue.ToString("dd/MM/yyyy") End Function
I also changed the label location to AxisLabelsLocation.OutsideBottom
The labels look fine now, all I need to know is how to remove the whitespace between the chart and the x axis strokes.
Hi Nathan,
I am looking into this for you. I plan to provide you with some sample code that you can add to your project to control the spacing of the axis. Please let me know if you have any more information for me while I am researching.
Hello Nathan,
I apologize. I have found that setting the labelextent to zero reduces the gap. Setting it to 30 or even 10 will keep a noticeable gap.
Good morning,
I hope you all had a good break.
Is there any update on how to reduce the gap and described in this thread?
Kind regards,
Would you mind posting a small sample so that I can investigate and help you reduce the gap?
Hi Michael,
Please find attached project demonstrating the gap.
If the label extent is set to 0 then you can't see the labels.
I reviewed your sample and added set the LabelExtent directly on the Axis object on your chart and the space is removed. Please update the Form_load to the following to reduce the gap.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
SetupContactsVEventschart() ContactsVEventsFromUltraCalendarCombo.Value = Now.AddDays(-10) ContactsVEventsToUltraCalendarCombo.Value = Now.AddDays(-5) ContactsVEventsUltraDataChart.Axes(1).LabelExtent = 0
End Sub
Let me know if you have any questions.
Excellent, thanks Michael.
I didn't consider my events axis in this. I change that to LabelExtent = 0 (ContactsVEventsUltraDataChart.Axes(1)) and it worked a treat.
Thanks again :)