如何设置achartengine网格深度\\ z-index的Andr​​oid中? [英] How do I set grid depth\z-index of achartengine in Android?

查看:156
本文介绍了如何设置achartengine网格深度\\ z-index的Andr​​oid中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不过有一个伟大的时间与aChartEngine摆弄,但我已经到了一个地步,我可以提供一些帮助。

Still having a great time fiddling with aChartEngine, but I have come to a point where I could some help.

我期待改变图表的网格的深度或z-index的。但到目前为止,我还没有发现这两种常规的文档中的任何选项在源来设置这一点。

I'm looking to change the depth or z-index of the grid of a chart. But so far I haven't found any options in both the regular documentation as in the source to set the this.

有没有人有关于aChartEngine网格小费或解决方案?

Does anyone has a tip or solution regarding the grids in aChartEngine?

感谢您的帮助!

推荐答案

我想没有人有这个问题,但以防万一,你可能想知道如何更改aChartEngine网格的深度,我将它写下来这里。

I guess nobody has this issue, but just in case you might wonder how to change the depth of the grids in aChartEngine, I'll write it down here.

默认情况下aChartEngine的所有网格上绘制图形本身的顶部。这发生在公共无效画(油画画布,诠释的x,INT Y,INT宽度,高度INT,涂料粉刷) XYChart.java 类。

By default all the grids of aChartEngine are drawn on top of the graph itself. This happens in the public void draw(Canvas canvas, int x, int y, int width, int height, Paint paint) of the XYChart.java class.

这两个标签和网格绘制在相同的条件,检查是否(showLabels ==真|| showGrid == true)而

Both the labels and grids are drawn in the same conditional, which checks whether (showLabels == true || showGrid == true)

第一件事就是拆标签和网格图。下面是我所做的:

First thing you might want to do is split the drawing of the labels and grid. Here's what I did:


  1. 复制整个有条件这将检查标签和网格,其中包括3布尔值的声明 showLabels,showGrid showCustomTextGrid

粘贴它下面布尔hasVa​​lues​​ = FALSE; (此设置为 真正

Paste it below boolean hasValues = false; (set this to true)

您将有双重原因的声明,在现在的班级一些错误。修正以后。

You'll have some errors in the class now, because of double declarations. Fix that later.

在有条件的,你刚刚粘贴,删除code绘制标签。这很容易找到,因为它,如果始于(showLabels)。以下的条件设定 hasVa​​lues​​ =

In the conditional you just pasted, remove the code to draw the labels. It's easy to find, since it starts with if (showLabels). Below the conditional set hasValues = false;

在原来的条件,删除code绘制网格。这很容易找到,因为它与开始后,如果(showGrid)

In the original conditional, remove the code to draw the grid. It's easy to find, since it starts with if (showGrid)

现在摆脱双重申报,通过设置布尔值 showLabels,showGrid showCustomTextGrid ,或者只是使用旧的。

Now get rid of the double declarations, by setting the booleans showLabels, showGrid and showCustomTextGrid, or just use the old ones.

所有的错误,现在应该走了,测试你的应用程序。现在的唱片公司和电网分开,并显示你的图上,而不是它背后顶格。

All the errors should be gone now, test your app. The labels and grid are now separated and the grid is shown behind your graph instead on top of it.

希望它可以帮助你。

干杯!

这篇关于如何设置achartengine网格深度\\ z-index的Andr​​oid中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆