0
votes

back in 0.9.8 i created 2 overlayed plots with one having the range legend left and the other right in a nice symmetric setup

depending which one side was selected as indicated by the same color for the grid and domain labels the range labels and range grid lined up with this side and the opposite range labels and their divisions were according to their originals settings but not lining up with the grid but still provided some indication of the values with respect to the grid

as mentioned, the grid was in accordance and lining up to selected side

now in 1.4.3 i have a 2 range label sets available, but only one gobal setting for the range grid, which is fine, but also for the range labels

Plot.setRangeStep (StepMode.INCREMENT_BY_VAL, div) ;

do i see this correct ???

now i have the not selected range labels lined up at the global grid lines and with divisions which look awful with all the decimal fraction-ed values and weird spacing

this solution might make the use of a single plot useless for me

i have no problems using 2 plots, but there is a big plot.redraw penalty for 2 plots and my setup is already not as fast as i would like

i might be able to have 2 plots where the second one only provides the grid and right range legend ... this asymmetric setup seems to become quite a mess

any suggestions are highly welcome ... if a new release (1.4.5) would have a fix, then i do not need this fix right now, since the whole project will take a couple of month more at least and i can implement it when available ... just got the bt data acquisition and plotting framework done and the last 10 % take always 90 % of time ;)

pict examples

dual plot 0.9.8 left blue range is selected, domain and grid are also blue ... right magenta range has non fractured labels, but doesn't line up which is fine

single plot 1.4.3 right green range selected, domain and grid are also green ... left red range has fractured labels (awful) but lines up which is not so important since un-aligned grid provides some guideline

2

2 Answers

0
votes

You are correct in your observation that while 1.x.x allows multiple axis labels (on the left and right at the same time for example), they must share the same grid stepping.

I noticed that you have different stepping applied in the two images. Is this intentional? I assume you're already normalizing your values since the left/right scales are quite different but are displaying correctly (aside from the undesired fractions on the left). Without knowing more about your use case in terms of how boundaries are calculated, if they get dynamically adjusted etc. a naive suggestion might be to try change the number of steps to something that factors evenly into both ranges. You can accomplish the same thing by adjusting the min/max range of plot as well.

0
votes

finally it seems like i have it working again with 1.4.3

i have now one main plot with one range legend on the left plus a left connected range grid and a domain legend with a domain grid at the bottom ... all series data is also handled in the main plot ... this single plot draws all the series data plots and is faster with redraw compared to 2 separate series data plots

then i have a second plot with a range on the right plus a right connected range grid

both plots overlap physically with the second one having a bunch set to transparency or being null'ed out (hidden) to overlay the main plot

only the selected side's range grid is displayed, while the other is null

gw.setRangeGridLinePaint (null) ;

for the rangestep setup i use selectively both plots

if (left) {
  more code ...
  PlotL.setRangeStep (StepMode.INCREMENT_BY_VAL, div) ;
} else {
  more code ...
  PlotR.setRangeStep (StepMode.INCREMENT_BY_VAL, div) ;
}

to answer the question about normalized data :

i took it very easy with setting all ranges from 0.0 to 1000.0 and scale the data provided accordingly so that it fits within the min and max expected values per series ... eSzeX = 500 and eSzeY = 1000

PlotL.setDomainBoundaries (0, eSzeX, BoundaryMode.FIXED) ;
PlotL.setRangeBoundaries  (0, eSzeY, BoundaryMode.FIXED) ;
PlotR.setRangeBoundaries  (0, eSzeY, BoundaryMode.FIXED) ;

i need to re-evaluate the 500 x-axis data points which keep the cpu extremely busy with 6 series data plots and slows things down a bit

... every series has it's own final scaling in the XYSeries getX (int idx) implementation with a single multiply and additive linear offset

i'm not a genius and the same data structs need to work in a similar manner with QWT plotting under QT for the desktop solution

the main data pre-processsing is handled in a JNI wrapper sharing code with the QT implementation

the series data arrays contain massive data points, depending on the size of the log file, but only 500 are being displayed and the indexing is being handled also via simple JNI access routines ... all data specific information is contained within the C++ code to be compatible with the QT and QWT code without rewriting it in java

the scrolling is not as smooth as i would like at the moment, but much better than with the dual plot under 0.9.8, but i have no time for optimization right now and have already done quite some

it would be very very nice if this complicated setup could be avoided and androidplot would have a similar built in ability ... maybe it does via sub-classing or similar techniques, but without examples i would not know where to look or how to do it

i was able to use

private class LabelRendererY extends LineLabelRenderer { ... }

to play a bit with label data and position processing ... i was lucky to find an example somewhere

it's very hard to make a living in this dry desert of open source software

thanks for your response Nick ... i might have more questions later

for now i'm not messing with separate data series legends since what i have keeps me pretty busy