android mp图表条形图描述位置

android mpchart barchart description postion

我在 Android 应用程序中使用 MPchart 中的描述条形图时遇到问题。

当我使用方法description.setPostion(3f, 3f)时,描述消失了。 不知道position的默认值可以自定义

非常感谢

Sample image of my results

你的描述隐藏在 TOP_LEFT 角落所以使用代码,否则不要设置描述位置我的模拟器高度是 1280,重量是 720

    //get the height and width of the device
    DisplayMetrics ds = new DisplayMetrics();
    this.getWindowManager().getDefaultDisplay().getMetrics(ds);
    int width = ds.widthPixels;
    int height = ds.heightPixels;

    //set the custom description postion
    Description desc = new Description();
    desc.setText("Hai");
    desc.setTextSize(13f);
    desc.setPosition(width - 50,height - 175);
    graph.setDescription(desc);

下图"Hai"是对图的描述

desc.setPosition(width - 50,height - 1250);//图:2说明显示在最右角

"Hai" 文字为描述