小编rap*_*496的帖子

log4j 包不存在

我正在运行 mvn install,出现以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile 

error: package org.apache.log4j does not exist
Run Code Online (Sandbox Code Playgroud)

在我的项目层次结构中,我将 log4j-1.2.15.jar 添加为引用库。不确定我缺少什么。

具有 log4j 依赖项的 POM 文件的一部分(我应该将版本更改为 1.2...还是可能删除下面的范围?):

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>1.2.15</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>1.2.15</version>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

java maven

10
推荐指数
1
解决办法
5万
查看次数

MPandroid x 轴标签与条形图不对齐

我的 XAxis 值没有对齐。我应该修改什么设置?

x 轴未对齐

以下是到目前为止我在代码中的内容, .setLabelsToSkip 不起作用,因为我使用的是 3.0.1 版。

XAxis xAxis = mChart.getXAxis();
    xAxis.setTypeface(mTfLight);
    xAxis.setGranularity(1f);
    xAxis.setCenterAxisLabels(true);
    xAxis.setDrawLabels(true);
    xAxis.setGranularity(1f);
    xAxis.setGranularityEnabled(true);
    xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
    xAxis.setTextColor(Color.WHITE);
    xAxis.setTextSize(15);
Run Code Online (Sandbox Code Playgroud)

这是我的 LabelFormatter 类:

import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;

public class LabelFormatter implements IAxisValueFormatter {
private final String[] mLabels;

public LabelFormatter(String[] labels) {
    mLabels = labels;
}

@Override
public String getFormattedValue(float value, AxisBase axis) {
    return mLabels[(int) value];
}
}
Run Code Online (Sandbox Code Playgroud)

这是我的主要活动 setdata 方法:

    private void setData() {
    ArrayList<BarEntry> entries = new ArrayList<>();
    String labels[]=new String[5];
    for (Cars c : …
Run Code Online (Sandbox Code Playgroud)

android mpandroidchart

6
推荐指数
1
解决办法
3540
查看次数

标签 统计

android ×1

java ×1

maven ×1

mpandroidchart ×1