@@ -15,6 +15,7 @@ import android.util.AttributeSet
1515import android.view.View
1616import android.view.ViewGroup
1717import android.view.accessibility.AccessibilityEvent
18+ import androidx.core.graphics.createBitmap
1819import info.appdev.charting.animation.ChartAnimator
1920import info.appdev.charting.animation.Easing.EasingFunction
2021import info.appdev.charting.components.Description
@@ -1058,23 +1059,20 @@ abstract class Chart<T : ChartData<out IDataSet<out Entry>>> : ViewGroup, IBaseP
10581059 */
10591060 get() = this .center
10601061
1062+ /* *
1063+ * Returns the bitmap that represents the chart.
1064+ */
10611065 val chartBitmap: Bitmap
1062- /* *
1063- * Returns the bitmap that represents the chart.
1064- */
10651066 get() {
10661067 // Define a bitmap with the same size as the view
1067- val returnedBitmap = Bitmap . createBitmap(width, height, Bitmap .Config .RGB_565 )
1068+ val returnedBitmap = createBitmap(width, height, Bitmap .Config .RGB_565 )
10681069 // Bind a canvas to it
10691070 val canvas = Canvas (returnedBitmap)
10701071 // Get the view's background
10711072 val bgDrawable = background
1072- if (bgDrawable != null ) // has background drawable, then draw it on the canvas
1073- {
1073+ if (bgDrawable != null ) { // has background drawable, then draw it on the canvas
10741074 bgDrawable.draw(canvas)
1075- } else // does not have background drawable, then draw white background on
1076- // the canvas
1077- {
1075+ } else { // does not have background drawable, then draw white background on the canvas
10781076 canvas.drawColor(Color .WHITE )
10791077 }
10801078 // draw the view on the canvas
@@ -1132,11 +1130,7 @@ abstract class Chart<T : ChartData<out IDataSet<out Entry>>> : ViewGroup, IBaseP
11321130 }
11331131
11341132 /* *
1135- * Returns all jobs that are scheduled to be executed after
1136- * onSizeChanged(...).
1137- */
1138- /* *
1139- * tasks to be done after the view is setup
1133+ * Returns all jobs that are scheduled to be executed after onSizeChanged(...).
11401134 */
11411135 var jobs: ArrayList <Runnable > = ArrayList ()
11421136 protected set
@@ -1259,7 +1253,6 @@ abstract class Chart<T : ChartData<out IDataSet<out Entry>>> : ViewGroup, IBaseP
12591253
12601254 // region accessibility
12611255 /* *
1262- *
12631256 * @return accessibility description must be created for each chart
12641257 */
12651258 abstract val accessibilityDescription: String?
@@ -1285,8 +1278,7 @@ abstract class Chart<T : ChartData<out IDataSet<out Entry>>> : ViewGroup, IBaseP
12851278 const val PAINT_GRID_BACKGROUND : Int = 4
12861279
12871280 /* *
1288- * paint for the info text that is displayed when there are no values in the
1289- * chart
1281+ * paint for the info text that is displayed when there are no values in the 3chart
12901282 */
12911283 const val PAINT_INFO : Int = 7
12921284
0 commit comments