Hi, I am plotting frequency in Hz, using the TimeSeriesChart. So far so good. But I need to add a second Y (value) axis that would represent musical tones. I need the ticks to be represented by String values (C#9,A4 and so on), so I figured out I should use SymbolAxis. The problem is I need to map the string tick values to exact number values, such as:
A4->440, A#4->466.164, B4->493.883, C5 ->523.251..... So it won't be linear nor logarithmic. How can I do that? Thanks.
(v1.0.17)
Custom symbol axis
-
- Posts: 1
- Joined: Sun Mar 23, 2014 10:13 pm
- antibot: No, of course not.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Custom symbol axis
I think SymbolAxis won't work for you, because it is coded to convert integer values to symbols. What you should do is subclass NumberAxis and override just this method:
Code: Select all
public List refreshTicks(Graphics2D g2, AxisState state, Rectangle2D dataArea, RectangleEdge edge)
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program