Posts

Showing posts from November, 2013

Using FreeGlut with CodeBlocks

AChart Engine : How to set every label in the chart to support multi screen resolution.

Image
How to set every label in the chart to support multi screen resolution.

This is my implement

public static XYMultipleSeriesRenderer setRendererLabelSize(Context context,
                                                            XYMultipleSeriesRenderer renderer)
{
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
float textSize;
float textSizeMini;

switch (context.getResources().getDisplayMetrics().densityDpi) {
case DisplayMetrics.DENSITY_XHIGH:
renderer.setMargins(new int[]{40, 60, 25, 10});
textSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
PConstant.Chart.TEXT_SIZE_XHDPI,
metrics);
textSizeMini = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
PConstant.Chart.TEXT_SIZE_XHDPI_MINI,
metrics);
break;
case DisplayMetrics.DENSITY_HIGH:
renderer.setMargins(new int[]{30, 50, 20, 10});
textSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
PConstant.Chart.TEXT_SIZE_HDPI,
metrics);
textSizeMini = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
PConstant.Cha…

AChartEngine Configuration Part1

Image
How to set value in x axis label in achartengine

for (int i = 0; i < titles.length; i++) 
    {
      x.add(new double[] { 1, 2});
       }

String[] date={"6-6-2012","10-OCT-2012","1-November-2012","umitems"}; 
for (int i = 0; i < date.length; i++) 
    { 
    renderer.addTextLabel(i+1, date[i]);
    }
    renderer.setXLabelsAlign(Align.CENTER);
    renderer.setXLabels(0);
http://stackoverflow.com/questions/16843579/how-to-use-custom-x-axis-label-and-y-axis-label-in-achartengine
http://stackoverflow.com/questions/9904457/how-to-set-value-in-x-axis-label-in-achartengine
http://stackoverflow.com/questions/15076674/achartengine-y-axis-custom-labels-area-margins-and-chart-values-as-string

Custom zoom buttons

renderer.setZoomEnabled(true);
renderer.setExternalZoomEnabled(true);
renderer.setApplyBackgroundColor(true);

<Button
                    android:id="@+id/zoomin"
                    android:layout_width="wrap_content"
                   …