Project

General

Profile

Actions

Bug #1013

closed

WAxis labels for DateTime scale

Added by Mark Snelling about 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Pieter Libin
Target version:
Start date:
10/05/2011
Due date:
% Done:

0%

Estimated time:

Description

I believe there to be a bug when using the DateTime scale on WCartesianChart.

The following line in getLabelTicks() will never return true for units smaller than days due to the ordering of the unit enumeration.

bool atTick = (interval > 1) || (unit <= Days);

Enum:

enum { Days, Months, Years, Hours, Minutes } unit;

I've attached a patch file which I believe fixes the enumeration ordering.


Files

WAxis.C.patch (457 Bytes) WAxis.C.patch Mark Snelling, 10/05/2011 12:37 PM
Actions #1

Updated by Koen Deforche about 13 years ago

  • Status changed from New to InProgress
  • Assignee set to Pieter Libin

Hey Mark,

I believe you're right indeed. Thanks.

Regards,

koen

Actions #2

Updated by Pieter Libin about 13 years ago

  • Status changed from InProgress to Resolved

reproduced (and fixed) the problem with this code:

WStandardItemModel model;

  WDate d(2009, 10, 1);
  WDateTime start(d, WTime(1, 0, 0));
  WDateTime end(d, WTime(1, 5, 0));

  WDateTime dt = start;
  int row = 0;
  model.insertColumns(0, 2);
  while (dt < end) {
    model.insertRow(model.rowCount());
    model.setData(row, 0, boost::any(dt));
    model.setData(row, 1, boost::any(row * 10));
    dt = dt.addSecs(60);
    row++;
  }

  plotTimeSeriesChart(&model, "minutes.svg", DateTimeScale);
Actions #3

Updated by Koen Deforche about 13 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF