示例#1
0
        public void GivenTypeRegisteredWhenRequestedThenShouldReturnInstance()
        {
            var expected = new SimpleBar();

            _target.Register <IBar>(ioc => expected);
            var actual = _target.Resolve <IBar>();

            Assert.AreSame(expected, actual, "Test failed: same instance was not returned.");
        }
示例#2
0
    void Init()
    {
        IsActive     = true;
        iceDebuffing = false;
        animator     = transform.GetComponent <Animator>();
        StartCoroutine(EnemyBornEx(new Vector3(0.1f, 0.1f, 1f), new Vector3(1, 1, 1)));

        hpBar          = transform.GetComponentInChildren <SimpleBar>();
        hpBar.Hp_total = max_hp;
        hpBar.Hp_now   = max_hp;
        debuffs        = new List <AbsDebuff>();

        SetPath(LevelManager.Instance.Path);
    }
示例#3
0
 private void ShowCharts(DataTable dataTable, Echarts echarts)
 {
     echarts.CreateTableLayout(2, 3, (browser.Width - 20) / 3, (browser.Height - 20) / 2);//创建布局
     echarts[1, 1] = new SimpleBar(dataTable, new CompleteOption()
     {
         title = new Title()
         {
             text = "'基础柱状图'",
         }
     }, 1);
     echarts[1, 2] = new BasicLineChart(dataTable, new CompleteOption()
     {
         title = new Title()
         {
             text = "'基础折线图'",
         }
     }, 1);
     echarts[1, 3] = new BasicScatter(dataTable, new CompleteOption()
     {
         title = new Title()
         {
             text = "'基础散点图'",
         }
     }, 1);
     echarts[2, 1] = new SmoothedLineChart(dataTable, new CompleteOption()
     {
         title = new Title()
         {
             text = "'基础曲线图'",
         }
     }, 1);
     echarts[2, 2] = new StackBar(dataTable, new CompleteOption()
     {
         title = new Title()
         {
             text = "'堆叠柱状图'",
         }
     }, 1);
     echarts[2, 3] = new BasicPie(dataTable, new CompleteOption()
     {
         title = new Title()
         {
             text = "'简单饼图'",
         }
     }, 1);
     echarts.Show();//显示
 }
示例#4
0
        //自适应两行三列
        static void ShowECharts(WebBrowser browser, DataTable dataTable, Echarts echarts)
        {
            echarts.AddTheme(Theme.roma);
            echarts.CreateTableLayout(row, col, (browser.Width - 20) / col, (browser.Height - 20) / row);

            echarts[1, 1] = new SimpleBar(dataTable, new CompleteOption()
            {
                title = new Title()
                {
                    text = "'基础柱状图'",
                }
            }, 1);
            echarts[1, 2] = new BasicLineChart(dataTable, new CompleteOption()
            {
                title = new Title()
                {
                    text = "'基础折线图'",
                }
            }, 1);
            echarts[1, 3] = new BasicScatter(dataTable, new CompleteOption()
            {
                title = new Title()
                {
                    text = "'基础散点图'",
                }
            }, 1);
            //echarts[1, 3] = new BasicAreachart(dataTable,new CompleteOption() { title = new Title() { text = "'基础面积图'", } }, 1);
            echarts[2, 1] = new SmoothedLineChart(dataTable, new CompleteOption()
            {
                title = new Title()
                {
                    text = "'基础曲线图'",
                }
            }, 1);
            echarts[2, 2] = new StackBar(dataTable, new CompleteOption()
            {
                title = new Title()
                {
                    text = "'堆叠柱状图'",
                }
            }, 1);
            echarts[2, 3] = new BasicPie(dataTable, new CompleteOption(), 1);
            echarts.Show();
        }
示例#5
0
        private static void ThreadStart()
        {
            //01 初始化数据,默认列名作标签轴
            DataTable dataTable = new DataTable("temp");

            dataTable.Columns.Add("产品", typeof(string));
            dataTable.Columns.Add("2015", typeof(float));
            dataTable.Columns.Add("2016", typeof(float));
            dataTable.Columns.Add("2017", typeof(float));
            dataTable.Rows.Add("中国", 43.3, 85.8, 93.7);
            dataTable.Rows.Add("美国", 83.1, 73.4, 55.1);
            dataTable.Rows.Add("日本", 86.4, 65.2, 82.5);
            dataTable.Rows.Add("英国", 72.4, 53.9, 39.1);

            //02.add browser
            int        row = 2, col = 3, width = 500, height = 370;
            WebBrowser browser = new WebBrowser();

            browser.Dock     = DockStyle.Fill;
            browser.TabIndex = 0;
            browser.Size     = new Size(col * width, row * height);

            //EchartsInitialize.SupportEchartsGL = true;
            //EchartsInitialize.SupportBootstrap = true;
            //03.创建布局,增加图,Show()显示图
            Echarts echarts = new Echarts(browser);

            echarts.AddTheme(Theme.roma);
            echarts.CreateTableLayout(row, col, width, height);

            echarts[1, 1] = new SimpleBar(dataTable, new CompleteOption()
            {
                title = new Title()
                {
                    text = "'基础柱状图'",
                }
            }, 1);
            echarts[1, 2] = new BasicLineChart(dataTable, new CompleteOption()
            {
                title = new Title()
                {
                    text = "'基础折线图'",
                }
            }, 1);
            echarts[1, 3] = new BasicScatter(dataTable, new CompleteOption()
            {
                title = new Title()
                {
                    text = "'基础散点图'",
                }
            }, 1);
            //echarts[1, 3] = new BasicAreachart(dataTable,new CompleteOption() { title = new Title() { text = "'基础面积图'", } }, 1);
            echarts[2, 1] = new SmoothedLineChart(dataTable, new CompleteOption()
            {
                title = new Title()
                {
                    text = "'基础曲线图'",
                }
            }, 1);
            echarts[2, 2] = new StackBar(dataTable, new CompleteOption()
            {
                title = new Title()
                {
                    text = "'堆叠柱状图'",
                }
            }, 1);
            echarts[2, 3] = new BasicPie(dataTable, new CompleteOption(), 1);
            echarts.Show();

            //04 - -
            Form form = new Form();

            form.FormClosing += delegate { browser.Dispose(); Environment.Exit(0); };
            form.Size         = new Size(col * width + 45, row * height + 60);
            form.Controls.Add(browser);
            form.StartPosition = FormStartPosition.CenterScreen;
            Application.Run(form);
        }