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.
Hi Mike,
Thanks for looking into it.
There's nothing else required, that is the last piece of the puzzle.
Kind regards,
Hello Nathan,
The distance between the edge of the chart and the labels of the x axis can be set by the LabelExtent property.
eg.
var axis = new NumericXAxis();axis.LabelExtent = 0;
Let me know if you have any questions regarding this matter.
Hi Michael,
If you look at the images below you'll see the LabelExtent doesn't reduce the gap.
This one is with it set to 10
The following is set to 30:
This final one, which is the ideal position for the labels is set to 50
You'll note from each picture that the gap between the chart and the labels does change slightly, but the chart itself shrinks. The gap between the chart and the x axis stroke lines remain constant. It's that big blank space that the arrows are pointing to is the area I'd like reduced.
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?
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 :)
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.
Please find attached project demonstrating the gap.
If the label extent is set to 0 then you can't see the labels.
Would you mind posting a small sample so that I can investigate and help you reduce the gap?