Hey Richard.

I saw this back in May with data that can have negative numbers, but is still better to visualize on a log scale. The ExtremesIterator class, tasked with finding the data's min and max, needs to ignore values at or below 0.0. The bad_alloc is because it runs out of memory trying to allocate an asymptotic axis. The change I made alters the iterator to ignore such values in finding the minimum for LogScale. With my data, the new minimum is still close to 0, and determined by the precision of the data itself, so I find it acceptable.

I think the crash is a bug in Wt, since visualizing a data model shouldn't require directly altering the underlying data.

Attached is my change, which also improves the rendered extent padding to be a small amount in the proper scale.

I hope this helps.  Cheers.


--
Joe Garcia
Instrumentation Technologist
UW Lidar Group
University of Wisconsin - Madison


Attachment: logaxis_minAbove0.patch
Description: Binary data



On Jul 14, 2009, at 1:09 PM, Richard Ulrich wrote:

Hi everybody,

I paint some charts from timing measures that sometimes contain gaps or
the measured times were below the threshold and thus 0.0.
As long as I use linear scales, everything is fine, but when I use
logarithmic scales I often get std::bad_alloc because in
WAxis::getLabelTicks() the ticks vector gets filled as long as there is
memory available.
I solved the issue for now by filling the gaps and replacing the zero
values with something very small like 0.00001 in the StandardItemModel
before passing to the chart.
Is this the standard procedure, or would it make sense to handle such
inputs in the WAxis?

Rgds
Richard


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to