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.
I have checked the sample project and it is working good. I have tried in my project but it is working only for negative values and no for positives. However, I have tried negative and positive values in your sample and it is working properly, so I need to take a deeper look at my project to see what is going on.
Thank you!
Thank you so much for this. I am going to check it as soon as I can and I will let you know.
Regards,
Please try the attached sample and let me know if it works for you.
I wanted to let you know that we are currently working on a solution for this. I intend to provide you with a sample by the end of the day tomorrow.