本文整理汇总了C++中PlotLine::setColorBar方法的典型用法代码示例。如果您正苦于以下问题:C++ PlotLine::setColorBar方法的具体用法?C++ PlotLine::setColorBar怎么用?C++ PlotLine::setColorBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlotLine
的用法示例。
在下文中一共展示了PlotLine::setColorBar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTHERM
void THERM::getTHERM (QPtrList<PlotLine> &pll)
{
PlotLine *therm = new PlotLine();
int loop;
double thermometer = 0;
for (loop = 1; loop < (int) data->count(); loop++)
{
double high = fabs(data->getHigh(loop) - data->getHigh(loop - 1));
double lo = fabs(data->getLow(loop - 1) - data->getLow(loop));
if (high > lo)
thermometer = high;
else
thermometer = lo;
therm->append(thermometer);
}
if (smoothing > 1)
{
PlotLine *ma = getMA(therm, smoothType, smoothing);
pll.append(ma);
delete therm;
therm = ma;
}
else
pll.append(therm);
PlotLine *therm_ma = getMA(therm, maType, maPeriod);
therm_ma->setColor(maColor);
therm_ma->setType(maLineType);
therm_ma->setLabel(maLabel);
pll.append(therm_ma);
// assign the therm colors
therm->setColorFlag(TRUE);
therm->setType(lineType);
therm->setLabel(label);
int thermLoop = therm->getSize() - 1;
int maLoop = therm_ma->getSize() - 1;
while (thermLoop > -1)
{
if (maLoop > -1)
{
double thrm = therm->getData(thermLoop);
double thrmma = therm_ma->getData(maLoop);
if (thrm > (thrmma * threshold))
therm->setColorBar(thermLoop, threshColor);
else
{
if (thrm > thrmma)
therm->setColorBar(thermLoop, upColor);
else
therm->setColorBar(thermLoop, downColor);
}
}
else
therm->setColorBar(thermLoop, downColor);
thermLoop--;
maLoop--;
}
}