I have a line graph in a ChartLayer. I've set the ChartType of my ChartLayerAppearance to LineChart and I've created a LineChartAppearance as well for containing my ChartText This has been added the the ChartLayerAppearance. Everything looks as it should except that the line is overlapping it's datapoint labels. Below is an excerpt from my program showing what I've done to create the layer and such:
Dim layer1 As New ChartLayerAppearance layer1.AxisX = x layer1.AxisY = y layer1.ChartArea = area layer1.ChartType = ChartType.LineChart layer1.AxisY.Labels.FontColor = Color.DarkRed layer1.Series.Add(series1) Dim appearance As New LineChartAppearance Dim chartText As New ChartTextAppearance chartText.Row = -2 chartText.Column = -2 chartText.ItemFormatString = y.Labels.ItemFormatString chartText.VerticalAlign = StringAlignment.Far chartText.ChartTextFont = New System.Drawing.Font("Microsoft Sans Serif", 7.8) chartText.ClipText = False chartText.Visible = chkToggleDataLabels.Checked appearance.ChartText.Add(chartText) layer1.ChartTypeAppearance = appearance ucResult.CompositeChart.ChartLayers.Add(layer1)
Any ideas what might be causing this or how I might fix it?
Thank you
Hello Bryan,
Looking at the provided code, it seems that everything is correct. I made small sample for you where I`m using ChartTextAppearance. Could you please take a look at the attached sample and let me know if you think that I didn`t reproduce your scenario. Please feel free to modify this sample or send another one with your issue and I`ll be glad to research it for you.
Regards
Here is the sample
I believe you have replicated my issue. Do you know of a way to show the data labels to always be on top of the line?
If I understand well your requirement, one possible approach to acheive desired behavior could be if you are using FillSceneGraph event. Please take a look at the modifications that I made in my sample and let me know if you have any questions,
Bryan Schardt said: Is there a way to distinguish between these items and the datapoint labels?
You could extend the IF Condition in the FillSceneGraph event. Please take a look at the modification in attached sample and let me know if you have any questions.
This solution works for displaying the labels on top of the line, however it also affects my chart titles and axis labels. Is there a way to distinguish between these items and the datapoint labels?