• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java XYGraphWidget类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.androidplot.xy.XYGraphWidget的典型用法代码示例。如果您正苦于以下问题:Java XYGraphWidget类的具体用法?Java XYGraphWidget怎么用?Java XYGraphWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XYGraphWidget类属于com.androidplot.xy包,在下文中一共展示了XYGraphWidget类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setupGraphWidget

import com.androidplot.xy.XYGraphWidget; //导入依赖的package包/类
private void setupGraphWidget() {
  // Customize the graphwidget
  // Remove the border lines
  plot.setBorderStyle(Plot.BorderStyle.NONE, null, null);
  XYGraphWidget graphWidget = plot.getGraphWidget();

  // Some tune ups tp the padding
  graphWidget.setPaddingTop(45.0f);
  graphWidget.setPaddingLeft(60.0f);
  graphWidget.setPaddingBottom(45.0f);
  graphWidget.setPaddingRight(20.0f);

  // Set transparent bagrounds
  graphWidget.getBackgroundPaint().setColor(Color.TRANSPARENT);
  graphWidget.getGridBackgroundPaint().setColor(Color.TRANSPARENT);

  // Customize the origin domain label, set the applications color, fix up the sizes and tweaks to the gridlines
  graphWidget.getDomainOriginLabelPaint().setColor(getResources().getColor(R.color.opensignals_text_field));
  graphWidget.getDomainOriginLabelPaint().setTextSize(40.0f);
  graphWidget.getDomainOriginLinePaint().setColor(getResources().getColor(R.color.opensignals_text_field));
  graphWidget.getDomainOriginLinePaint().setStrokeWidth(0.5f);
  graphWidget.getDomainGridLinePaint().setColor(Color.TRANSPARENT);

  // Customize the origin range label, set the applications color, fix up the sizes and tweaks to the gridlines
  graphWidget.getRangeOriginLabelPaint().setColor(getResources().getColor(R.color.opensignals_text_field));
  graphWidget.getRangeOriginLabelPaint().setTextSize(40.0f);
  graphWidget.getRangeOriginLinePaint().setColor(getResources().getColor(R.color.opensignals_text_field));
  graphWidget.getRangeOriginLinePaint().setStrokeWidth(0.5f);
  graphWidget.getRangeGridLinePaint().setStrokeWidth(1.0f);

  // Remove unnecessary widgets
  plot.getLayoutManager().remove(plot.getLegendWidget());
  plot.getLayoutManager().remove(plot.getTitleWidget());
}
 
开发者ID:pires,项目名称:opensignals-android,代码行数:35,代码来源:PortPageFragment.java


示例2: setRangeValueFormat

import com.androidplot.xy.XYGraphWidget; //导入依赖的package包/类
public void setRangeValueFormat(final Format yAxisFormat) {
    mViewPlot.getGraph().getLineLabelStyle(XYGraphWidget.Edge.LEFT).setFormat(yAxisFormat);
}
 
开发者ID:Sensirion,项目名称:SmartGadget-Android,代码行数:4,代码来源:PlotHandler.java


示例3: setDomainValueFormat

import com.androidplot.xy.XYGraphWidget; //导入依赖的package包/类
public void setDomainValueFormat(final Format xAxisFormat) {
    mViewPlot.getGraph().getLineLabelStyle(XYGraphWidget.Edge.BOTTOM).setFormat(xAxisFormat);
}
 
开发者ID:Sensirion,项目名称:SmartGadget-Android,代码行数:4,代码来源:PlotHandler.java


示例4: onCreateView

import com.androidplot.xy.XYGraphWidget; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, 
    Bundle savedInstanceState) {
    
    // If activity recreated (such as from screen rotate), restore
    // the previous article selection set by onSaveInstanceState().
    // This is primarily necessary when in the two-pane layout.
    if (savedInstanceState != null) {
        currentItem = savedInstanceState.getInt(ARG_ITEM);
    }
    

    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.details_view, container, false);
    
    toggle = (ToggleButton)view.findViewById(R.id.pn_switch);
    toggleContainer = view.findViewById(R.id.toggle_container);
    
    this.enablePN();

    holder.put("stock_name",(TextView)view.findViewById(R.id.d_stock_name));
    holder.put("last_price",(TextView)view.findViewById(R.id.d_last_price));
    holder.put("time",(TextView)view.findViewById(R.id.d_time));
    holder.put("pct_change",(TextView)view.findViewById(R.id.d_pct_change));
    holder.put("bid_quantity",(TextView)view.findViewById(R.id.d_bid_quantity));
    holder.put("bid",(TextView)view.findViewById(R.id.d_bid));
    holder.put("ask",(TextView)view.findViewById(R.id.d_ask));
    holder.put("ask_quantity",(TextView)view.findViewById(R.id.d_ask_quantity));
    holder.put("min",(TextView)view.findViewById(R.id.d_min));
    holder.put("max",(TextView)view.findViewById(R.id.d_max));
    holder.put("open_price",(TextView)view.findViewById(R.id.d_open_price));
    
    final XYPlot plot = (XYPlot) view.findViewById(R.id.mySimpleXYPlot);
    chart.setPlot(plot);
    
    plot.setOnTouchListener(new OnTouchListener(){
        
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            v.performClick();
            
            int action = event.getActionMasked();
            
            float touchY = event.getY();
            float touchX = event.getX();
            
            XYGraphWidget widget = plot.getGraphWidget();
            RectF gridRect = widget.getGridRect();
            if(gridRect.contains(touchX, touchY)){
                
                if (currentSubscription != null) {
                    double triggerVal = widget.getYVal(touchY);
                   
                    /*
                    chart.setMovingTriggerLine(triggerVal);
                    if (action == MotionEvent.ACTION_UP) {
                        triggerVal =  Math.round(triggerVal*100.0)/100.0;
                        chart.endMovingTriggerLine(triggerVal);
                        
                        Log.d(TAG,"Touch released @ " + triggerVal);
                        //go on the network only after the touch has been released
                        subscriptionHandling.activateMPN(getMpnInfo(triggerVal));
                    }
                    */
                    if (action == MotionEvent.ACTION_UP) {
                        triggerVal =  Math.round(triggerVal*100.0)/100.0;
                        currentSubscription.toggleTrigger(triggerVal);
                    }
                    
                } else {
                    Log.v(TAG,"touch ignored");
                }
            }
            
            return true;
        }
    });
    
    return view;
}
 
开发者ID:Lightstreamer,项目名称:Lightstreamer-example-MPNStockList-client-android,代码行数:81,代码来源:DetailsFragment.java



注:本文中的com.androidplot.xy.XYGraphWidget类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Table类代码示例发布时间:2022-05-23
下一篇:
Java UIInterfaceOrientationMask类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap