Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/215.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在androidplot烛台图表中显示打开/关闭值/文本_Android_Androidplot_Candlestick Chart - Fatal编程技术网

如何在androidplot烛台图表中显示打开/关闭值/文本

如何在androidplot烛台图表中显示打开/关闭值/文本,android,androidplot,candlestick-chart,Android,Androidplot,Candlestick Chart,我正在使用androidplot library的烛台图表。遇到问题时,可以用棍子显示打开和关闭的值/标签。这是我找到的解决方案 final LineAndPointFormatter lpf = new LineAndPointFormatter(null, null, null, null); PointLabelFormatter pointLabelFormatter=new PointLabelFormatter(); // pointLabelFormatter.hO

我正在使用androidplot library的烛台图表。遇到问题时,可以用棍子显示打开和关闭的值/标签。这是我找到的解决方案

 final LineAndPointFormatter lpf = new LineAndPointFormatter(null, null, null, null);
    PointLabelFormatter pointLabelFormatter=new PointLabelFormatter();
   // pointLabelFormatter.hOffset=150;
    //pointLabelFormatter.vOffset=50;
    lpf.setPointLabelFormatter(pointLabelFormatter);

    plot.addSeries(openVals, lpf);

    LineAndPointFormatter lpf1 = new LineAndPointFormatter(null, null, null, null);
    PointLabelFormatter pointLabelFormatter1=new PointLabelFormatter();

    //set the vertical offset
    pointLabelFormatter1.vOffset=40;
    lpf1.setPointLabelFormatter(pointLabelFormatter1);

    plot.addSeries(closeVals,lpf1);
    CandlestickFormatter formatter = new CandlestickFormatter();

    formatter.setBodyStyle(CandlestickFormatter.BodyStyle.Square);
    formatter.setLowerCapWidth(50);
    // add the candlestick series data to the plot:
    CandlestickMaker.make(plot, formatter,
            openVals, closeVals, highVals, lowVals);

你能贴一张你看到的屏幕截图吗?如果能看到更多的代码,尤其是烛台格式等东西,也会很有帮助。嗨,尼克。对不起,解释得少了。我通过探索PointLabelFormatter类找到了解决方案。我们可以为打开/关闭值设置垂直和水平偏移。相应地编辑了这篇文章。很好!你可以考虑的一件事是调整它使用DP而不是像素,以保持跨设备的一致性:FravaTr.vOffice=Pixeluts.DpTopix(40);谢谢,我会考虑这一点:嗨,nick。我们可以根据定制的条件改变烛台的颜色吗?比如现在我们可以设置下降体或上升体的颜色。