ProjectsForTest/WinForm.NET5TeeChart-NET-Pro-Samples/Axis/Axis_Isometric.cs
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Steema.TeeChart;
using System.Runtime.InteropServices;
namespace Steema.TeeChart.Samples
{
public class Axis_Isometric : Steema.TeeChart.Samples.BaseForm
{
private System.Windows.Forms.Button button1;
private Steema.TeeChart.Styles.Line line1;
private System.ComponentModel.IContainer components = null;
private void MakeIsometric(Axis vertical, Axis horizontal)
{
if ((vertical.Chart.Width > 0) && (vertical.Chart.Height > 0))
{
// setup values
double xrange = horizontal.Maximum - horizontal.Minimum;
double yrange = vertical.Maximum - vertical.Minimum;
double tmpx = xrange/(double)vertical.Chart.Width;
double tmpy = yrange/(double)vertical.Chart.Height;
Screen screen = Screen.FromControl(this);
Graphics g = Graphics.FromHwnd(this.Handle);
IntPtr hptr = g.GetHdc();
double xyscreen = GetDeviceCaps(hptr,HORZSIZE)*screen.Bounds.Height;
xyscreen /= (double)GetDeviceCaps(hptr,VERTSIZE)*screen.Bounds.Width;
g.ReleaseHdc(hptr);
g.Dispose();
tmpy *= xyscreen;
double offset = 0.0;
if (tmpx > tmpy)
{
if (tmpy != 0.0)
{
offset = 0.5*(yrange*tmpx/tmpy-yrange);
vertical.SetMinMax(vertical.Minimum-offset,vertical.Maximum+offset);
}
}
else if (tmpx < tmpy)
{
if (tmpx != 0.0)
{
offset = 0.5*(xrange*tmpy/tmpx-xrange);
horizontal.SetMinMax(horizontal.Minimum-offset,horizontal.Maximum+offset);
}
}
}
}
private void MakeIsometric(Styles.Series series)
{
MakeIsometric(series.GetVertAxis,series.GetHorizAxis);
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。