Hi
I am using the column chart to display the graph and the bar width depends on the number of rows in the data table.
For example, if the datatable contains only two rows, then the two bar appears in the chart and each bar occupies 50% of the chart area. If there are four rows, then each bar occupies 25% of the chart area.
I would like to use a constant bar width instead of variant width based on the number of records. Can I set the bar width?. Can you show me an example?
Regards, Karthik
Hello Karthik,
It sounds like you are using the StackColumnChart. To override it either run the chartWizzard and select ColumnChart or set the ChartType in the Form :Loaded event like so:
ultraChart1.ChartType = Infragistics.UltraChart.Shared.Styles.
ChartType.ColumnChart;
Sincerely,
Petar Monov
Developer Support Engineer,
Infragistics, Inc
Petar,
Thanks for the response.
I don’t think, the issue is in selecting the chart type and I have mentioned rows instead of columns in my post that might have caused this confusion.
Please refer the attached word document.
In the code snippet you sent me you have only ONE row and and by default the dataPoints in the chart are constructed according to the number of rows thus you have only one datapoint which was ment to stick together the different lines.
In order to display smth like that:
you should either create use:
ultraChart1.Data.SwapRowsAndColumns = true;
or even better use a dataTable with one Column and 5 rows.
And there is a property you can in your scenario
ultraChart1.ColumnChart.ColumnSpacing = 1;
Hope this helps.
Regards Petar.
I m using your code but its not work in my chart.so any other option to set the chart column spacing..