128 lines
3.4 KiB
C#
128 lines
3.4 KiB
C#
using DrawGraph;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
|
|
|
|
namespace DrawGraph
|
|
{
|
|
[JsonObject(MemberSerialization.OptOut)]
|
|
[Serializable]
|
|
public class OotherYAxisPackObj : AkxisPackObj
|
|
{
|
|
public OotherYAxisPackObj(ZedGraphControl zgc, PackObjManager poManager) : base(zgc, poManager)
|
|
{
|
|
bool flag = zgc == null;
|
|
if (!flag)
|
|
{
|
|
this.baseZed = zgc;
|
|
base.PackText = "其它Y轴" + this.index.ToString();
|
|
GraphPane graphPane = this.baseZed.GraphPane;
|
|
}
|
|
}
|
|
|
|
public override void Draw()
|
|
{
|
|
bool flag = this.baseZed == null;
|
|
if (!flag)
|
|
{
|
|
GraphPane graphPane = this.baseZed.GraphPane;
|
|
YAxis yAxis = graphPane.YAxisList.FirstOrDefault((YAxis s) => ((s.Tag == null) ? "" : s.Tag.ToString()) == base.PackTag);
|
|
bool flag2 = yAxis == null;
|
|
if (flag2)
|
|
{
|
|
yAxis = new YAxis();
|
|
yAxis.Title.Text = "";
|
|
yAxis.Scale.FontSpec.Border.IsVisible = false;
|
|
yAxis.Scale.Align = AlignP.Inside;
|
|
yAxis.Tag = base.PackTag;
|
|
graphPane.YAxisList.Add(yAxis);
|
|
}
|
|
yAxis.Type = base.AxisTypeValue;
|
|
bool flag3 = base.AxisTypeValue == AxisType.Date;
|
|
if (flag3)
|
|
{
|
|
yAxis.Scale.MajorUnit = base.DateUnitValue;
|
|
yAxis.Scale.MinorUnit = base.DateUnitValue;
|
|
yAxis.Scale.Min = new XDate(base.BeginTime);
|
|
yAxis.Scale.Max = new XDate(base.BeginTime.AddMinutes(base.TimeSpan));
|
|
}
|
|
else
|
|
{
|
|
bool flag4 = base.AxisTypeValue == AxisType.Linear;
|
|
if (flag4)
|
|
{
|
|
yAxis.Scale.Min = base.MinValue;
|
|
yAxis.Scale.Max = base.MaxValue;
|
|
}
|
|
}
|
|
bool flag5 = false;
|
|
bool flag6 = base.Scale_IsVisible == EIsBool.True;
|
|
if (flag6)
|
|
{
|
|
flag5 = true;
|
|
}
|
|
yAxis.IsVisible = flag5;
|
|
yAxis.Scale.IsVisible = flag5;
|
|
yAxis.Color = Color.White;
|
|
flag5 = false;
|
|
bool flag7 = base.MajorTic_Visible == EIsBool.True;
|
|
if (flag7)
|
|
{
|
|
flag5 = true;
|
|
}
|
|
yAxis.Scale.AlignH = base.AlignH;
|
|
yAxis.Scale.FontSpec.Size = base.ScaleFontSize;
|
|
yAxis.Scale.LabelGap = base.LabelGap;
|
|
yAxis.MajorTic.IsInside = flag5;
|
|
yAxis.MajorTic.IsOutside = flag5;
|
|
yAxis.MajorTic.IsOpposite = flag5;
|
|
yAxis.MajorTic.Size = 0f;
|
|
yAxis.MinorTic.IsInside = flag5;
|
|
yAxis.MinorTic.IsOutside = flag5;
|
|
yAxis.MinorTic.IsOpposite = flag5;
|
|
flag5 = false;
|
|
bool flag8 = base.MajorGrid_Visible == EIsBool.True;
|
|
if (flag8)
|
|
{
|
|
flag5 = true;
|
|
}
|
|
yAxis.MajorGrid.IsVisible = flag5;
|
|
yAxis.MajorGrid.Color = Color.Gray;
|
|
yAxis.MajorGrid.DashOff = base.Major_DashOff;
|
|
yAxis.MajorGrid.DashOn = base.Major_DashOn;
|
|
yAxis.MajorGrid.PenWidth = base.PenWidth;
|
|
flag5 = false;
|
|
bool flag9 = base.MinorGrid_IsVisible == EIsBool.True;
|
|
if (flag9)
|
|
{
|
|
flag5 = true;
|
|
}
|
|
yAxis.MinorGrid.IsVisible = flag5;
|
|
yAxis.MinorGrid.Color = Color.Gray;
|
|
yAxis.MinorGrid.DashOff = base.Minor_DashOff;
|
|
yAxis.MinorGrid.DashOn = base.Minor_DashOn;
|
|
yAxis.MinorGrid.PenWidth = base.PenWidth;
|
|
flag5 = false;
|
|
bool flag10 = base.IsSkipFirstLabel == EIsBool.True;
|
|
if (flag10)
|
|
{
|
|
flag5 = true;
|
|
}
|
|
yAxis.Scale.IsSkipFirstLabel = flag5;
|
|
flag5 = false;
|
|
bool flag11 = base.IsSkipLastLabel == EIsBool.True;
|
|
if (flag11)
|
|
{
|
|
flag5 = true;
|
|
}
|
|
yAxis.Scale.IsSkipLastLabel = flag5;
|
|
yAxis.Scale.MajorStep = base.MajorStep;
|
|
yAxis.Scale.MinorStep = base.MinorStep;
|
|
base.Refresh();
|
|
}
|
|
}
|
|
}
|
|
}
|