【问题标题】:How to set labels for X and Y axis in dual line chart using aChartEngine in android?如何使用android中的aChartEngine在双折线图中设置X和Y轴的标签?
【发布时间】:2012-10-17 07:13:48
【问题描述】:

大家好,我是图表应用程序的新手。我使用 aChartEngine 为我的 android 应用程序创建了双折线图。我无法在图表中为 y 轴设置标签。

我有这样的图表.....

我该怎么做有人可以帮助我吗?提前致谢。

【问题讨论】:

    标签: android achartengine linechart


    【解决方案1】:

    这将对您有所帮助:

    // hide the default labels
    mrenderer.setYLabels(0);
    // set the custom labels
    mrenderer.addYTextLabel(0, "$0");
    mrenderer.addYTextLabel(20000, "$20K");
    ...
    // set the visible range
    mrenderer.setYAxisMin(0);
    mrenderer.setYAxisMax(140000);
    

    【讨论】:

    • 嘿,丹,我遇到这样的错误 XYMultipleSeriesRenderer 类型的方法 addYAxisLabel(int, String) 未定义
    • 雅丹,我明白了。谢啦!!!但如果我这样使用 for(int j=0 ; j
    • 如果要动态制作,请使用以下代码 for(int j=0 ; j
    • 看来我们不需要隐藏默认标签。我们只想要带有两个特殊标签的默认标签。很棒的图书馆 Tx Dan!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多