PhilJay / MPAndroidChart

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Other
37.64k stars 9.02k forks source link

How to add multi-line description in Pie-chart ? #3691

Open peddiraju11 opened 6 years ago

peddiraju11 commented 6 years ago
  1. I have tried to add a multi line description in Pic chart using below code, It just showing in single line. Can we add multi-line description ?

val description = Description() description.textColor = ColorTemplate.rgb("#000000") description.text = "positive percentage negative percentage dfgsdfg fgdfg jsdhfgshg ljsk gljs ligfksjkslfjgkjsf " description.textSize = 12f description.textAlign=Paint.Align.RIGHT mChart.setDescription(description)

  1. \n not working in Description class at settext, its not working

val description = Description() description.textColor = ColorTemplate.rgb("#000000") description.text = "my string \n my other string " description.textSize = 12f description.textAlign=Paint.Align.RIGHT mChart.setDescription(description)

Can anyone suggest the solution for this ?

cd-butterfly commented 6 years ago

Chart.java protected void drawDescription(Canvas c) { ............................................ c.drawText(mDescription.getText(), x, y, mDescPaint); ........................................ } It seems that there is no way to do it

blablalf commented 3 years ago

Maybe you could do a custom chart class or the appropriate object