Data Label for the Chart Marker are not aligning bottom
Posted: Wed Oct 25, 2017 7:07 pm
I have a requirement where I have a Slider and it has two options top and bottom. When the value is Top I need to move
the data labels associated to the Chart Markers to the top and when its bottom I need to move the data labels to the bottom.
When the error bars height is small it works fine. But when the error bars height is big, this is the problem. Please see
the screen shot.
Here is the code that I am doing for aligning the DataLabels.
the data labels associated to the Chart Markers to the top and when its bottom I need to move the data labels to the bottom.
When the error bars height is small it works fine. But when the error bars height is big, this is the problem. Please see
the screen shot.
Here is the code that I am doing for aligning the DataLabels.
Code: Select all
public void AlignChartDataLabelsToporBottom(ChartMarkerLabelPosition value)
{
try
{
VerticalChartDataLabelAlignment = value;
if (Chart.ViewXY == null || Chart.ViewXY.FreeformPointLineSeries.Count < 1)
{
return;
}
for (int i = 0; i < Chart.ViewXY.FreeformPointLineSeries.Count; i++)
{
foreach (var item in Chart.ViewXY.FreeformPointLineSeries[i].SeriesEventMarkers)
{
item.Label.HorizontalAlign = AlignmentHorizontal.Center;
if (value == ChartMarkerLabelPosition.Top)
{
item.Label.VerticalAlign = AlignmentVertical.Top;
}
else if (value == ChartMarkerLabelPosition.Bottom)
{
item.Label.VerticalAlign = AlignmentVertical.Bottom;
}
}
}
}
catch (Exception exception)
{
SystemDebugLogLogger.LogError(exception);
}
}