java - Android GraphView -
i'm trying utilize graphview can't seem have labels :/
this graphview:
// init illustration series info graphviewseries exampleseries = new graphviewseries(new graphviewdata[] { new graphviewdata(1, 2.0d) , new graphviewdata(2, 1.5d) , new graphviewdata(3, 2.5d) , new graphviewdata(4, 1.0d) }); graphview graphview = new linegraphview(this , "graphviewdemo"); graphview.sethorizontallabels(new string[] {"2 days ago", "yesterday", "today", "tomorrow"}); graphview.setverticallabels(new string[] {"high", "middle", "low"}); graphview.addseries(exampleseries); linearlayout layout = (linearlayout) findviewbyid(r.id.layout); layout.addview(graphview); and xml:
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" android:id="@+id/layout" android:orientation="vertical"> </linearlayout> this get:
big edit!
now labels appear large, how can cut down font letter display overall ?
the problem might text beingness white color. try
graphview.getgraphviewstyle().sethorizontallabelscolor(color.black); graphview.getgraphviewstyle().setverticallabelscolor(color.black);
the size of text altered follows... graphview.getgraphviewstyle().settextsize(11);
java android android-graphview
No comments:
Post a Comment