• k线图


    package fwm.byte100.goodsMode
    {
        import flash.display.Sprite;
        import fwm.assist.bit101.components.Label;
     /* description:
      * author:  fwm
      * date:    2013-10-16  下午9:35:15
      * project: ByteGame100  
      * http://www.byte100.com 
      * copyright  2013~2015 by lzn
      */
        public class KlineBg extends Sprite
        {
            private var wBg:int, hBg:int;
            public function KlineBg(_w:int,_h:int)
            {
                wBg = _w;
                hBg = _h;
                this.graphics.lineStyle(2, 0xff0000);
                this.graphics.moveTo(0, 0);
                this.graphics.lineTo(0, hBg);
                this.graphics.lineTo(wBg, hBg);
                new Label(this, -30, _h-10, "25.0");
                for (var i:int = 0; i < 10; i++) {
                    DrawDottedHLine(i * (_h / 10), _w);
                    var lb:Label = new Label(this, -30,i * (_h / 10)-10,  (75 - i * 5).toString()+".0");
                }
                for (var j:int = 1; j < 4; j++) {
                    DrawDottedVLine(j * (_w / 4), _h);
                }
                
                this.graphics.lineStyle(1, 0xFFFFFF);
                DrawK_test(_w);
            }
            
            private function DrawPoint(_time:int, _value:Number):void {
                var y:int = _value * hBg/10
            }
            
            private function DrawK_test(_w:int):void {
                var s:int = 0;
                var m:int = Math.random() * 50 + 25;
                for (var i:int = 0; i < 50; i++) {
                    this.graphics.moveTo(s, m);
                    var d:int = i * (_w / 50);
                    var y:int = (int(Math.random() * 50) + 25)-25;
                    this.graphics.lineTo(d, y);
                    s = d;
                    m = y;
                    trace(y);
                }
            }
            
            private function DrawDottedHLine(_y:int, _w:int):void {
                this.graphics.lineStyle(1, 0xA2270D);
                var s:int = 0;
                var m:int = 4;
                for (var i:int = 0; i < int(_w/6); i++) {
                    this.graphics.moveTo(s, _y);
                    this.graphics.lineTo(m, _y);
                    s = m + 2;
                    m = s + 4;
                    trace(s, "-", m);
                }
            }
            
            private function DrawDottedVLine(_x:int, _h:int):void {
                this.graphics.lineStyle(1, 0xA2270D);
                var s:int = 0;
                var m:int = 4;
                for (var i:int = 0; i < int(_h/6); i++) {
                    this.graphics.moveTo(_x, s);
                    this.graphics.lineTo(_x, m);
                    s = m + 2;
                    m = s + 4;
                    trace(s, "-", m);
                }
            }
        }
    }
  • 相关阅读:
    hdu5360 Hiking(水题)
    hdu5348 MZL's endless loop(欧拉回路)
    hdu5351 MZL's Border(规律题,java)
    hdu5347 MZL's chemistry(打表)
    hdu5344 MZL's xor(水题)
    hdu5338 ZZX and Permutations(贪心、线段树)
    hdu 5325 Crazy Bobo (树形dp)
    hdu5323 Solve this interesting problem(爆搜)
    hdu5322 Hope(dp)
    Lightoj1009 Back to Underworld(带权并查集)
  • 原文地址:https://www.cnblogs.com/GameCode/p/3373179.html
Copyright © 2020-2023  润新知