When displaying the data value of the columns, I create a new ChartTextAppearance and add it to the ChartText of the ColumnChart. See below the code:
ChartTextAppearance colApparence = new ChartTextAppearance(); colApparence.Column = SwapRowsColumns ? -2 : i; colApparence.Row = -2; colApparence.ItemFormatString = itemFormatString; colApparence.Visible = !StackChart; colApparence.HorizontalAlign = StringAlignment.Center; colApparence.VerticalAlign = StringAlignment.Far; Chart.ColumnChart.ChartText.Add(colApparence); Chart.ColumnLineChart.Column.ChartText.Add(colApparence);
The issue is that when there are two columns with a similar value, the data values are overlapping
Any idea on how can I get these values displayed without overlapping?
Thank you.
Hi Alvaro,
UltraChart doesn't have any built-in collision detection for labels. This is something you could implement yourself. I'll put together a small sample to get you started.
An alternative solution that might work is to use a bar chart instead of columns. Since your labels are longer, they'll match up to the columns better if the chart is oriented vertically like a bar chart.
Please let me know how you choose to proceed.
Hi Mike,
thank you for replying me. Actually, the user can choose to display the data as bar chart or column chart. It is true that this is not a problem when displaying as bar chart but I would like to have this solved for column chart too but I am running out of ideas. If you have that small sample, it would be very appreciated and helpful.
Thank you,
Alvaro.