Increase the size of error bars with Chart Marker Sizes.
Posted: Fri Nov 03, 2017 5:51 pm
Right now I have a requirement to increase and decrease the width of the Chart Makers. Problem is initially when the Chart Markers load up I can see the error bars. As the Chart Markers are increased in size, I cannot see the error bars. Its rendered inside the chart markers.
Please see the attachment.
Is there a way increase the size of the error bars with the Chart Makers height and width. Could you please post some sample code. Here is my code currently to increase the size of the Chart Markers.
Here is how the Chart markers are created.
Please see the attachment.
Is there a way increase the size of the error bars with the Chart Makers height and width. Could you please post some sample code. Here is my code currently to increase the size of the Chart Markers.
Code: Select all
public void ChangeChartMarkersSize(double value)
{
try
{
ChartMarkerHeightValue = (float)value;
ChartMarkerWidthValue = (float)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.Symbol.Height = (float)value;
item.Symbol.Width = (float)value;
}
}
}
catch (Exception exception)
{
SystemDebugLogLogger.LogError(exception);
}
}
Code: Select all
public SeriesEventMarker CreateMarker(string text, double xVal, double yVal,
Shape shape, float angle)
{
//height = ChartMarkerHeightValue;
//width = ChartMarkerWidthValue;
//m_SeriesEventMarkerFontSize = ChartDataLabelFontSizeValue;
SeriesEventMarker marker = new SeriesEventMarker();
marker.MouseInteraction = true;
marker.MoveByMouse = false;
marker.Label.Font = m_ChartFontForSeriesEventMarker;
marker.Label.Font.Size = ChartDataLabelFontSizeValue; //this line may not be needed
marker.Label.Text = text;
marker.Label.HorizontalAlign = AlignmentHorizontal.Center;
marker.Label.Color = Colors.Black;
switch (VerticalChartDataLabelAlignment)
{
case ChartMarkerLabelPosition.Top:
{
marker.Label.VerticalAlign = AlignmentVertical.Top;
break;
}
case ChartMarkerLabelPosition.Bottom:
{
marker.Label.VerticalAlign = AlignmentVertical.Bottom;
break;
}
}
//marker.Label.VerticalAlign = AlignmentVertical.Top;
//marker.Label.Font = new WpfFont(FontFamily.GenericSansSerif, 10f, FontStyle.Bold);
marker.Symbol.Shape = shape;
marker.Symbol.Angle = angle;
marker.Symbol.Width = ChartMarkerWidthValue;
marker.Symbol.Height = ChartMarkerHeightValue;
marker.XValue = xVal;
marker.YValue = yVal;
marker.VerticalPosition = SeriesEventMarkerVerticalPosition.AtYValue;
return marker;
}