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.
I am using infragistics 2013 and i am using column chart in which i want to fix the same width to all the columns in the chart.
Please help.. Its urgent... please share some example to to achieve this scenario. And i also tried using ColumnSpacing & SeriesSpacing but didnt worked for me.
Thanks in advance ..
I've been chasing this for a while and the sample code didn't work for me either.
Then my boss came up with a very usable workaround: Just create a handful of empty rows in your datatable. The empty rows make the actual columns smaller and much better looking.
The "empties" aren't visible and everything autosizes properly.