当前位置: 首页>>代码示例>>Java>>正文


Java Axis.setHasLines方法代码示例

本文整理汇总了Java中lecho.lib.hellocharts.model.Axis.setHasLines方法的典型用法代码示例。如果您正苦于以下问题:Java Axis.setHasLines方法的具体用法?Java Axis.setHasLines怎么用?Java Axis.setHasLines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lecho.lib.hellocharts.model.Axis的用法示例。


在下文中一共展示了Axis.setHasLines方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: xAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
@NonNull
private Axis xAxis() {
    List<AxisValue> axisValues = new ArrayList<AxisValue>();
    final java.text.DateFormat timeFormat = hourFormat();
    timeFormat.setTimeZone(TimeZone.getDefault());
    GregorianCalendar calendar = new GregorianCalendar();
    calendar.setTimeInMillis(start_time);
    calendar.set(Calendar.MINUTE, 0);
    calendar.set(Calendar.SECOND, 0);
    calendar.set(Calendar.MILLISECOND, 0);
    if (calendar.getTimeInMillis()<start_time){
        calendar.add(Calendar.HOUR, 1);
    }
    while (calendar.getTimeInMillis()<end_time){
        axisValues.add(new AxisValue((calendar.getTimeInMillis() / FUZZER), (timeFormat.format(calendar.getTimeInMillis())).toCharArray()));
        calendar.add(Calendar.HOUR, 1);
    }
    Axis axis = new Axis();
    axis.setValues(axisValues);
    axis.setHasLines(true);
    return axis;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:23,代码来源:BgGraphBuilder.java

示例2: basalVsTempBasalyAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis basalVsTempBasalyAxis() {
    Axis yAxis = new Axis();
    yAxis.setAutoGenerated(false);
    List<AxisValue> axisValues = new ArrayList<>();

    for(double j = -maxBasal.intValue(); j <= maxBasal.intValue(); j += 1) {
        //axisValues.add(new AxisValue((float)fitIOB2COBRange(j)));
        AxisValue value = new AxisValue((float)j);
        if (j==0){
            value.setLabel("Basal");
        } else if (j>0){
            value.setLabel("+" + String.valueOf(j) + "u");
        } else {
            value.setLabel(String.valueOf(j) + "u");
        }
        axisValues.add(value);
    }
    yAxis.setValues(axisValues);
    yAxis.setHasLines(true);
    yAxis.setMaxLabelChars(5);
    yAxis.setInside(true);
    return yAxis;
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:24,代码来源:BasalVSTempBasalGraph.java

示例3: iobPastyAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis iobPastyAxis() {
    Axis yAxis = new Axis();
    yAxis.setAutoGenerated(false);
    List<AxisValue> axisValues = new ArrayList<AxisValue>();

    for(int j = 1; j <= 8; j += 1) {
        //axisValues.add(new AxisValue((float)fitIOB2COBRange(j)));
        AxisValue value = new AxisValue(j*10);
        value.setLabel(String.valueOf(j*2) + "u");
        axisValues.add(value);
    }
    yAxis.setTextColor(ChartUtils.COLOR_BLUE);
    yAxis.setValues(axisValues);
    yAxis.setHasLines(true);
    yAxis.setMaxLabelChars(5);
    yAxis.setInside(true);
    return yAxis;
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:19,代码来源:CommonChartSupport.java

示例4: cobPastyAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis cobPastyAxis() {
    Axis yAxis = new Axis();
    yAxis.setAutoGenerated(false);
    List<AxisValue> axisValues = new ArrayList<AxisValue>();

    for(int j = 1; j <= 8; j += 1) {
        AxisValue value = new AxisValue(j*10);
        value.setLabel(String.valueOf(j*10) + "g");
        axisValues.add(value);
    }
    yAxis.setTextColor(ChartUtils.COLOR_ORANGE);
    yAxis.setValues(axisValues);
    yAxis.setHasLines(true);
    yAxis.setMaxLabelChars(5);
    yAxis.setInside(true);
    return yAxis;
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:18,代码来源:CommonChartSupport.java

示例5: previewXAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis previewXAxis(){
    List<AxisValue> previewXaxisValues = new ArrayList<AxisValue>();
    final java.text.DateFormat timeFormat = hourFormat();
    timeFormat.setTimeZone(TimeZone.getDefault());
    for(int l=0; l<=24; l+=hoursPreviewStep) {
        double timestamp = (endHour - (60000 * 60 * l));
        previewXaxisValues.add(new AxisValue((long)(timestamp/fuzz), (timeFormat.format(timestamp)).toCharArray()));
    }
    Axis previewXaxis = new Axis();
    previewXaxis.setValues(previewXaxisValues);
    previewXaxis.setHasLines(true);
    previewXaxis.setTextSize(previewAxisTextSize);
    return previewXaxis;
}
 
开发者ID:StephenBlackWasAlreadyTaken,项目名称:NightWatch,代码行数:15,代码来源:BgGraphBuilder.java

示例6: getYAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
@Override
public Axis getYAxis() {
    Axis axis = new Axis();
    axis.setName("m/s*s");
    axis.setHasLines(true);
    return axis;
}
 
开发者ID:vaslabs,项目名称:SDC,代码行数:8,代码来源:AccelerationChartFragment.java

示例7: getYAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
@Override
public Axis getYAxis() {
    Axis axis = new Axis();
    axis.setName("G's");
    axis.setHasLines(true);
    return axis;
}
 
开发者ID:vaslabs,项目名称:SDC,代码行数:8,代码来源:GforceChartFragment.java

示例8: getYAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
@Override
public Axis getYAxis() {
    Axis axis = new Axis();
    axis.setName("Meters");
    axis.setHasLines(true);
    return axis;
}
 
开发者ID:vaslabs,项目名称:SDC,代码行数:8,代码来源:BarometerChartFragment.java

示例9: previewXAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis previewXAxis() {
    List<AxisValue> previewXaxisValues = new ArrayList<AxisValue>();
    //final java.text.DateFormat timeFormat = hourFormat();
    //timeFormat.setTimeZone(TimeZone.getDefault());
    for (int l = 0; l <= 26; l += hoursPreviewStep) {                                                  //Added 2 hours for future readings
        double timestamp = (endHour - (60000 * 60 * l));
        previewXaxisValues.add(new AxisValue((long) (timestamp), (sdfHour.format(timestamp)).toCharArray()));
    }
    Axis previewXaxis = new Axis();
    previewXaxis.setValues(previewXaxisValues);
    previewXaxis.setHasLines(true);
    previewXaxis.setTextSize(previewAxisTextSize);
    return previewXaxis;
}
 
开发者ID:timomer,项目名称:HAPP,代码行数:15,代码来源:BgGraph.java

示例10: setDistanceAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void setDistanceAxis(LineChartData data) {
    Axis distAxis = new Axis();
    distAxis.setName(getString(R.string.track_statistics_distance));
    distAxis.setTextColor(getResources().getColor(R.color.blue_dark_cario));
    distAxis.setMaxLabelChars(5);
    distAxis.setFormatter(new SimpleAxisValueFormatter()
            .setAppendedText("km".toCharArray()));
    distAxis.setHasLines(true);
    distAxis.setHasTiltedLabels(true);
    distAxis.setTextSize(10);
    distAxis.setHasSeparationLine(false);
    data.setAxisXBottom(distAxis);
}
 
开发者ID:enviroCar,项目名称:enviroCar-app,代码行数:14,代码来源:TrackStatisticsActivity.java

示例11: setYAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void setYAxis(Measurement.PropertyKey key, LineChartData data) {
    Axis yAxis = new Axis();
    yAxis.setName(getString(key.getStringResource()));
    yAxis.setTextColor(getResources().getColor(R.color.blue_dark_cario));
    yAxis.setMaxLabelChars(3);
    yAxis.setHasLines(true);
    yAxis.setTextSize(10);
    yAxis.setFormatter(new SimpleAxisValueFormatter());
    yAxis.setInside(false);
    yAxis.setHasSeparationLine(false);
    data.setAxisYLeft(yAxis);
}
 
开发者ID:enviroCar,项目名称:enviroCar-app,代码行数:13,代码来源:TrackStatisticsActivity.java

示例12: initLineChart

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void initLineChart() {
        Line line = new Line(mPointValues).setColor(Color.parseColor("#FFFAFA"));  //折线的颜色(橙色)
        List<Line> lines = new ArrayList<>();
        line.setShape(ValueShape.CIRCLE);//折线图上每个数据点的形状  这里是圆形 (有三种 :ValueShape.SQUARE  ValueShape.CIRCLE  ValueShape.DIAMOND)
        line.setCubic(false);//曲线是否平滑,即是曲线还是折线
        line.setFilled(false);//是否填充曲线的面积
        line.setHasLabels(true);//曲线的数据坐标是否加上备注
//      line.setHasLabelsOnlyForSelected(true);//点击数据坐标提示数据(设置了这个line.setHasLabels(true);就无效)
        line.setHasLines(true);//是否用线显示。如果为false 则没有曲线只有点显示
        line.setHasPoints(true);//是否显示圆点 如果为false 则没有原点只有点显示(每个数据点都是个大的圆点)
        lines.add(line);
        LineChartData data = new LineChartData();
        data.setLines(lines);

        //坐标轴
        Axis axisX = new Axis(); //X轴
        axisX.setHasTiltedLabels(true);  //X坐标轴字体是斜的显示还是直的,true是斜的显示
        axisX.setTextColor(Color.WHITE);  //设置字体颜色
        //axisX.setName("date");  //表格名称
        axisX.setTextSize(10);//设置字体大小
        axisX.setMaxLabelChars(8); //最多几个X轴坐标,意思就是你的缩放让X轴上数据的个数7<=x<=mAxisXValues.length
        axisX.setValues(mAxisXValues);  //填充X轴的坐标名称
        data.setAxisXBottom(axisX); //x 轴在底部
        //data.setAxisXTop(axisX);  //x 轴在顶部
        axisX.setHasLines(true); //x 轴分割线

        // Y轴是根据数据的大小自动设置Y轴上限(在下面我会给出固定Y轴数据个数的解决方案)
        Axis axisY = new Axis();

        axisY.setName("");//y轴标注
        // axisY.setTextSize(10);//设置字体大小
        axisY.setTextColor(Color.parseColor("#ffffff"));
        data.setAxisYLeft(axisY);  //Y轴设置在左边
        //data.setAxisYRight(axisY);  //y轴设置在右边


        //设置行为属性,支持缩放、滑动以及平移
        lineChart.setInteractive(true);
        lineChart.setZoomType(ZoomType.HORIZONTAL);
        lineChart.setMaxZoom((float) 2);//最大方法比例
        lineChart.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
        lineChart.setLineChartData(data);
        lineChart.setVisibility(View.VISIBLE);
        /**注:下面的7,10只是代表一个数字去类比而已
         * 当时是为了解决X轴固定数据个数。见(http://forum.xda-developers.com/tools/programming/library-hellocharts-charting-library-t2904456/page2);
         */
//        Viewport v = new Viewport(lineChart.getMaximumViewport());
//        v.left = 0;
//        v.right= 7;
//        lineChart.setCurrentViewport(v);
    }
 
开发者ID:gojuukaze,项目名称:healthgo,代码行数:52,代码来源:MainActivity.java

示例13: chartXAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis chartXAxis() {
    Axis xAxis = xAxis();
    xAxis.setHasLines(prefs.getBoolean("show_graph_grid_time", true));
    xAxis.setTextSize(axisTextSize);
    return xAxis;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:7,代码来源:BgGraphBuilder.java

示例14: previewXAxis

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis previewXAxis(){
    Axis previewXaxis = xAxis();
    previewXaxis.setTextSize(previewAxisTextSize);
    previewXaxis.setHasLines(true);
    return previewXaxis;
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:7,代码来源:BgGraphBuilder.java

示例15: updateChart

import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void updateChart(Cursor data) {

        List<AxisValue> axisValuesX = new ArrayList<>();
        List<PointValue> pointValues = new ArrayList<>();

        int counter = -1;
        do {
            counter++;

            String date = data.getString(data.getColumnIndex(
                    QuoteHistoricalDataColumns.DATE));
            String bidPrice = data.getString(data.getColumnIndex(
                    QuoteHistoricalDataColumns.BIDPRICE));

            // We have to show chart in right order.
            int x = data.getCount() - 1 - counter;

            // Point for line chart (date, price).
            PointValue pointValue = new PointValue(x, Float.valueOf(bidPrice));
            pointValue.setLabel(date);
            pointValues.add(pointValue);

            // Set labels for x-axis (we have to reduce its number to avoid overlapping text).
            if (counter != 0 && counter % (data.getCount() / 3) == 0) {
                AxisValue axisValueX = new AxisValue(x);
                axisValueX.setLabel(date);
                axisValuesX.add(axisValueX);
            }

        } while (data.moveToNext());

        // Prepare data for chart
        Line line = new Line(pointValues).setColor(Color.WHITE).setCubic(false);
        List<Line> lines = new ArrayList<>();
        lines.add(line);
        LineChartData lineChartData = new LineChartData();
        lineChartData.setLines(lines);

        // Init x-axis
        Axis axisX = new Axis(axisValuesX);
        axisX.setHasLines(true);
        axisX.setMaxLabelChars(4);
        lineChartData.setAxisXBottom(axisX);

        // Init y-axis
        Axis axisY = new Axis();
        axisY.setAutoGenerated(true);
        axisY.setHasLines(true);
        axisY.setMaxLabelChars(4);
        lineChartData.setAxisYLeft(axisY);

        // Update chart with new data.
        mChart.setInteractive(false);
        mChart.setLineChartData(lineChartData);

        // Show chart
        mChart.setVisibility(View.VISIBLE);
        mTabContent.setVisibility(View.VISIBLE);
    }
 
开发者ID:DmitryMalkovich,项目名称:stock-hawk-app,代码行数:60,代码来源:StockDetailFragment.java


注:本文中的lecho.lib.hellocharts.model.Axis.setHasLines方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。