小编Sna*_*eet的帖子

GraphView始终从0开始,动态数据

如何让我的GraphView始终从零开始,而不是在我的数据中最低数量?例如,如果收到的数据是{10,44,1,15},那么最底层的数据将是1,我希望为零.我怎样才能做到这一点 ?

我怎样才能GraphViewSeries动态制作?例如,我收到一个包含数据的数组,我希望根据数组的大小来制作GraphViewSeries,就像我收到一个包含3个元素的数组GraphViewSeries一样,这将是这样的:

GraphViewSeries exampleSeries = new GraphViewSeries(
                new GraphViewData[] { 
                        new GraphViewData(1, total[0]),
                        new GraphViewData(2, total[1]),
                        new GraphViewData(3, total[2])});
Run Code Online (Sandbox Code Playgroud)

如果数组有5个元素,则如下所示:

GraphViewSeries exampleSeries = new GraphViewSeries(
                new GraphViewData[] { 
                        new GraphViewData(1, total[0]),
                        new GraphViewData(2, total[1]),
                        new GraphViewData(3, total[2]),
                        new GraphViewData(4, total[3]),
                        new GraphViewData(5, total[4]) });
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点 ?

arrays android android-graphview

2
推荐指数
2
解决办法
2767
查看次数

当没有找到值时,MySql如何显示零

我有这个问题:

SELECT ent_video_tipo, count(ent_video_tipo) as cnt 
FROM entradas 
WHERE entradas.ent_user= '1' 
GROUP BY ent_video_tipo 
ORDER BY cnt DESC
Run Code Online (Sandbox Code Playgroud)

这会给我:

ent_video_tipo|cnt
       3      | 3
       1      | 3
       4      | 1
       2      | 1
Run Code Online (Sandbox Code Playgroud)

当我做

SELECT ent_video_tipo, count(ent_video_tipo) as cnt 
FROM entradas 
WHERE entradas.ent_user= '2' 
GROUP BY ent_video_tipo 
ORDER BY cnt DESC
Run Code Online (Sandbox Code Playgroud)

我明白了

ent_video_tipo|cnt
       1      | 4
       2      | 2
       3      | 2
Run Code Online (Sandbox Code Playgroud)

而且我希望得到一个零ent_video_tipo = 4.像这样

ent_video_tipo|cnt
       1      | 4
       2      | 2
       3      | 2
       4      | 0
Run Code Online (Sandbox Code Playgroud)

ent_video_tipo …

mysql

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

标签 统计

android ×1

android-graphview ×1

arrays ×1

mysql ×1