I'm trying to have two axes on the same data.
The data is a couple of DefaultTableXYDatasets
. The plot is a XYPlot
, and I have two XYLineAndShapeRenderers
and one StackedXYAreaRenderer2
.
All data is in meters for the y-values, and I want to have one axis displaying it in meters and one axis displaying it in feet. Now this feels like a common thing to do, but I can't decide on the most obvious way to do it. One way that works would be to duplicate the data and have the y-values in feet, then add another NumberAxis
and be done with it.
But I thought it would be wiser to subclass NumberAxis
, or inject some functionality into NumberAxis
to scale the values. Or should I go with the first approach?
What do you think?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…