Are there any pages on custom (graphical) components in the book? I'm looking for the best way to draw a curved trend-line between some points in a graph. What would be the best approach to do this? Calculate the intermediary points myself and simply call drawLines(float pts, Paint paint) on the Canvas object, or use a Path object with its Cubic and Quadratic Bezier curve methods cubicTo resp. quadTo methods?
Johan Pelgrim, The Netherlands
SCJP 1.4, SCWCD 1.4, SCBCD 5.0
I want to display a chart with one series as bars, and show a trend-line (hence the curved-line requirement). Anything above the trend-line should have a different color. Maybe some axis, legend. That's about it (for a start). Some chart-libs can do bars, or lines. Few can do both in a compound graph. None can do the above / below a trend-line colouring. I'm leaning towards a solution with a custom component.
Joined: Apr 17, 2013
Why don't you get a graph library?
I think it's too much work to start using primitives over the canvas to draw graphs
I have not found any which can do what I need (one series in bars, one series in a trend-line, coloring of the exceeding amount in the bars, which is over the trend-line)... Can you recommend a good graph-lib which is highly customisable?