51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using System;
|
|
using CPF.Drawing;
|
|
using CPF.ReoGrid.Graphics;
|
|
using CPF.ReoGrid.Rendering;
|
|
|
|
namespace CPF.ReoGrid.Chart
|
|
{
|
|
public class AxisGuideLinePlotView : ChartPlotView
|
|
{
|
|
public AxisGuideLinePlotView(AxisChart chart) : base(chart)
|
|
{
|
|
base.LineColor = Color.Silver;
|
|
}
|
|
|
|
protected override void OnPaint(RDrawingContext dc)
|
|
{
|
|
AxisChart axisChart = base.Chart as AxisChart;
|
|
bool flag = axisChart == null;
|
|
if (!flag)
|
|
{
|
|
IGraphics graphics = dc.Graphics;
|
|
Rect clientBounds = this.ClientBounds;
|
|
bool showHorizontalGuideLines = axisChart.ShowHorizontalGuideLines;
|
|
if (showHorizontalGuideLines)
|
|
{
|
|
AxisDataInfo primaryAxisInfo = axisChart.PrimaryAxisInfo;
|
|
float num = clientBounds.Height / (float)primaryAxisInfo.Levels;
|
|
float num2 = clientBounds.Bottom;
|
|
for (int i = 0; i <= primaryAxisInfo.Levels; i++)
|
|
{
|
|
graphics.DrawLine(clientBounds.X, num2, clientBounds.Right, num2, base.LineColor);
|
|
num2 -= num;
|
|
}
|
|
}
|
|
bool showVerticalGuideLines = axisChart.ShowVerticalGuideLines;
|
|
if (showVerticalGuideLines)
|
|
{
|
|
AxisDataInfo primaryAxisInfo2 = axisChart.PrimaryAxisInfo;
|
|
float num3 = clientBounds.Width / (float)primaryAxisInfo2.Levels;
|
|
float num4 = clientBounds.Left;
|
|
for (int j = 0; j <= primaryAxisInfo2.Levels; j++)
|
|
{
|
|
graphics.DrawLine(num4, clientBounds.Top, num4, clientBounds.Bottom, base.LineColor);
|
|
num4 += num3;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|