limccn / Android-Charts

Open-source native Android graph/chart framework includes line chart,stick chart,candlestick chart,pie chart,spider-web chart etc.
http://www.lidaren.com/androidcharts
Apache License 2.0
817 stars 317 forks source link

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

Open Gopaldangi opened 8 years ago

Gopaldangi commented 8 years ago

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.

limccn commented 8 years ago

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);
Gopaldangi commented 8 years ago

thank you very much , its working very well.

Gopaldangi commented 8 years ago

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.?

limccn commented 8 years ago

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);
Gopaldangi commented 8 years ago

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

limccn commented 8 years ago

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).

Gopaldangi commented 8 years ago

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