Android-Charts icon indicating copy to clipboard operation
Android-Charts copied to clipboard

I want to create background color with respect to max arc of rose chart

Open Gopaldangi opened this issue 9 years ago • 8 comments

How its possible to create same length of background color fill according to max arc value of rose chart,

i have using this code,

             final Point DEFAULT_POSITION2 = new Point(0, 0);
    Point position2 = DEFAULT_POSITION2;

             Paint paint = new Paint();
    paint.setStyle(Style.FILL);
    paint.setStrokeWidth(borderWidth);
         paint.setColor(backGroundColor);
//  canvas.drawCircle(246f, 437f, 222, paint); //create static circle with static value


    canvas.drawCircle(position2.x, position2.y, radiusLength,paint); 

In this what should i put the dynamic radius of rose chart max arc to fill background color on that.

Gopaldangi avatar Jun 13 '16 07:06 Gopaldangi

By inserting this code below to RoseChart.java( Line 119), you can make it possible to get the chart you want.

     Paint mPaintFillCircleBackgroud = new Paint();
     mPaintFillCircleBackgroud.setStyle(Style.FILL);
     mPaintFillCircleBackgroud.setColor(Color.LTGRAY);
     mPaintFillCircleBackgroud.setAntiAlias(true);
     canvas.drawCircle(position.x, position.y, longitudeLength , mPaintFillCircleBackgroud);

limccn avatar Jun 13 '16 09:06 limccn

thank you very much , its working very well.

Gopaldangi avatar Jun 14 '16 07:06 Gopaldangi

And also it is possible to set any text description below the rosecahrt, pieChart provide chart.setDescription() method to write some description below the chart, is possible to set some text description below the roseChart.?

Gopaldangi avatar Jun 14 '16 10:06 Gopaldangi

RoseChart is also a subclass of RoundChart, you can simply use chart.setDescription() to set the description text you want. drawing text you can use this code below

    Paint mPaintFont = new Paint();
    mPaintFont.setColor(fontColorToSet);
    mPaintFont.setTextSize(fontSizeToSet);
    mPaintFont.setAntiAlias(true);
    canvas.drawText(“Description Text”, positionYouWantToDraw.x, positionYouWantToDraw.y, mPaintFont);

limccn avatar Jun 14 '16 11:06 limccn

it does not work for me for rosechart, i am try that...!!

Gopaldangi avatar Jun 15 '16 06:06 Gopaldangi

if the code did not work. you can simply add TextView float over the chart. rosechart is also a subclass of View. so you can use rosechart like the way you use other subclass of View(eg., ImageView or TextView).

limccn avatar Jun 20 '16 08:06 limccn

I have an question on the rosechart, it is possible to set text on the upper side of the every arc of the chart.????

Gopaldangi avatar Jul 13 '16 09:07 Gopaldangi