在函数趋势控件function trend control中,设定曲线名称为TrendYX1,在该趋势上画两条曲线,曲线索引号分别为index0和index1,为什么出来的画面是一条曲线的尾端连着另一条曲线的首端呢,我想让两条曲线互不相连 怎么实现呢。下面是我程序的代码,按钮脚本添加这些代码,点击按钮画出来的两条曲线首尾相连,变成了一条曲线,各位看看该怎么修改呢。
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
#pragma option(mbcs)
double X_Values[5] = { 1,2,3,4,5 };
double Y_Values[5] = { 6,6,6,6,6 };
double X_Values_Step[ 5 ] = { 1,2,3,4,5 };
double Y_Values_Step[ 5] = { 19,19,19,19,19 };
VARIANT vtDataX;
double dDataY;
int i;
double x;
double y;
VariantInit( &vtDataX );
SetOperation(lpszPictureName,lpszObjectName,FALSE);
SetPropWord(lpszPictureName,"TrendYX1", "Index", 0);
SetPropBOOL( lpszPictureName, "TrendYX1", "DeleteData", TRUE );
SetPropWord(lpszPictureName,"TrendYX1", "Index", 1);
SetPropBOOL( lpszPictureName, "TrendYX1", "DeleteData", TRUE );
SetPropWord(lpszPictureName,"TrendYX1", "Index", 0);
for( i =0; i <5; ++i )
{
vtDataX.vt = VT_R8;
dDataY = Y_Values_Ste[i];
vtDataX.u.dblVal = (double)X_Values[i];
PDLRTSetPropEx( PDLRT_AM_DEFAULT, lpszPictureName, "TrendYX1", "DataX", VT_VARIANT, (void*)&vtDataX, NULL, NULL, 0, NULL, NULL );
SetPropDouble( lpszPictureName, "TrendYX1", "DataY", dDataY );
SetPropBOOL( lpszPictureName, "TrendYX1", "InsertData", TRUE );
VariantClear( &vtDataX );
}
SetPropWord(lpszPictureName,"TrendYX1", "Index", 1);
for( i =0; i <5; ++i )
{
vtDataX.vt = VT_R8;
dDataY = Y_Values[i];
vtDataX.u.dblVal = (double)X_Values[i];
PDLRTSetPropEx( PDLRT_AM_DEFAULT, lpszPictureName, "TrendYX1", "DataX", VT_VARIANT, (void*)&vtDataX, NULL, NULL, 0, NULL, NULL );
SetPropDouble( lpszPictureName, "TrendYX1", "DataY", dDataY );
SetPropBOOL( lpszPictureName, "TrendYX1", "InsertData", TRUE );
VariantClear( &vtDataX );
}
SetOperation(lpszPictureName,lpszObjectName,TRUE);
} |