示例#1
0
bool CompDateAxis::GetWindowDateBounds(wxDateTime &date0, wxDateTime &date1)
{
    double winMin, winMax;
    GetWindowBounds(winMin, winMax);

    int firstDateIndex = (int) winMin;
    int lastDateIndex = RoundHigh(winMax) - 1;
    if (lastDateIndex < firstDateIndex) {
        lastDateIndex = firstDateIndex;
    }

    wxDateSpan span;
    if (!GetMinSpan(span)) {
        return false;
    }

    wxDateTime date;
    if (!GetFirstDate(date)) {
        return false;
    }

    date0 = date;
    for (int n = 0; n < firstDateIndex; n++) {
        date0 += span;
    }

    date1 = date;
    for (int n = 0; n < lastDateIndex; n++) {
        date1 += span;
    }
    return true;
}
示例#2
0
void GetAxisScrollParams(Axis *axis, int &noUnits, int &pos)
{
    double minValue, maxValue;
    axis->GetDataBounds(minValue, maxValue);

    noUnits = RoundHigh(stepMult * (maxValue - minValue - axis->GetWindowWidth())) + 10/*XXX dirty hack*/;
    if (noUnits < 0) {
        noUnits = 0;
    }

    pos = (int) (stepMult * (axis->GetWindowPosition() - minValue));
}
示例#3
0
size_t SineFunction::GetCount(size_t WXUNUSED(serie))
{
	return RoundHigh((m_maxX - m_minX) / m_step) + 1;
}