private void drawSegments()
{
// this value is used to increment the x-axis marker value.
var xMarkerValue = (float)Math.Ceiling(_maxValueItem.Value / ScaleFactor);
// get the scale based on the current max x value and other chart element area adjustments.
var scale = ((xMarkerValue * 100f / (float)_maxValueItem.Value)) *
((ChartWidth - _leftMargin - Margin - Margin) / 100f);
var x1 = _leftMargin + Margin;
double xAxisValue = 0;
for (var i = 0; i <= ScaleFactor; i++)
{
addMarkerLineToChart(x1);
drawVerticalGrid(x1);
addMarkerTextToChart(x1, xAxisValue);
x1 += scale;
xAxisValue += xMarkerValue;
}
}