本文整理汇总了C++中ChartRenderer::DrawLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ ChartRenderer::DrawLabel方法的具体用法?C++ ChartRenderer::DrawLabel怎么用?C++ ChartRenderer::DrawLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChartRenderer
的用法示例。
在下文中一共展示了ChartRenderer::DrawLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
ChartWindow::DrawChart(ChartRenderer &renderer)
{
renderer.ScaleXFromValue(0);
renderer.ScaleXFromValue(100);
renderer.ScaleYFromValue(0);
renderer.ScaleYFromValue(100);
if (chart == 0) {
renderer.DrawLine(0, 10, 100, 70,
look.GetPen(ChartLook::STYLE_BLUETHINDASH));
} else if (chart == 1) {
renderer.ScaleXFromValue(-50);
renderer.ScaleXFromValue(110);
renderer.ScaleYFromValue(110);
renderer.DrawLine(0, 10, 100, 70,
look.GetPen(ChartLook::STYLE_BLUETHINDASH));
renderer.DrawLine(0, 10, 100, 80,
look.GetPen(ChartLook::STYLE_GREENDASH));
renderer.DrawLine(0, 10, 100, 100,
look.GetPen(ChartLook::STYLE_BLACK));
renderer.DrawXGrid(20, 20, ChartRenderer::UnitFormat::NUMERIC);
renderer.DrawYGrid(20, 20, ChartRenderer::UnitFormat::NUMERIC);
renderer.DrawLabel(_T("hello"), 50, 50);
renderer.DrawXLabel(_T("VVV"),_T("m/s"));
renderer.DrawYLabel(_T("AAA"),_T("m/s"));
}
}
示例2: if
void
RenderTaskLegs(ChartRenderer &chart,
const TaskManager &task_manager,
const NMEAInfo& basic,
const DerivedInfo& calculated,
const double y)
{
const TaskStats &task_stats = calculated.ordered_task_stats;
if (!task_stats.start.task_started)
return;
TCHAR sTmp[5];
const OrderedTask &task = task_manager.GetOrderedTask();
for (unsigned i = 0, n = task.TaskSize(); i < n; ++i) {
const OrderedTaskPoint &tp = task.GetTaskPoint(i);
if (!IsTaskLegVisible(tp))
continue;
auto x = tp.GetEnteredState().time - calculated.flight.takeoff_time;
if (x >= 0) {
x /= 3600;
if (y>=0) {
if (i==0) {
chart.DrawBlankRectangle(chart.GetXMin(), chart.GetYMin(),
x, chart.GetYMax());
} else if (i+1 == task.TaskSize()) {
chart.DrawBlankRectangle(x, chart.GetYMin(),
chart.GetXMax(), chart.GetYMax());
}
chart.DrawLine(x, chart.GetYMin(), x, chart.GetYMax(),
ChartLook::STYLE_GRIDZERO);
}
if (y>=0) {
StringFormatUnsafe(sTmp, _T("%d"), i);
chart.DrawLabel(sTmp, x, chart.GetYMax()*y + chart.GetYMin()*(1-y));
}
}
}
}