KoAhnig | 4 Dec 2011 13:38
Picon
Favicon

Change of labeling intervals for x-axis

Hi there,

 

I am using QwtPlot for plotting curves with x-values in seconds. It would be nice to display the label in hh:mm:ss format. The cpuplot example presents some guidelines on how to do. This is certainly a good start. 
However, it shows also what I want to avoid. The labels drawn are: 

1

2

3

4

02:38:46

02:38:56

02:39:06

...


It would be more logical to plot instead: 

1

2

3

4

02:38:40

02:38:50

02:39:00

...


or for larger intervals:

1

2

3

4

02:30:00

02:40:00

02:50:00

...


I guess it must be handled somehow in qwt_scale_engine and qwt_interval, but without detailed background on the implementation it is a bit of a pain to understand. Can someone explain how to change the label values showing more reasonable numbers for plotting in such a case?

Or much better is it already implemented and I could not find?

 

Thanks in advance

 

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest
Uwe Rathmann | 5 Dec 2011 07:31
Picon

Re: Change of labeling intervals for x-axis

> I guess it must be handled somehow in qwt_scale_engine and 
> qwt_interval, but without detailed background on the implementation it 
> is a bit of a pain to understand.
>

QwtLinearScaleEngine calculates scales aligned for decades ( multiples 
of 2, 5, 10 ) - a scale engine for date/time values is not available. If 
you want to implement such a thing derive from QwtScaleEngine and 
implement the 3 pure virtual methods.

But when you don't need zooming and know your series you can calculate 
the ticks yourself and assign them with QwtPlot::setAxisScaleDiv().

Uwe

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Glenn Ramsey | 12 Dec 2011 04:42
Picon

Controlling axis label drawing

Hi,

I am trying to implement a power axis scale which displays the data more densely 
near the lower end of the scale. So far I have implemented 
QwtScaleTransformation and QwtScaleEngine (using QwtLinearScaleEngine for 
autoscale() and divideScale() ) and it mostly works. The only issue is that the 
axis labels overwrite each other near the low end of the scale.

Is there a way to suppress the drawing of some of the axis labels? I see that 
this can be done by removing major ticks, but I want the tick mark to remain 
while the label is not drawn.

Glenn

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
Uwe Rathmann | 12 Dec 2011 07:35
Picon

Re: Controlling axis label drawing

On 12/12/2011 04:42 AM, Glenn Ramsey wrote:
> Is there a way to suppress the drawing of some of the axis labels? I see that
> this can be done by removing major ticks, but I want the tick mark to remain
> while the label is not drawn.

You also have to derive and manipulate the QwtScaleDraw object - f.e. 
overload QwtScaleDraw::drawLabel().
 From QwtScaleDraw::labelRect() you know the bounding rectangle for a 
tick label und you can identify collisions.

Uwe

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
Elbert & Nicole Pol | 12 Dec 2011 22:41
Picon

Qwt to OS/2

Hello,

try to compile Qwt to OS/2

But the make failed.
I use QT 4.7.3

cd src && make -f Makefile
make[1]: Entering directory `Q:/qt/qwt/src\'
compiling qwt_interval_symbol.cpp
compiling qwt_abstract_scale_draw.cpp
compiling qwt_clipper.cpp
compiling qwt_color_map.cpp
compiling qwt_column_symbol.cpp
compiling qwt_interval.cpp
compiling qwt_dyngrid_layout.cpp
compiling qwt_math.cpp
compiling qwt_magnifier.cpp
compiling qwt_panner.cpp
compiling qwt_null_paintdevice.cpp
compiling qwt_painter.cpp
compiling qwt_picker.cpp
compiling qwt_pixel_matrix.cpp
compiling qwt_round_scale_draw.cpp
compiling qwt_scale_div.cpp
compiling qwt_scale_draw.cpp
compiling qwt_scale_map.cpp
compiling qwt_spline.cpp
compiling qwt_text_engine.cpp
compiling qwt_text_label.cpp
compiling qwt_text.cpp
compiling qwt_event_pattern.cpp
compiling qwt_picker_machine.cpp
compiling qwt_point_3d.cpp
compiling qwt_point_polar.cpp
compiling qwt_scale_engine.cpp
compiling qwt_symbol.cpp
compiling qwt_system_clock.cpp
compiling qwt_curve_fitter.cpp
compiling qwt_abstract_legend.cpp
compiling qwt_legend.cpp
compiling qwt_legend_data.cpp
compiling qwt_legend_label.cpp
compiling qwt_plot.cpp
compiling qwt_plot_renderer.cpp
compiling qwt_plot_xml.cpp
compiling qwt_plot_axis.cpp
compiling qwt_plot_curve.cpp
compiling qwt_plot_dict.cpp
compiling qwt_plot_directpainter.cpp
compiling qwt_plot_grid.cpp
compiling qwt_plot_histogram.cpp
compiling qwt_plot_item.cpp
compiling qwt_plot_baritem.cpp
compiling qwt_plot_barchart.cpp
compiling qwt_plot_multi_barchart.cpp
compiling qwt_plot_intervalcurve.cpp
compiling qwt_plot_tradingcurve.cpp
compiling qwt_plot_spectrogram.cpp
compiling qwt_plot_spectrocurve.cpp
compiling qwt_plot_scaleitem.cpp
compiling qwt_plot_legenditem.cpp
compiling qwt_plot_seriesitem.cpp
compiling qwt_plot_marker.cpp
compiling qwt_plot_layout.cpp
compiling qwt_plot_canvas.cpp
compiling qwt_plot_panner.cpp
compiling qwt_plot_rasteritem.cpp
compiling qwt_plot_picker.cpp
compiling qwt_plot_zoomer.cpp
compiling qwt_plot_magnifier.cpp
compiling qwt_plot_rescaler.cpp
compiling qwt_point_mapper.cpp
compiling qwt_raster_data.cpp
compiling qwt_matrix_raster_data.cpp
compiling qwt_sampling_thread.cpp
compiling qwt_series_data.cpp
compiling qwt_point_data.cpp
compiling qwt_scale_widget.cpp
compiling qwt_plot_svgitem.cpp
compiling qwt_abstract_slider.cpp
compiling qwt_abstract_scale.cpp
compiling qwt_arrow_button.cpp
compiling qwt_analog_clock.cpp
compiling qwt_compass.cpp
compiling qwt_compass_rose.cpp
compiling qwt_counter.cpp
compiling qwt_dial.cpp
compiling qwt_dial_needle.cpp
compiling qwt_double_range.cpp
compiling qwt_knob.cpp
compiling qwt_slider.cpp
compiling qwt_thermo.cpp
compiling qwt_wheel.cpp
moc qwt_dyngrid_layout.h
moc qwt_magnifier.h
moc qwt_panner.h
moc qwt_picker.h
moc qwt_text_label.h
moc qwt_abstract_legend.h
moc qwt_legend.h
moc qwt_legend_label.h
moc qwt_plot.h
moc qwt_plot_renderer.h
moc qwt_plot_canvas.h
moc qwt_plot_panner.h
moc qwt_plot_picker.h
moc qwt_plot_zoomer.h
moc qwt_plot_magnifier.h
moc qwt_sampling_thread.h
moc qwt_scale_widget.h
moc qwt_abstract_slider.h
moc qwt_analog_clock.h
moc qwt_compass.h
moc qwt_counter.h
moc qwt_dial.h
moc qwt_knob.h
moc qwt_slider.h
moc qwt_thermo.h
moc qwt_wheel.h
\"..\\..\\..\\usr\\share\\qt4\\mkspecs\\os2-g++\"\\emxexpw.cmd -name
qwtd6 -def ..\\lib\\qwtd6.def -version \"6.1.0\"
compiling moc\\moc_qwt_dyngrid_layout.cpp
compiling moc\\moc_qwt_magnifier.cpp
compiling moc\\moc_qwt_panner.cpp
compiling moc\\moc_qwt_picker.cpp
compiling moc\\moc_qwt_text_label.cpp
compiling moc\\moc_qwt_abstract_legend.cpp
compiling moc\\moc_qwt_legend.cpp
compiling moc\\moc_qwt_legend_label.cpp
compiling moc\\moc_qwt_plot.cpp
compiling moc\\moc_qwt_plot_renderer.cpp
compiling moc\\moc_qwt_plot_canvas.cpp
compiling moc\\moc_qwt_plot_panner.cpp
compiling moc\\moc_qwt_plot_picker.cpp
compiling moc\\moc_qwt_plot_zoomer.cpp
compiling moc\\moc_qwt_plot_magnifier.cpp
compiling moc\\moc_qwt_sampling_thread.cpp
compiling moc\\moc_qwt_scale_widget.cpp
compiling moc\\moc_qwt_abstract_slider.cpp
compiling moc\\moc_qwt_analog_clock.cpp
compiling moc\\moc_qwt_compass.cpp
compiling moc\\moc_qwt_counter.cpp
compiling moc\\moc_qwt_dial.cpp
compiling moc\\moc_qwt_knob.cpp
compiling moc\\moc_qwt_slider.cpp
compiling moc\\moc_qwt_thermo.cpp
compiling moc\\moc_qwt_wheel.cpp
emximp -p 128 -o ..\\lib\\qwtd6.lib ..\\lib\\qwtd6.dll
make[1]: Leaving directory `Q:/qt/qwt/src\'
cd textengines && make -f Makefile
make[1]: Entering directory `Q:/qt/qwt/textengines\'
cd mathml && make -f Makefile
make[2]: Entering directory `Q:/qt/qwt/textengines/mathml\'
compiling qwt_mathml_text_engine.cpp
compiling qwt_mml_document.cpp
\"..\\..\\..\\..\\usr\\share\\qt4\\mkspecs\\os2-g++\"\\emxexpw.cmd
-name qwtmath6 -def ..\\..\\lib\\qwtmath6.def -version \"6.1.0\"
linking ..\\..\\lib\\qwtmath6.dll
weakld: error: Unresolved symbol (UNDEF)
\'__ZN13QwtTextEngineC2Ev\'.
weakld: info: The symbol is referenced by:
    Q:\\QT\\qwt\\textengines\\mathml\\obj\\qwt_mathml_text_engine.obj
weakld: error: Unresolved symbol (UNDEF)
\'__ZN13QwtTextEngineD2Ev\'.
weakld: info: The symbol is referenced by:
    Q:\\QT\\qwt\\textengines\\mathml\\obj\\qwt_mathml_text_engine.obj
Ignoring unresolved externals reported from weak prelinker.

Q:\\QT\\qwt\\textengines\\mathml\\obj\\qwt_mathml_text_engine.obj(qwt_mathml_text_engine.cpp)
: error LNK2029: \"QwtTextEngine::QwtTextEngine()\" :
unresolved external
Q:\\QT\\qwt\\textengines\\mathml\\obj\\qwt_mathml_text_engine.obj(qwt_mathml_text_engine.cpp)
: error LNK2029: \"QwtTextEngine::~QwtTextEngine()\" :
unresolved external

There were 2 errors detected
make[2]: *** [..\\..\\lib\\qwtmath6.dll] Error 1
make[2]: Leaving directory `Q:/qt/qwt/textengines/mathml\'
make[1]: *** [sub-mathml-make_default] Error 2
make[1]: Leaving directory `Q:/qt/qwt/textengines\'
make: *** [sub-textengines-make_default-ordered] Error 2

Any ideas ?

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
Uwe Rathmann | 13 Dec 2011 07:55
Picon

Re: Qwt to OS/2

On 12/12/2011 10:41 PM, Elbert & Nicole Pol wrote:
> Hello,
>
> try to compile Qwt to OS/2
>
> ...
> linking ..\\..\\lib\\qwtmath6.dll
> weakld: error: Unresolved symbol (UNDEF)
> \'__ZN13QwtTextEngineC2Ev\'.
> weakld: info: The symbol is referenced by:
>      Q:\\QT\\qwt\\textengines\\mathml\\obj\\qwt_mathml_text_engine.obj
> weakld: error: Unresolved symbol (UNDEF)
> \'__ZN13QwtTextEngineD2Ev\'.

No idea about OS/2 - never worked on it myself - is it still alive ?

Anyway: what fails is linking the qwtmathml library, that needs symbols 
from the qwt library:

a) Do you have something like dllexport/dllimport on OS/2 ?
b) Edit qwtbuild.pri and disable the line "CONFIG += silent" and so a 
make again: then you can see the command how the qwtmathml library is 
built. Check what's wrong with this command.

Uwe

PS: usually you don't need the qwtmathml library. You can disable 
building it by editing qwtconfig.pri - but I would expect then, that you 
will fail later when building the designer plugin.

------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and 
improve service delivery. Take 5 minutes to use this Systems Optimization 
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
Elbert & Nicole Pol | 13 Dec 2011 17:47
Picon

Re: Qwt to OS/2

Hi all,

Yah it's still alive :)

I remove the config = silent

About dllexport/dllimport on OS/2
just add __cdeclspec(dllexport) in function prototype,
I ask this cause i din't know myself.

works same way of cygwin/ms compilers.
Only thing i have change on the mathml, is the line in pro file:
TARGET_SHORT    = $$qtLibraryTarget(qwtmat)

Cause with os2 we can have only 8digest.

"..\..\..\..\usr\share\qt4\mkspecs\os2-g++"\emxexpw.cmd -name qwtmatd6 
-def ..\..\lib\qwtmatd6.def -version "6.1.0"
g++ -Zomf -Zstack 0x2000 -Zdll -Zhigh-mem -o ..\..\lib\qwtmatd6.dll 
..\..\lib\qwtmatd6.def -Wl, <at> obj\OBJECTS.qwtmathmld.rsp -Lq:\usr\lib 
-Lq:\QT\qwt\lib -lqwtd6 -lQtXml4 -lQtGui4 -lQtCore4
weakld: error: Unresolved symbol (UNDEF) '__ZN13QwtTextEngineC2Ev'.
weakld: info: The symbol is referenced by:
     Q:\QT\qwt\textengines\mathml\obj\qwt_mathml_text_engine.obj
weakld: error: Unresolved symbol (UNDEF) '__ZN13QwtTextEngineD2Ev'.
weakld: info: The symbol is referenced by:
     Q:\QT\qwt\textengines\mathml\obj\qwt_mathml_text_engine.obj
Ignoring unresolved externals reported from weak prelinker.

Q:\QT\qwt\textengines\mathml\obj\qwt_mathml_text_engine.obj(qwt_mathml_text_engine.cpp) 
: error LNK2029: "QwtTextEngine::QwtTextEngine()" : unresolved external
Q:\QT\qwt\textengines\mathml\obj\qwt_mathml_text_engine.obj(qwt_mathml_text_engine.cpp) 
: error LNK2029: "QwtTextEngine::~QwtTextEngine()" : unresolved external

There were 2 errors detected
make: *** [..\..\lib\qwtmatd6.dll] Error 1

On 13-12-11 07:55, Uwe Rathmann wrote:
> like dllexport/dllimport on OS/2 ?

------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and 
improve service delivery. Take 5 minutes to use this Systems Optimization 
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
Uwe Rathmann | 14 Dec 2011 08:07
Picon

Re: Qwt to OS/2

On 12/13/2011 05:47 PM, Elbert & Nicole Pol wrote:

> About dllexport/dllimport on OS/2
> just add __cdeclspec(dllexport) in function prototype,
> I ask this cause i din't know myself.

Are you sure: I can't see definitions like this one in Qt ( qglobal.h ) 
for OS/2 - but if you are right you have to edit qwt_global.h and to add 
definitions for QWT_EXPORT on OS/2.
Try the code below: it uses the definitions from the Qt headers, what 
should be much better, than what is implemented today ( I will change 
SVN trunk ).

Uwe

PS: I'm reading the list - no need to send postings CC to me.

--

#ifndef QWT_GLOBAL_H
#define QWT_GLOBAL_H

#include <qglobal.h>

// QWT_VERSION is (major << 16) + (minor << 8) + patch.

#define QWT_VERSION       0x060100
#define QWT_VERSION_STR   "6.1.0"

#if defined(_MSC_VER) /* MSVC Compiler */
/* template-class specialization 'identifier' is already instantiated */
#pragma warning(disable: 4660)
#endif // _MSC_VER

#ifdef QWT_DLL

#if defined(QWT_MAKEDLL)     // create a Qwt DLL library
#define QWT_EXPORT Q_DECL_EXPORT
#else                        // use a Qwt DLL library
#define QWT_EXPORT Q_DECL_IMPORT
#endif

#endif // QWT_DLL

#ifndef QWT_EXPORT
#define QWT_EXPORT
#endif

#endif

Uwe

PS: I'm reading the list - no need to send postings CC to me.

------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits? 
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
Elbert & Nicole Pol | 14 Dec 2011 20:47
Picon

Re: Qwt to OS/2

Hello Uwe,

Look for the qglobal from OS2  <at>  www.pastebin.com/c4ZRp2ph

I add changes as you suggested i get:

g++ -Zomf -Zstack 0x2000 -Zdll -Zhigh-mem -o ..\..\lib\qwtmatd6.dll 
..\..\lib\qwtmatd6.def -Wl, <at> obj\OBJECTS.qwtmathmld.rsp -Lq:\usr\lib 
-Lq:\QT\qwt\lib -lqwtd6 -lQtXml4 -lQtGui4 -lQtCore4
weakld: error: Unresolved symbol (UNDEF) '__ZN13QwtTextEngineC2Ev'.
weakld: info: The symbol is referenced by:
     Q:\QT\qwt\textengines\mathml\obj\qwt_mathml_text_engine.obj
weakld: error: Unresolved symbol (UNDEF) '__ZN13QwtTextEngineD2Ev'.
weakld: info: The symbol is referenced by:
     Q:\QT\qwt\textengines\mathml\obj\qwt_mathml_text_engine.obj
Ignoring unresolved externals reported from weak prelinker.

Q:\QT\qwt\textengines\mathml\obj\qwt_mathml_text_engine.obj(qwt_mathml_text_engine.cpp) 
: error LNK2029: "QwtTextEngine::QwtTextEngine()" : unresolved external
Q:\QT\qwt\textengines\mathml\obj\qwt_mathml_text_engine.obj(qwt_mathml_text_engine.cpp) 
: error LNK2029: "QwtTextEngine::~QwtTextEngine()" : unresolved external

There were 2 errors detected
make: *** [..\..\lib\qwtmatd6.dll] Error 1

Seems to me same errors as before.

On 14-12-11 08:07, Uwe Rathmann wrote:
> On 12/13/2011 05:47 PM, Elbert&  Nicole Pol wrote:
>
>> About dllexport/dllimport on OS/2
>> just add __cdeclspec(dllexport) in function prototype,
>> I ask this cause i din't know myself.
>
> Are you sure: I can't see definitions like this one in Qt ( qglobal.h )
> for OS/2 - but if you are right you have to edit qwt_global.h and to add
> definitions for QWT_EXPORT on OS/2.
> Try the code below: it uses the definitions from the Qt headers, what
> should be much better, than what is implemented today ( I will change
> SVN trunk ).
>
> Uwe
>
> PS: I'm reading the list - no need to send postings CC to me.
>
> --
>
> #ifndef QWT_GLOBAL_H
> #define QWT_GLOBAL_H
>
> #include<qglobal.h>
>
> // QWT_VERSION is (major<<  16) + (minor<<  8) + patch.
>
> #define QWT_VERSION       0x060100
> #define QWT_VERSION_STR   "6.1.0"
>
> #if defined(_MSC_VER) /* MSVC Compiler */
> /* template-class specialization 'identifier' is already instantiated */
> #pragma warning(disable: 4660)
> #endif // _MSC_VER
>
> #ifdef QWT_DLL
>
> #if defined(QWT_MAKEDLL)     // create a Qwt DLL library
> #define QWT_EXPORT Q_DECL_EXPORT
> #else                        // use a Qwt DLL library
> #define QWT_EXPORT Q_DECL_IMPORT
> #endif
>
> #endif // QWT_DLL
>
> #ifndef QWT_EXPORT
> #define QWT_EXPORT
> #endif
>
> #endif
>
>
>
> Uwe
>
> PS: I'm reading the list - no need to send postings CC to me.
>
> ------------------------------------------------------------------------------
> Cloud Computing - Latest Buzzword or a Glimpse of the Future?
> This paper surveys cloud computing today: What are the benefits?
> Why are businesses embracing it? What are its payoffs and pitfalls?
> http://www.accelacomm.com/jaw/sdnl/114/51425149/
> _______________________________________________
> qwt-interest mailing list
> qwt-interest <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qwt-interest
>

------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits? 
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
Elbert & Nicole Pol | 14 Dec 2011 22:01
Picon

Re: Qwt to OS/2

Hello Uwe,

Here is the good one :P

Look for the qglobal from OS2  <at>  www.pastebin.com/wdnaG4uU

------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits? 
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/

Gmane