【问题标题】:MPAndroidChart marker is cut of in right or left screenMPAndroidChart 标记在右侧或左侧屏幕中被剪切
【发布时间】:2017-10-26 04:15:57
【问题描述】:

如何设置边距或识别标记是否显示在屏幕右侧或左侧,导致我的标记在屏幕右侧或左侧显示时被切断。

如果我单击左侧或右侧的值而不像上图那样被切断,我想要像下面这张图片

【问题讨论】:

    标签: android marker mpandroidchart


    【解决方案1】:

    尝试为图表类设置边距

    通过使用

     RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            layoutParams.setMargins(left,top,right,bottom);
            charId.setLayoutParams(layoutParams);
    
    
       android:layout_marginStart="20dp"
       android:layout_marginEnd="20dp"
    

    【讨论】:

    • 不是这样的,我想要的是 LineChart 中的标记,如果它在右侧或左侧屏幕中显示值我没有像上图那样切断,仅用于标记而不是整个 LineChart 布局
    猜你喜欢
    • 1970-01-01
    • 2019-12-28
    • 1970-01-01
    • 1970-01-01
    • 2021-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多