procedure TForm1.iplot_init();
begin
iPlot1.RemoveAllChannels; // 移除所有通道
iPlot1.RemoveAllXAxes; // 移除所有X轴
iPlot1.TitleText:='实时温度曲线'; // 设置曲线图的标题
//iPlot1.TitleVisible := False; // 不显示曲线图标题
iPlot1.YAxis[0].Span := 100; // 设置Y轴的显示范围
iPlot1.YAxis[0].Min:=-15; // 设置Y轴的起始值
iPlot1.YAxis[0].Title:='温度值(℃)'; // Y轴名称
iPlot1.YAxis[0].TitleShow:=True;
//---配置温度曲线---------------------------------------------------
iPlot1.AddChannel; // 添加一个曲线
iPlot1.Channel[0].TitleText := '温度'; // 设置曲线的名称
iPlot1.Channel[0].Color := clRed; // 设置曲线的颜色
// 曲线插值,加上下面这一句显示的曲线不会有棱角
iPlot1.Channel[0].InterpolationStyle := ipiSTCubicSpline;
iPlot1.Channel[0].TraceLineWidth := 2; // 曲线显示的宽度
iPlot1.AddXAxis; // 添加一个X轴
iPlot1.XAxis[0].Title:='采样时间(S)'; // X轴名称
iPlot1.XAxis[0].TitleShow:=True;
iPlot1.XAxis[0].Span := 200; // X轴显示范围
iPlot1.Channel[0].XAxisName := iPlot1.XAxis[0].Name;
iPlot1.XAxis[0].LabelsFont.Color := clRed; // 标签字体颜色
//---配置0刻度线---------------------------------------------------
iPlot1.AddChannel; // 添加一个曲线
iPlot1.Channel[1].TitleText := '0刻度'; // 设置曲线的名称
iPlot1.Channel[1].Color := clYellow; // 设置曲线的颜色
iPlot1.Channel[1].TraceLineWidth := 2; // 曲线显示的宽度
iPlot1.Channel[1].XAxisName := iPlot1.XAxis[0].Name;
//---配置峰值跟踪显示线---------------------------------------------------
iPlot1.AddChannel; // 添加一个曲线
iPlot1.Channel[2].TitleText := '峰值跟踪'; // 设置曲线的名称
iPlot1.Channel[2].Color := clBlue; // 设置曲线的颜色
iPlot1.Channel[2].TraceLineWidth := 2; // 曲线显示的宽度
iPlot1.Channel[2].XAxisName := iPlot1.XAxis[0].Name;
//---配置谷值跟踪显示线---------------------------------------------------
iPlot1.AddChannel; // 添加一个曲线
iPlot1.Channel[3].TitleText := '谷值跟踪'; // 设置曲线的名称
iPlot1.Channel[3].Color := clLime; // 设置曲线的颜色
iPlot1.Channel[3].TraceLineWidth := 2; // 曲线显示的宽度
iPlot1.Channel[3].XAxisName := iPlot1.XAxis[0].Name;
end;
iplot的操作
最新推荐文章于 2023-10-07 21:53:48 发布