#include <Origin.h>
enum{
NO_ERROR = 0,
INVALID_GRAPHPAGE = -1,
INVALID_GRAPHLAYER = -2,
INVALID_DATAPLOT = -3,
UPDATE_THEME_ID_FAIL = -4,
APPLY_FORMAT_FAIL = -5
};
enum FILL_AREA{
FILL_AREA_NONE = 0,
FILL_AREA_NORMAL = 1,
FILL_AREA_INCLUSIVE_BROKEN = 2,
FILL_AREA_EXCLUSIVE_BROKEN = 3,
FILL_AREA_SIDELINES = 4,
FILL_AREA_SPAN_VERTICALLY_BROKEN = 5,
FILL_AREA_SIDELINES_BASE = 6
};
enum GRADIENT_MODE{
GRADIENT_MODE_NONE = 0,
GRADIENT_MODE_ONE = 1,
GRADIENT_MODE_TWO = 2
};
enum GRADIENT_DIRECTION{
GRADIENT_DIRECTION_TOP_BOTTOM = 0,
GRADIENT_DIRECTION_BOTTOM_TOP = 1,
GRADIENT_DIRECTION_LEFT_RIGHT = 2,
GRADIENT_DIRECTION_RIGHT_LEFT = 3,
GRADIENT_DIRECTION_DIAG_LT_BR = 4,
GRADIENT_DIRECTION_DIAG_TR_BL = 5,
GRADIENT_DIRECTION_VERT_C_OUT = 6,
GRADIENT_DIRECTION_VERT_C_IN = 7,
GRADIENT_DIRECTION_HORI_C_OUT = 8,
GRADIENT_DIRECTION_HORI_C_IN = 9,
GRADIENT_DIRECTION_DIAG_UCOUT = 10,
GRADIENT_DIRECTION_DIAG_DCOUT = 11,
GRADIENT_DIRECTION_CORN_TL = 12,
GRADIENT_DIRECTION_CORN_TR = 13,
GRADIENT_DIRECTION_CORN_BR = 14,
GRADIENT_DIRECTION_CORN_BL = 15,
GRADIENT_DIRECTION_CENTER = 16
};
enum FILL_PATTERN{
FILL_PATTERN_NONE = 0,
FILL_PATTERN_BL_TR_DENSE = 1,
FILL_PATTERN__BL_TR_MEDIUM = 2,
FILL_PATTERN__BL_TR_SPARSE = 3,
FILL_PATTERN_TL_BR_DENSE = 4,
FILL_PATTERN_TL_BR_MEDIUM = 5,
FILL_PATTERN_TL_BR_SPARSE = 6,
FILL_PATTERN_X_DENSE = 7,
FILL_PATTERN_X_MEDIUM = 8,
FILL_PATTERN_X_SPARSE = 9,
FILL_PATTERN_H_DENSE = 10,
FILL_PATTERN_H_MEDIUM = 11,
FILL_PATTERN_H_SPARSE = 12,
FILL_PATTERN_V_DENSE = 13,
FILL_PATTERN_V_MEDIUM = 14,
FILL_PATTERN_V_SPARSE = 15,
FILL_PATTERN_HV_DENSE = 16,
FILL_PATTERN_HV_MEDIUM = 17,
FILL_PATTERN_HV_SPARSE = 18
};
int pattern(string strGraphPage, int nLayer, int nPlot)
{
GraphPage gp( strGraphPage );
if( !gp )
return INVALID_GRAPHPAGE;
GraphLayer gl;
gl = gp.Layers(nLayer);
if( !gl )
return INVALID_GRAPHLAYER;
DataPlot dp;
dp = gl.DataPlots(nPlot);
if( !dp )
return INVALID_DATAPLOT;
Tree trPattern;
trPattern.Root.Line.LineFillArea.nVal = FILL_AREA_NORMAL; // option of "fill area under curve"
trPattern.Root.Pattern.Fill.FillColor.nVal = 3; // fill->color->blue
trPattern.Root.Pattern.Fill.Pattern.PatternColor.nVal = 3; // fill->pattern color->green
trPattern.Root.Pattern.Fill.Pattern.Style.nVal = FILL_PATTERN_HV_MEDIUM; // fill->pattern->hori+vert medium
trPattern.Root.Pattern.Fill.Pattern.Width.dVal = 1.0; // fill->width
trPattern.Root.Pattern.Transparency.nVal = 50; // transparency
trPattern.Root.Pattern.FollowLineTransparency.nVal = FALSE; // clear "follow line transparency"
trPattern.Root.Pattern.Fill.ShadingMode.nVal = GRADIENT_MODE_TWO; // gradient fill->mode->two colors
trPattern.Root.Pattern.Fill.GradColor.nVal = 17; // gradient fill->color->white
trPattern.Root.Pattern.Fill.GradDirection.nVal = GRADIENT_DIRECTION_BOTTOM_TOP; // gradient fill->direction
if( !dp.UpdateThemeIDs(trPattern.Root) )
{
if( !dp.ApplyFormat(trPattern, true, true) )
return APPLY_FORMAT_FAIL;
}
else
return UPDATE_THEME_ID_FAIL;
return NO_ERROR;
}
©c¡Ï ¤È¥¹ ©f¨u©c ©c¥ì ¥Î¤³ ©c/ ©¦£¯
©c¨Ê¥Î ¤´¥¨ ¥ó ¨× ¥ó¤á' ¥Ì©¦¥ /¤í ¥Õ©¦©f
¨Ö ¦á ©¦£þ ©` ¥Õ ©¦
©¦