I have an ultragrid and ultrachart...according to the data in the grid the data is displayed in the chart.Suppose i have got only one record in the grid the output which i get in the chart is shown in the attachment(Sample).The width of the columns is too big and i want to reduce its width. i tried using below code,but then the column space between the two bars became more as shown in attachment(Sample1)
Private Sub UltraChart_ChartDrawItem(ByVal sender As System.Object, ByVal e As Infragistics.UltraChart.Shared.Events.ChartDrawItemEventArgs) Handles UltraChart.ChartDrawItem
If ds Is Nothing Then Exit Sub
If dt.Rows.Count <= 3 Then
Dim columnWidth As Integer = 15
Dim box As Infragistics.UltraChart.Core.Primitives.Box = TryCast(e.Primitive, Infragistics.UltraChart.Core.Primitives.Box)
If box Is Nothing Then
Exit Sub
End If
If box.DataPoint Is Nothing Then
Dim dWidth As Integer = box.rect.Height - columnWidth
If dWidth <= 0 Then
box.rect.Width = columnWidth
box.rect.X += dWidth / 2
End Sub
sorry forgot to upload the second attachment Sample 1
H,
There are many approaches to solve this task, but the easiest way to achieve desired look and feel is to use both properties:
- ColumnSpacing
- SeriesSpacing
Let me know if you have any questions.