Question

I currently use the DialRenderer to create a dial in an android application. I want to switch out the needle for a custom made needle which I have as an image .png format.

The code I have right now looks something like:

DialRenderer renderer = new DialRenderer();
renderer.setAngleMin(270);
renderer.setAngleMax(90);
renderer.setChartTitleTextSize(20);
renderer.setLabelsTextSize(50);
renderer.setLegendTextSize(50);
renderer.setMinValue(0);
renderer.setMaxValue(10);
renderer.setVisualTypes(new DialRenderer.Type[] { Type.NEEDLE,Type.NEEDLE });

Is it possible to switch out the needle?

The overall picture is that I have a background image which shows the speedometer and then I have this DialRenderer on top of the background image displaying just the needle and some other things.

Was it helpful?

Solution

So I couldn't really find a way to replace it with an 'image' but instead I downloaded the source code of AChartEngine and modified the needle it creates into something which was more suitable to my application. I did this by changing the width of the needle to make it thicker and more visible.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top