Ejemplo n.º 1
0
 private void btnGenerate_Click(object sender, EventArgs e)
 {
     switch (cmbReportType.Text)
     {
         case "Grid":
             GridReport gR = new GridReport();
             gR.setVars(cmbGroupBy.Text, cmbSY.Text);
             gR.Show();
             break;
         case "Bar Chart":
             BarChart bC = new BarChart();
             bC.setVars(cmbGroupBy.Text, cmbSY.Text);
             bC.Show();
             break;
         case "Line Chart":
             LineChart lC = new LineChart();
             lC.setVars(cmbGroupBy.Text, cmbSY.Text);
             lC.Show();
             break;
         case "Pie Chart":
             PieChart pC = new PieChart();
             pC.setVars(cmbGroupBy.Text, cmbSY.Text);
             pC.Show();
             break;
     }
 }
Ejemplo n.º 2
0
        protected void GraficaHab()
        {
            string titulo = "Gráfica de cantidad alojamientos habitaciones turísticos por año";
            // Create a chart
            LineChart oChart = new LineChart();
            oChart.ChartNumericalLimits.YAxisMinValue = 100;

            // Set properties
            oChart.Background.BgColor = "ffffff";
            oChart.Background.BgAlpha = 50;
            oChart.ChartTitles.Caption = titulo;
            oChart.ChartTitles.SubCaption = "RD";

            // Set a template
            oChart.Template = new Libero.FusionCharts.Template.OfficeTemplate();

            // Set data
            DataSet1TableAdapters.GetEconomiaGraficaTableAdapter db = new DataSet1TableAdapters.GetEconomiaGraficaTableAdapter();

            DataTable dtSample = db.GetData(cmb1.SelectedItem.ToString());
            oChart.DataSource = dtSample;
            oChart.DataTextField = "nAno";
            oChart.DataValueField = "nHabitaciones";

            // Link the WebControl and the Chart
            FChart1.ShowChart(oChart);
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            DataTable dtSample = DesempleoRamaOcupacion.getDesempleo(DDL_Ramas.SelectedValue);
            DataTable dtSample2 = DesempleoRamaOcupacion.getDesempleo(null, DDL_Anos.SelectedValue);
            DivEducacion.InnerHtml = "<center>" + DDL_Ramas.SelectedItem.Text + "</center>" + HTMLString.GetHTMLTable(dtSample, "TB_Desempleo");
            DivEducacion2.InnerHtml = "<center>" + DDL_Anos.SelectedItem.Text + "</center>" + HTMLString.GetHTMLTable(dtSample2, "TB_Desempleo2");
            LineChart oChart = new LineChart();
            Pie2DChart oChart1 = new Pie2DChart();
            // Set properties
            oChart.Background.BgColor = "ffffff";
            oChart.Background.BgAlpha = 50;
            oChart.ChartTitles.Caption = "Matricula " + DDL_Ramas.SelectedItem.Text;
            oChart1.Background.BgColor = "ffffff";
            oChart1.Background.BgAlpha = 50;
            oChart1.ChartTitles.Caption = "Matriculas " + DDL_Anos.SelectedItem.Text;
            // Set a template
            oChart.Template = new Libero.FusionCharts.Template.OfficeTemplate();
            oChart1.Template = new Libero.FusionCharts.Template.OfficeTemplate();
            // Set data   *DataTable OR IList<T>
            oChart.DataSource = dtSample;
            oChart1.DataSource = dtSample2;
            //oChart.DataCategoryTextField = "cAno";
            //oChart.DataSeriesTextField = "cDescripcion";
            //oChart.DataSeriesValueField = "nCantidad";
            oChart.DataTextField = "nAno";
            oChart.DataValueField = "nCantidad";
            oChart1.DataTextField = "cDescripcion";
            oChart1.DataValueField = "nCantidad";
            oChart1.PieVisibility.ShowPercentageInLabel = true;

            // Link the WebControl and the Chart
            chtProductSales.ShowChart(oChart);
            FChart1.ShowChart(oChart1);
        }
Ejemplo n.º 4
0
		private void Window1_Loaded(object sender, RoutedEventArgs e)
		{
			//plotter.Viewport.Visible = new DataRect(-1, -1.1, 200, 2.2);

			const int count = 14000;
			Point[] pts = new Point[count];

			for (int i = 0; i < count; i++)
			{
				double x = i / 20.0 - 1000;
				pts[i] = new Point(x, Math.Sin(x));
			}

#if !old
			var ds = pts.AsDataSource();

			LineChart chart = new LineChart { DataSource = ds };
			//chart.Filters.Clear();

			//InclinationFilter filter = new InclinationFilter();
			//BindingOperations.SetBinding(filter, InclinationFilter.CriticalAngleProperty, new Binding { Path = new PropertyPath("Value"), Source = slider });
			//chart.Filters.Add(filter);
			plotter.Children.Add(chart);

			//plotter.Children.Add(new LineChart { DataSource = new FunctionalDataSource { Function = x => Math.Atan(x) } });
			//plotter.Children.Add(new LineChart { DataSource = new FunctionalDataSource { Function = x => Math.Tan(x) } });
#else
			var ds2 = new Microsoft.Research.DynamicDataDisplay.DataSources.RawDataSource(pts);
			lineGraph = plotter.AddLineGraph(ds2);
#endif

			((NumericAxis)plotter.MainHorizontalAxis).TicksProvider = new CustomBaseNumericTicksProvider(Math.PI);
			((NumericAxis)plotter.MainHorizontalAxis).LabelProvider = new CustomBaseNumericLabelProvider(Math.PI, "π");
		}
Ejemplo n.º 5
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="lc"></param>
        /// <param name="lccfg"></param>
        public static void Set(LineChart lc, LineChartConfig lccfg, object dataSource, string valueFormatString)
        {
            if (lc == null)
                throw new ArgumentNullException("lc");

            if (lccfg == null)
                throw new ArgumentNullException("lccfg");

            if (dataSource == null)
                throw new ArgumentNullException("dataSource");

            lc.Series.Clear();
            lc.Graphs.Clear();

            foreach ( LineGraphItemConfig itemConfig in lccfg.LineGraphItemConfigCollection )
            {
                am.Charts.LineChartGraph lcg = new LineChartGraph();
                lcg.EnableViewState = false;

                if (itemConfig.Color != Color.White)
                {
                    // title color
                    //
                    lcg.BalloonColor = itemConfig.Color;
                    // data point color
                    //
                    lcg.BulletColor = itemConfig.Color;
                    // line color
                    //
                    lcg.ForeColor = itemConfig.Color;
                }

                lcg.Title = itemConfig.Title;
                lcg.Bullet = LineChartBulletTypes.Round;
                DataView dsTable = dataSource as DataView;
                foreach (DataRowView rowView in dsTable)
                {
                    string seriesItemID = rowView.Row[lccfg.DataSeriesIDField].ToString();
                    object value = rowView.Row[itemConfig.DataValueField];
                    if (value == null || value == DBNull.Value)
                        continue;

                    value = Convert.ToDouble(value);
                    string strValue = string.Format(valueFormatString, value);
                    LineChartValuesDataItem item = new LineChartValuesDataItem(seriesItemID,
                        strValue);
                    lcg.Items.Add(item);
                }
                lc.Graphs.Add(lcg);
            }

            lc.YLeftValuesMin = lccfg.YLeftValueMin;
            lc.Connect = true;
            lc.DataSeriesIDField = lccfg.DataSeriesIDField;

            DataView view = dataSource as DataView;
            DataTable tbl =  view.ToTable(true, lccfg.DataSeriesIDField);
            lc.DataSource = tbl;
            lc.DataBind();
        }
 protected override Image DoCreateChartImage()
 {
     var webChart = new LineChart(GenerateChartPointCollection());
     webChart.Engine = new ChartEngine {Size = new Size(Parameters.ChartWidth, Parameters.ChartHeight)};
     webChart.Engine.Charts = new ChartCollection(webChart.Engine) {webChart};
     return webChart.Engine.GetBitmap();
 }
Ejemplo n.º 7
0
		void Line1()
		{
			Point[] pts = LoadPoints();
			var ds = DataSource.CreateFrom(pts);

			LineChart chart = new LineChart();
			chart.Stroke = Brushes.Red;
			chart.DataSource = ds;
		}
Ejemplo n.º 8
0
 /// <summary>
 /// Creates a new BankAccount object.
 /// </summary>
 /// <param name="holder">The name of the account holder.</param>
 /// <param name="id">An ID for the account.</param>
 /// <param name="name">A name for the account.</param>
 /// <param name="bsb">A BSB number for the account.</param>
 /// <param name="number">An account number for the account.</param>
 /// <param name="current">A current balance for the account.</param>
 /// <param name="available">An available balance for the account.</param>
 /// <param name="recentTransactions">A collection of transactions from which line chart data can be generated.</param>
 public BankAccount(string holder, string id, string name, string bsb, string number, float current, float available, BankTransactionCollection recentTransactions)
 {
     Holder = holder;
     Id = id;
     Name = name;
     Bsb = bsb;
     Number = number;
     Current = current;
     Available = available;
     ChartData = new LineChart(recentTransactions);
 }
    // Use this for initialization
    void Start () {
        tangoServiceTroublePopup.SetActive(false);
        tangoInitializePopup.SetActive(false);

        apiChart = new LineChart (viewController, chartPosition, Color.red, 100);
        renderChart = new LineChart (viewController, chartPosition, Color.green, 100);
        baselineChart = new LineChart (viewController, chartPosition, Color.gray, 100);

        apiChart.line.enabled = showPlots;
        renderChart.line.enabled = showPlots;
        baselineChart.line.enabled = showPlots;
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DS_DECTableAdapters.SP_GetAnosTableAdapter ad = new DS_DECTableAdapters.SP_GetAnosTableAdapter();
                DS_DECTableAdapters.SP_GetEdadMadreTableAdapter ad2 = new DS_DECTableAdapters.SP_GetEdadMadreTableAdapter();
                DS_DECTableAdapters.SP_GetNatalidadEdadMadreTableAdapter ad3 = new DS_DECTableAdapters.SP_GetNatalidadEdadMadreTableAdapter();
                DDL_Edades.DataSource = ad2.GetEdadMadre();
                DDL_Anos.DataSource = ad.GetAnos();
                DDL_Edades.DataBind();
                DDL_Anos.DataBind();
                DataTable dtSample = ad3.GetNatalidadEdadMadre(DDL_Edades.SelectedValue,null);
                DataTable dtSample2 = ad3.GetNatalidadEdadMadre(null, DDL_Anos.SelectedValue);
                DivEducacion.InnerHtml = "<center>" + DDL_Edades.SelectedItem.Text + "</center>" + HTMLString.GetHTMLTable(dtSample, "TB_Desempleo");
                DivEducacion2.InnerHtml = "<center>" + DDL_Anos.SelectedItem.Text + "</center>" + HTMLString.GetHTMLTable(dtSample2, "TB_Desempleo2");
                LineChart oChart = new LineChart();
                Pie2DChart oChart1 = new Pie2DChart();
                oChart.ChartNumericalLimits.YAxisMinValue=6000;
                // Set properties
                oChart.Background.BgColor = "ffffff";
                oChart.Background.BgAlpha = 50;
                oChart.ChartTitles.Caption = "Edades " + DDL_Edades.SelectedItem.Text;
                oChart1.Background.BgColor = "ffffff";
                oChart1.Background.BgAlpha = 50;
                oChart1.ChartTitles.Caption = "Edades " + DDL_Anos.SelectedItem.Text;
                // Set a template
                oChart.Template = new Libero.FusionCharts.Template.OfficeTemplate();
                oChart1.Template = new Libero.FusionCharts.Template.OfficeTemplate();
                // Set data   *DataTable OR IList<T>
                oChart.DataSource = dtSample;
                oChart1.DataSource = dtSample2;
                //oChart.DataCategoryTextField = "cAno";
                //oChart.DataSeriesTextField = "cDescripcion";
                //oChart.DataSeriesValueField = "nCantidad";
                oChart.DataTextField = "nAno";
                oChart.DataValueField = "fNacimientos";
                oChart1.DataTextField = "EdadMadre";
                oChart1.DataValueField = "fNacimientos";
                oChart1.PieVisibility.ShowPercentageInLabel = true;

                // Link the WebControl and the Chart
                chtProductSales.ShowChart(oChart);
                FChart1.ShowChart(oChart1);
            }
        }
Ejemplo n.º 11
0
		void Window1_Loaded(object sender, RoutedEventArgs e)
		{
			plotter.Children.Add(new HorizontalLine { Value = 0, Stroke = Brushes.DarkGreen.MakeTransparent(0.2) });
			plotter.Children.Add(new VerticalLine { Value = 0, Stroke = Brushes.DarkGreen.MakeTransparent(0.2) });

#if old
			var xs = Enumerable.Range(0, 500).Select(i => (i - 250) * 0.02);
			var sineYDS = xs.Select(x => Math.Sin(x)).AsYDataSource();
			var atanYDS = xs.Select(x => Math.Atan(x)).AsYDataSource();

			var sineDS = new CompositeDataSource(xs.AsXDataSource(), sineYDS);
			var atanDS = new CompositeDataSource(xs.AsXDataSource(), atanYDS);

			var sineChart = plotter.AddLineGraph(sineDS);
			var atanChart = plotter.AddLineGraph(atanDS);

			//sineChart.Filters.Clear();
			//atanChart.Filters.Clear();
#else
			var xs = Enumerable.Range(0, 500).Select(i => (i - 250) * 0.02);
			var sineDS = xs.Select(x => new Point(x, Math.Sin(x))).AsDataSource();
			var atanDS = xs.Select(x => new Point(x, Math.Atan(x))).AsDataSource();
			var sincDS = Enumerable.Range(-5000, 10001).Select(i =>
			{
				double x = Math.PI * i / 1000;
				double y;
				if (i == 0)
					y = 100;
				else
					y = Math.Sin(x * 100);
				return new Point(x, y);
			}).AsDataSource();

			LineChart sincChart = new LineChart { Stroke = ColorHelper.RandomBrush, DataSource = sincDS };
			//plotter.Children.Add(sincChart);


			LineChart sineChart = new LineChart { Stroke = ColorHelper.RandomBrush, DataSource = sineDS };
			plotter.Children.Add(sineChart);
			LineChart atanChart = new LineChart { Stroke = ColorHelper.RandomBrush, DataSource = atanDS };
			plotter.Children.Add(atanChart);
#endif
		}
Ejemplo n.º 12
0
	override public void OnInspectorGUI() {
		if (numbers == null) numbers = new List<float>();
		// Enable this to check more frequently
		// if (EditorApplication.update != this.EditorUpdate) EditorApplication.update += this.EditorUpdate;
		if (EditorApplication.isPlaying && !EditorApplication.isPaused) numbers.Add((float)((TestInspector)target).random);
		if (numbers.Count > 100) numbers.RemoveAt(0);
		if (lineChart == null) {
			lineChart = new LineChart(this, 200.0f);
		}
		lineChart.data = new List<float>[]{numbers};
		lineChart.pipRadius = 1.0f;
		lineChart.drawTicks = false;
		// Make sure you do this or the cahrts wont work
		Handles.BeginGUI();
		lineChart.DrawChart();
		Handles.EndGUI();
	
		
	}
Ejemplo n.º 13
0
        public MainPage()
        {
            InitializeComponent();

            var entries = new[] {
                new Microcharts.Entry(100)
                {
                    Color      = SKColor.Parse("#4286f4"),
                    Label      = "x",
                    ValueLabel = "100%"
                },
                new Microcharts.Entry(90)
                {
                    Color      = SKColor.Parse("#ba1079"),
                    Label      = "x",
                    ValueLabel = "90%"
                },
                new Microcharts.Entry(70)
                {
                    Color      = SKColor.Parse("#5ae273"),
                    Label      = "x",
                    ValueLabel = "70%"
                },
            };

            Chart BarChartSample = new DonutChart()
            {
                Entries = entries
            };

            this.chartView.Chart = BarChartSample;

            Chart BarChartSample2 = new LineChart()
            {
                Entries = entries
            };

            this.chartView2.Chart = BarChartSample2;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.GraphAppLayout);

            Button time    = FindViewById <Button>(Resource.Id.time);
            Button history = FindViewById <Button>(Resource.Id.history);

            time.Click    += goToTime;
            history.Click += goToHistory;

            //it fetches all the past records to be plotted
            dbConnection = new DbConnection();
            var values = dbConnection.retrieveData();

            Entry[] entries = new Entry[values.Count];

            //this creates entries to be plotted on the linear graph
            for (int i = 0; i < entries.Length; i++)
            {
                var splitData = values[i].Split(' ');
                entries[i] = new Entry(float.Parse(splitData[2]))
                {
                    Label      = splitData[0],
                    ValueLabel = splitData[2]
                };
            }
            //create a line chart of the entries created
            var chart = new LineChart()
            {
                Entries = entries
            };

            //assign the chart to the chart view in the graph page
            var chartView = FindViewById <ChartView>(Resource.Id.chartView);

            chartView.Chart = chart;
        }
        public override Result GetChart <T>(System.Web.HttpContext context)
        {
            List <LineChartLine> lines = new List <LineChartLine>();
            int        modetype        = Convert.ToInt32(context.Request["modetype"]);
            int        showtype        = Convert.ToInt32(context.Request["showtype"]);
            DateTime   begintime       = Convert.ToDateTime(context.Request["begintime"]);
            DateTime   endtime         = Convert.ToDateTime(context.Request["endtime"]);
            string     stattype        = context.Request["stattype"];
            List <int> stattypes       = stattype.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(p => Convert.ToInt32(p)).ToList();
            int        softid          = Convert.ToInt32(context.Request["softid"]);
            int        platform        = Convert.ToInt32(context.Request["platform"]);

            var lists      = GetData <T>(context, false) as List <List <D_StatDownCountsBySoft_SUM> >;
            var lstversion = B_BaseToolService.Instance.GetVersionCache(softid, platform);

            foreach (int itemstattype in stattypes)
            {
                for (int j = 0; j < lists.Count; j++)
                {
                    var linename = GetLineName(modetype, lists[j][0], itemstattype, lstversion);
                    List <LineChartPoint> points = lists[j].Select(p => new LineChartPoint
                    {
                        XValue      = p.StatDate.ToString("yyyyMMdd"),
                        DataContext = "",
                        NumberType  = showtype == 3 ? 3 : 1,
                        Description = "",
                        YValue      = GetValue(p, itemstattype).ToString()
                    }).ToList();
                    lines.Add(new LineChartLine {
                        Name = linename, Points = points, Show = true
                    });
                }
            }
            LineChart line   = new LineChart(GetXLine(begintime, endtime, 1), lines);
            string    result = "{ x:" + line.GetXJson(p => { return(""); }) + ",y:" + line.GetYJson(p => { return(""); }) + ",title:'" + "下载量查询(资源/位置)" + "'}";

            return(Result.GetSuccessedResult(result, true));
        }
Ejemplo n.º 16
0
        private void Build()
        {
            var mainVox = new Gtk.VBox();

            //List
            this.lc   = new LineChart("Weigth");
            lc.XLabel = "Day";
            lc.FixedX = true;
            lc.YLabel = "Kg";

            lc.MinXValue   = 1;
            lc.MaxXValue   = 30;
            lc.XResolution = (int)(lc.MaxXValue - 1);



            rbWeight          = new RadioButton(null, "Weight");
            group             = rbWeight.Group;
            rbWeight.Active   = true;
            rbAC              = new RadioButton(rbWeight, "Abc. Circ.");
            rbWeight.Clicked += (sender, e) => ShowWeightGraphic();
            rbAC.Clicked     += (sender, e) => ShowACGraphic();

            HBox cont = new HBox();

            cont.PackStart(rbWeight);
            cont.Add(rbAC);

            mainVox.PackStart(cont, false, false, 0);
            mainVox.Add(lc);


            //Wrap
            PackStart(mainVox, true, true, 0);

            //Update state and render
            this.OnViewBuilt();
        }
Ejemplo n.º 17
0
        private void SalesReport()
        {
            var obj = (TravelSession)Session["TravelPortalSessionInfo"];

            DateTime fromdate = (DateTime)Session["DBFromDate"];
            DateTime toDate   = (DateTime)Session["DBToDate"];
            var      da       = ent.Air_DB_GetSales(fromdate, toDate, null);

            Libero.FusionCharts.LineChart chart = new LineChart();

            // Set properties
            chart.Background.BgColor     = "ffffff";
            chart.Background.BgAlpha     = 50;
            chart.ChartTitles.Caption    = "Sales Status";
            chart.ChartTitles.SubCaption = fromdate.ToString(System.Web.Configuration.WebConfigurationManager.AppSettings["DateFormat"]) + " - " + toDate.ToString(System.Web.Configuration.WebConfigurationManager.AppSettings["DateFormat"]);

            // Set a template
            chart.Template = new Libero.FusionCharts.Template.OfficeDarkTemplate();
            //chart.PiePropertySet.PieSliceDepth = 15;
            chart.LinePropertySet.LineColor = "Blue";

            // chart.GenericVisibility.ShowNames = true;

            DataTable dt = new DataTable();

            dt.Columns.Add("AirlineCode");
            dt.Columns.Add("Amount");

            foreach (var item in da)
            {
                dt.Rows.Add(new object[] { item.AirlineCode, item.Amount });
            }
            chart.DataSource     = dt;
            chart.DataTextField  = "AirlineCode";
            chart.DataValueField = "Amount";

            ViewData["SalesChart"] = chart;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SessionData);

            // Layout have a object in which the chart will be displayed
            // Referencing that object
            lineChart = (LineChart)FindViewById(Resource.Id.linechart);

            List <Entry> yVals = new List <Entry>();

            double j = 0;

            for (int i = 0; i < 1000; i++)
            {
                // float x1 = float.Parse((Math.Sin(x)).ToString());
                float y = float.Parse((Math.Sin(j).ToString()));
                j++;
                yVals.Add(new Entry(i, y));
            }
            // Data for Ine Chart is set
            LineDataSet sety = new LineDataSet(yVals, "yData");

            // Enables chart to be clear
            sety.SetDrawCircles(false);
            // Displays scrollable chart
            sety.SetMode(LineDataSet.Mode.CubicBezier);
            // hides the x and y values for each point
            sety.SetDrawValues(false);
            LineData data = new LineData(sety);

            lineChart.Data = (data);
            lineChart.SetVisibleXRangeMaximum(65f);
            // Sets the background color
            lineChart.SetBackgroundColor(Color.FloralWhite);
            // Grid lines are made invisible
            lineChart.SetDrawGridBackground(false);
        }
Ejemplo n.º 19
0
        public override void OnEndOfAlgorithm()
        {
            // Liquidate();

            //string file = "C:\\Users\\Виктор\\Documents\\trades_audusd.csv";


            //string delimiter = "  ";

            //if (!File.Exists(file))
            //{
            //    string header = "EntryTime" + delimiter + "EntryPrice" + delimiter + "ExitTime" + delimiter + "ExitPrice" + delimiter + "ProfitLoss" + Environment.NewLine;

            //    File.WriteAllText(file, header);
            //}



            double[] pnl = new double[TradeBuilder.ClosedTrades.Count];
            for (int i = 0; i < TradeBuilder.ClosedTrades.Count; i++)
            {
                pnl[i] = (double)TradeBuilder.ClosedTrades[i].ProfitLoss;
            }

            LineChart plot = new LineChart();

            plot.AddSeries(pnl, cumsum: true, label: _symbol);

            Application.Run(plot);


            //foreach (var trade in TradeBuilder.ClosedTrades)
            //{
            //string line = trade.EntryTime + delimiter + trade.EntryPrice + delimiter + trade.ExitTime + delimiter + trade.ExitPrice + delimiter + trade.ProfitLoss + Environment.NewLine;
            //File.AppendAllText(file, line);
            //    Log($"Symbol: {trade.Symbol} Quantity: {trade.Quantity} EntryTime: {trade.EntryTime} EntryPrice: {trade.EntryPrice} ExitTime: {trade.ExitTime} ExitPrice: {trade.ExitPrice} ProfitLoss: {trade.ProfitLoss}");
            //}
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Creates the execution time charts given the data table. The table
        /// must contain the following fields: collection_time, best_time,
        /// average_time and worst_time.
        /// </summary>
        /// <param name="table"></param>
        private void create_execution_time_charts(DataTable table)
        {
            // Create the <best_time> execution time chart.
            LineChart best_time = new LineChart();

            best_time.Legend          = "Best Time";
            best_time.DataSource      = table.DefaultView;
            best_time.DataXValueField = "collection_time";
            best_time.DataYValueField = "best_time";
            best_time.Line.Color      = Color.Green;
            best_time.Fill.Color      = Color.Green;
            best_time.DataBind();
            this.timeline_.Charts.Add(best_time);

            // Create the <average_time> execution time chart.
            LineChart average_time = new LineChart();

            average_time.Legend          = "Average Time";
            average_time.DataSource      = table.DefaultView;
            average_time.DataXValueField = "collection_time";
            average_time.DataYValueField = "average_time";
            average_time.Line.Color      = Color.Blue;
            average_time.Fill.Color      = Color.Blue;
            average_time.DataBind();
            this.timeline_.Charts.Add(average_time);

            // Create the <worst_time> execution time chart.
            LineChart worst_time = new LineChart();

            worst_time.Legend          = "Worst Time";
            worst_time.DataSource      = table.DefaultView;
            worst_time.DataXValueField = "collection_time";
            worst_time.DataYValueField = "worst_time";
            worst_time.Line.Color      = Color.Red;
            worst_time.Fill.Color      = Color.Red;
            worst_time.DataBind();
            this.timeline_.Charts.Add(worst_time);
        }
        private void InitLineChart()
        {
            lineAx = lineAx ??
                     new LineChart()
            {
                Entries               = entriesAx,
                LabelOrientation      = Orientation.Vertical,
                ValueLabelOrientation = Orientation.Horizontal,
                MinValue              = 0,
                MaxValue              = MaxVoltage,
                IsAnimated            = false,
                LabelColor            = SKColor.Parse("#000000")
            };

            lineAy = lineAy ??
                     new LineChart()
            {
                Entries               = entriesAy,
                LabelOrientation      = Orientation.Vertical,
                ValueLabelOrientation = Orientation.Horizontal,
                MinValue              = 0,
                MaxValue              = MaxVoltage,
                IsAnimated            = false,
                LabelColor            = SKColor.Parse("#000000")
            };

            lineAz = lineAz ??
                     new LineChart()
            {
                Entries               = entriesAz,
                LabelOrientation      = Orientation.Vertical,
                ValueLabelOrientation = Orientation.Horizontal,
                MinValue              = 0,
                MaxValue              = MaxVoltage,
                IsAnimated            = false,
                LabelColor            = SKColor.Parse("#000000")
            };
        }
Ejemplo n.º 22
0
 public object Convert(object val, Type targetType, object param, string lang)
 {
     if (val != null)
     {
         var vals = (val as List <double>);
         color = (vals[vals.Count - 1] > vals[0]) ?
                 SKColor.Parse(ColorConstants.GetColorBrush("pastel_green").Color.ToString()) :
                 SKColor.Parse(ColorConstants.GetColorBrush("pastel_red").Color.ToString());
         var   entries = vals.ConvertAll(PointConverter);
         Chart chart   = new LineChart()
         {
             Entries         = entries,
             IsAnimated      = false,
             LineAreaAlpha   = 0,
             PointAreaAlpha  = 0,
             BackgroundColor = SKColors.Transparent,
             LabelColor      = SKColors.Green,
             LineMode        = LineMode.Straight,
             LineSize        = 1,
             PointSize       = 1,
             MinValue        = entries.Min(x => x.Value),
             MaxValue        = entries.Max(x => x.Value),
         };
         return(chart);
     }
     else
     {
         return new LineChart()
                {
                    Entries = new List <ChartEntry>()
                    {
                        new ChartEntry(0)
                    },
                    BackgroundColor = SKColors.Transparent,
                    IsAnimated      = false
                }
     };
 }
Ejemplo n.º 23
0
        void Awake()
        {
            chart = gameObject.GetComponent <LineChart>();
            if (chart == null)
            {
                return;
            }

            chart.onCustomDraw = delegate(VertexHelper vh)
            {
            };
            // or
            chart.onCustomDrawBeforeSerie = delegate(VertexHelper vh, Serie serie)
            {
            };
            // or
            chart.onCustomDrawAfterSerie = delegate(VertexHelper vh, Serie serie)
            {
                if (serie.index != 0)
                {
                    return;
                }
                var dataPoints = serie.dataPoints;
                if (dataPoints.Count > 0)
                {
                    var pos      = dataPoints[3];
                    var zeroPos  = new Vector3(chart.grid.runtimeX, chart.grid.runtimeY);
                    var startPos = new Vector3(pos.x, zeroPos.y);
                    var endPos   = new Vector3(pos.x, zeroPos.y + chart.grid.runtimeHeight);
                    UGL.DrawLine(vh, startPos, endPos, chart.theme.serie.lineWidth, Color.blue);
                    UGL.DrawCricle(vh, pos, 5, Color.blue);
                }
            };
            // or
            chart.onCustomDrawTop = delegate(VertexHelper vh)
            {
            };
        }
Ejemplo n.º 24
0
        public ConverterPage(Presenter presenter)
        {
            InitializeComponent();

            _presenter = presenter;

            foreach (var bank in BanksRatesStore.BankExchangeRates)
            {
                BankPicker.Items.Add(bank.Name);
            }
            BankPicker.SelectedIndex = 0;
            CurrentRateLabel.Text    = BanksRatesStore.BankExchangeRates[0].Currencies[0].Usd.BuyRate.ToString("0.00");

            var chart = new LineChart
            {
                Entries               = _presenter.MakeChartEntries(BankIdConsts.PruvatBank, "USD", "buy"),
                LabelOrientation      = Orientation.Horizontal,
                LabelTextSize         = 45,
                LabelColor            = SKColors.Black,
                LineSize              = 8,
                PointSize             = 18,
                ValueLabelOrientation = Orientation.Horizontal,
                MinValue              = 25,
                BackgroundColor       = SKColors.Transparent,
                LineAreaAlpha         = 10
            };

            ChartView.Chart = chart;

            _selectedBankId   = BanksRatesStore.BankExchangeRates[0].OldId.ToString();
            _selectedCurrency = CurrencyPicker.Items[CurrencyPicker.SelectedIndex];
            _selectedAction   = ActionPicker.SelectedIndex == 0 ? "buy" : "sell";

            ActionPicker.SelectedIndexChanged   += ActionPicker_SelectedIndexChanged;
            CurrencyPicker.SelectedIndexChanged += CurrencyPicker_SelectedIndexChanged;
            BankPicker.SelectedIndexChanged     += BankPicker_SelectedIndexChanged;
            ResultButton.Clicked += ResultButton_Clicked;
        }
Ejemplo n.º 25
0
        public void CalculateHypergeometric()
        {
            if (SamplesCount > this.PopulationSize || this.SuccessesCount > this.PopulationSize)
            {
                return;
            }
            Hypergeometric dist = new Hypergeometric(this.PopulationSize, this.SuccessesCount, this.SamplesCount);

            LineChart cdfchart = new LineChart()
            {
                Entries = Enumerable.Range(0, this.SamplesCount + 1).Select(i =>
                                                                            new Microcharts.Entry(1 - (float)dist.CumulativeDistribution(i - 1))
                {
                    Label      = i.ToString(),
                    ValueLabel = (100 - dist.CumulativeDistribution(i - 1) * 100).ToString("0.00") + "%"
                }),
                MinValue = 0,
                MaxValue = 1,
                LineMode = LineMode.Straight
            };

            this.HyperGeometricCdfChart.Chart = cdfchart;

            LineChart pdfchart = new LineChart()
            {
                Entries = Enumerable.Range(0, this.SamplesCount + 1).Select(i =>
                                                                            new Microcharts.Entry((float)dist.Probability(i))
                {
                    Label      = i.ToString(),
                    ValueLabel = (dist.Probability(i) * 100).ToString("0.00") + "%"
                }),
                MinValue = 0,
                MaxValue = 1,
                LineMode = LineMode.Straight
            };

            this.HyperGeometricPdfChart.Chart = pdfchart;
        }
Ejemplo n.º 26
0
    void Awake()
    {
        chart = gameObject.GetComponent <LineChart>();
        if (chart != null)
        {
            GameObject.DestroyImmediate(chart);
        }
        chart            = gameObject.AddComponent <LineChart>();
        chart.title.show = true;
        chart.title.text = "Sin Curve";

        chart.tooltip.show = true;
        chart.legend.show  = false;

        chart.xAxises[0].show = true;
        chart.xAxises[1].show = false;
        chart.yAxises[0].show = true;
        chart.yAxises[1].show = false;

        chart.xAxises[0].type = Axis.AxisType.Value;
        chart.yAxises[0].type = Axis.AxisType.Value;

        chart.xAxises[0].boundaryGap = false;
        chart.maxCacheDataNumber     = 0;

        chart.RemoveData();

        var serie = chart.AddSerie("test", SerieType.Line);

        serie.symbol.type = SerieSymbolType.None;
        serie.lineType    = LineType.Normal;
        for (angle = 0; angle < 1080; angle++)
        {
            float xvalue = Mathf.PI / 180 * angle;
            float yvalue = Mathf.Sin(xvalue);
            chart.AddData(0, xvalue, yvalue);
        }
    }
Ejemplo n.º 27
0
        public static string multiDatasetPerLine()
        {
            int[] line1x = new int[] { 0, 15, 30, 45, 60 };
            int[] line1y = new int[] { 10, 50, 15, 60, 12 };
            int[] line2x = new int[] { 0, 15, 30, 45, 60 };
            int[] line2y = new int[] { 45, 12, 60, 34, 60 };

            List <int[]> dataset = new List <int[]>();

            dataset.Add(line1x);
            dataset.Add(line1y);
            dataset.Add(line2x);
            dataset.Add(line2y);

            LineChart lineChart = new LineChart(250, 150, LineChartType.MultiDataSet);

            lineChart.SetTitle("Multi Dataset Per Line", "0000FF", 14);
            lineChart.SetData(dataset);
            lineChart.AddAxis(new ChartAxis(ChartAxisType.Bottom));
            lineChart.AddAxis(new ChartAxis(ChartAxisType.Left));

            return(lineChart.GetUrl());
        }
Ejemplo n.º 28
0
        public static LineChartSeries CreateLineChartSeries(this LineChart lineChart, string text, UInt32Value index, string outLineColor, string markerColor, MarkerStyleValues symbol, d::PresetLineDashValues dashed = d::PresetLineDashValues.Solid, byte size = 7, d::Outline markerOutLine = null)
        {
            var series     = lineChart.CreateLineChartSeries(text, index);
            var properties = series.InsertAfter(new ChartShapeProperties(new d::Outline(new d::SolidFill(new d::RgbColorModelHex()
            {
                Val = new HexBinaryValue(outLineColor)
            }), new d::PresetDash()
            {
                Val = dashed
            })), series.SeriesText);

            series.InsertAfter(new Marker(new Symbol()
            {
                Val = symbol
            }, new Size()
            {
                Val = size
            }, new ChartShapeProperties(new d::SolidFill(new d::RgbColorModelHex()
            {
                Val = new HexBinaryValue(markerColor)
            }), markerOutLine)), properties);
            return(series);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Test case 7
        /// </summary>
        private static TestCaseData BasicLineCharWithXStartOnMinor()
        {
            var testData = GetTestDataSet2();

            var chart = new LineChart(testData.series, testData.labels)
            {
                Height       = 500,
                Width        = 800,
                DrawDebug    = false,
                PaddingRight = 15,
                XAxis        =
                {
                    StartOnMajor = true,
                },
            };

            var testCase = new TestCaseData(chart);

            testCase.SetName("TestCase 7 - Test xAxis start on major.");
            testCase.SetDescription("Test case 7 : Basic line chart with XAxis Starting on the major tick, as apposed to the default minor tick");
            testCase.ExpectedResult = GetExpectedResults("TestCase-7.xml");
            return(testCase);
        }
Ejemplo n.º 30
0
        public static List <LineChart> BuildLineCharts(List <Currency> currencies, List <Indicator> indicators, List <DataPoint> lines)
        {
            var lineCharts = new List <LineChart>();

            foreach (var currency in currencies)
            {
                foreach (var indicator in indicators)
                {
                    var filteredLines = lines.Where(x =>
                                                    x.IndicatorType == indicator.IndicatorType &&
                                                    x.IndicatorId == indicator.IndicatorId &&
                                                    x.TargetId == currency.CurrencyId).ToList();

                    var lineChartColumns = BuildLineChartColumns();
                    var lineChartRows    = BuildLineChartRows(filteredLines);
                    var lineChart        = new LineChart(currency.CurrencyId, currency.Name, indicator.IndicatorId, indicator.Name, lineChartColumns, lineChartRows);
                    lineCharts.Add(lineChart);
                }
            }

            // Return
            return(lineCharts);
        }
Ejemplo n.º 31
0
        public static string linearGradientFillTest()
        {
            int[]     line1     = new int[] { 5, 10, 50, 34, 10, 25 };
            LineChart lineChart = new LineChart(250, 150);

            lineChart.SetTitle("Linear Gradient fill test");
            lineChart.SetData(line1);

            lineChart.AddAxis(new ChartAxis(ChartAxisType.Left));
            lineChart.AddAxis(new ChartAxis(ChartAxisType.Bottom));

            LinearGradientFill fill = new LinearGradientFill(ChartFillTarget.ChartArea, 45);

            fill.AddColorOffsetPair("FFFFFF", 0);
            fill.AddColorOffsetPair("76A4FB", 0.75);

            SolidFill bgFill = new SolidFill(ChartFillTarget.Background, "EFEFEF");

            lineChart.AddLinearGradientFill(fill);
            lineChart.AddSolidFill(bgFill);

            return(lineChart.GetUrl());
        }
Ejemplo n.º 32
0
        public ExerciseViewModel(ExerciseModel content = null, string pageType = "Chest")
        {
            Title = content.Name;
            // order it to be up to date using comprator then update
            ExerciseModel pageContent = content;

            pageContent.Data.Sort(SortByDate);

            ObservableCollection <LogModel> loglist = new ObservableCollection <LogModel>();

            foreach (LogModel i in pageContent.Data)
            {
                loglist.Add(i);
            }

            LogList = loglist;

            List <Entry> entries = LoadGraph();

            Chart = new LineChart()
            {
                Entries               = entries,
                MinValue              = 0,
                LineSize              = 6,
                LabelOrientation      = Orientation.Horizontal,
                ValueLabelOrientation = Orientation.Horizontal,
                LineMode              = LineMode.Straight,
                PointMode             = PointMode.Square,
                //LineMode = LineMode.Spline,
                LabelTextSize = 36,
            };

            _popup   = PopupNavigation.Instance;
            _logPage = new LogPopup(pageType, content.Name);
            this.BackButtonCommand = new Command(this.BackButtonClicked);
            this.AddLogCommand     = new Command(this.AddLogClicked);
        }
Ejemplo n.º 33
0
        public HomePageViewModel(IWeatherApiManager weatherApiManager, INavigationService navigationService, IUserDialogs userDialogs) : base(userDialogs)
        {
            _weatherApiManager         = weatherApiManager;
            _navigationService         = navigationService;
            GetCurrentWeatherCommand   = new DelegateCommand(async() => await FetchCurrentWeather());
            GetForecastCommand         = new DelegateCommand(async() => await FetchForecast());
            SelectedDateChangedCommand = new DelegateCommand(async() => await SelectedDateChanged());
            Dates = new ObservableCollection <WeatherDate>();

            var initialDate = DateTime.Now;

            SelectedDate = new WeatherDate
            {
                Date = initialDate
            };
            Dates.Add(SelectedDate);
            for (int i = 1; i < 6; i++)
            {
                Dates.Add(new WeatherDate
                {
                    Date = initialDate.AddDays(i),
                });
            }

            Chart = new LineChart
            {
                BackgroundColor       = SKColors.Transparent,
                PointMode             = PointMode.Circle,
                LineMode              = LineMode.Spline,
                PointSize             = 50,
                AnimationDuration     = TimeSpan.FromSeconds(2.3),
                LabelOrientation      = Orientation.Horizontal,
                ValueLabelOrientation = Orientation.Horizontal,
                LabelColor            = SKColors.White,
                LabelTextSize         = 40,
            };
        }
Ejemplo n.º 34
0
        //Agregar IP
        private void AddChartIP(object sender, EventArgs e)
        {
            Control control = ((Control)sender);
            Control parent  = control.Parent;
            int     zIndex  = parent.Controls.GetChildIndex(control);

            using (MsgBox_AddChart newChart = new MsgBox_AddChart())
            {
                newChart.bt_Confirm.Click += new EventHandler(delegate(object o, EventArgs a)
                {
                    if (newChart.txt_name.Text != string.Empty && newChart.txt_ip.Text != string.Empty)
                    {
                        LineChart IpButton = new LineChart()
                        {
                            interval = waitTime,
                            Enabled  = true,
                            tag      = this.Titulo.Text
                        };

                        IpButton.nombre.Text = newChart.txt_name.Text;
                        IpButton.txt_ip.Text = newChart.txt_ip.Text;

                        parent.Controls.Add(IpButton);

                        newChart.Close();
                    }
                    else
                    {
                        return;
                    }
                });

                newChart.ShowDialog();
            }

            parent.Controls.SetChildIndex(control, zIndex + 1);
        }
Ejemplo n.º 35
0
        private void Window1_Loaded(object sender, RoutedEventArgs e)
        {
            //plotter.Viewport.Visible = new DataRect(-1, -1.1, 200, 2.2);

            const int count = 14000;

            Point[] pts = new Point[count];

            for (int i = 0; i < count; i++)
            {
                double x = i / 20.0 - 1000;
                pts[i] = new Point(x, Math.Sin(x));
            }

#if !old
            var ds = pts.AsDataSource();

            LineChart chart = new LineChart {
                DataSource = ds
            };
            //chart.Filters.Clear();

            //InclinationFilter filter = new InclinationFilter();
            //BindingOperations.SetBinding(filter, InclinationFilter.CriticalAngleProperty, new Binding { Path = new PropertyPath("Value"), Source = slider });
            //chart.Filters.Add(filter);
            plotter.Children.Add(chart);

            //plotter.Children.Add(new LineChart { DataSource = new FunctionalDataSource { Function = x => Math.Atan(x) } });
            //plotter.Children.Add(new LineChart { DataSource = new FunctionalDataSource { Function = x => Math.Tan(x) } });
#else
            var ds2 = new Microsoft.Research.DynamicDataDisplay.DataSources.RawDataSource(pts);
            lineGraph = plotter.AddLineGraph(ds2);
#endif

            ((NumericAxis)plotter.MainHorizontalAxis).TicksProvider = new CustomBaseNumericTicksProvider(Math.PI);
            ((NumericAxis)plotter.MainHorizontalAxis).LabelProvider = new CustomBaseNumericLabelProvider(Math.PI, "π");
        }
Ejemplo n.º 36
0
        private void SetupWeeksProgress()
        {
            LineChart lineChart = null;

            try
            {
                if (_weeksProgress != null)
                {
                    var fromDate = DateTime.Now.AddDays(-7);
                    var toDate   = DateTime.Now;
                    lineChart = new LineChart(this);
                    var progressHelper = new ProgressChartHelper(this, _weeksProgress, lineChart);
                    _weeksProgress = progressHelper.SetupLineChart();
                    lineChart      = progressHelper.SetupChartData(fromDate, toDate);
                }

                if (_weeksProgressLabel != null)
                {
                    if (lineChart != null && lineChart.LineData.YMax < 0.002)
                    {
                        _weeksProgressLabel.Text = GetString(Resource.String.SummaryNoThoughtData);
                    }
                    else
                    {
                        _weeksProgressLabel.Text = GetString(Resource.String.MainActivityMyProgressLabel);
                    }
                }
            }
            catch (Exception e)
            {
                Log.Error(TAG, "SetupWeeksProgress: Exception - " + e.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, e, GetString(Resource.String.ErrorMainActivityWeeksProgress), "SummaryActivity.SetupWeeksProgress");
                }
            }
        }
Ejemplo n.º 37
0
        private void GetChartTypeAndDataRange(ref ChartType type, ref Tuple <int, int> dataRange, OpenXmlElement chart)
        {
            BarChart     barchart     = chart as BarChart;
            ScatterChart scatterChart = chart as ScatterChart;
            LineChart    lineChart    = chart as LineChart;
            PieChart     pieChart     = chart as PieChart;

            type = ChartType.None;
            if (barchart != null)
            {
                type = ChartType.Bar;
                if (element.IsFixed)
                {
                    dataRange = GetFixedDataRange <BarChartSeries>(barchart);
                    element.Data.TrimOrExpand(dataRange.Item1, dataRange.Item2);
                }
                if (element.IsWaterfall)
                {
                    type = ChartType.Waterfall;
                }
            }
            else if (scatterChart != null)
            {
                {
                    type = ChartType.Scatter;
                }
            }
            else if (lineChart != null)
            {
                type = ChartType.Line;
                if (element.IsFixed)
                {
                    dataRange = GetFixedDataRange <LineChartSeries>(barchart);
                    element.Data.TrimOrExpand(dataRange.Item1, dataRange.Item2);
                }
            }
        }
Ejemplo n.º 38
0
        public async void GetF101()
        {
            GetF101_actives_List = await myAPI.GetF101_actives("2018-05-01");

            var entries = new List <Microcharts.Entry>();

            GetF101_actives_List = GetF101_actives_List.OrderBy(order => order.Label).ToList();

            float   prev_val = 0;
            SKColor cl       = SKColor.Empty;

            foreach (var p in GetF101_actives_List)
            {
                if (p.Val >= prev_val)
                {
                    cl = SKColor.Parse("#A8E10C");
                }
                else
                {
                    cl = SKColor.Parse("#FF5765");
                }
                var entry = new Entry(p.Val)
                {
                    Label = (DateTime.Parse(p.Label).AddMonths(-11)).ToString("MMM-yyyy"),
                    //ValueLabel = p.Val.ToString(),
                    Color = cl
                };
                entries.Add(entry);
            }

            var chart = new LineChart()
            {
                Entries = entries
            };

            this.chartView.Chart = chart;
        }
Ejemplo n.º 39
0
    void Start()
    {
        chart = lChart.GetComponent <LineChart>();
        chart.AddSerie(SerieType.Line, "感染人数"); //添加一条折线
        chart.AddSerie(SerieType.Line, "发病人数"); //添加一条折线
        chart.AddSerie(SerieType.Line, "死亡人数"); //添加一条折线

        chart.series.GetSerie("感染人数").lineStyle.color = Color.yellow;
        chart.series.GetSerie("发病人数").lineStyle.color = Color.red;
        chart.series.GetSerie("死亡人数").lineStyle.color = Color.black;

        chart_copy = lChart_copy.GetComponent <LineChart>();
        chart_copy.AddSerie(SerieType.Line, "感染人数"); //添加一条折线
        chart_copy.AddSerie(SerieType.Line, "发病人数"); //添加一条折线
        chart_copy.AddSerie(SerieType.Line, "死亡人数"); //添加一条折线

        chart_copy.series.GetSerie("感染人数").lineStyle.color = Color.yellow;
        chart_copy.series.GetSerie("发病人数").lineStyle.color = Color.red;
        chart_copy.series.GetSerie("死亡人数").lineStyle.color = Color.black;

        //获取最大人数,作为y轴最大值
        mysqlManager = new MysqlManager();
        MySqlDataReader reader = mysqlManager.SelectFrom("select count(*) from People");

        while (reader.Read())
        {
            count = reader.GetInt32(0);
        }
        reader.Close();
        mysqlManager.Close();

        chart.yAxis0.min = 0;
        chart.yAxis0.max = count;

        chart_copy.yAxis0.min = 0;
        chart_copy.yAxis0.max = count;
    }
Ejemplo n.º 40
0
        public static string axesRangeTest()
        {
            int[] line1 = new int[] { 5, 10, 50, 34, 10, 25 };
            int[] line2 = new int[] { 15, 20, 60, 44, 20, 35 };

            List <int[]> dataset = new List <int[]>();

            dataset.Add(line1);
            dataset.Add(line2);

            LineChart lineChart = new LineChart(250, 150);

            lineChart.SetTitle("Axes Range Test", "0000FF", 14);
            lineChart.SetData(dataset);

            ChartAxis topAxis = new ChartAxis(ChartAxisType.Top);

            topAxis.SetRange(0, 10);
            lineChart.AddAxis(topAxis);

            ChartAxis rightAxis = new ChartAxis(ChartAxisType.Right);

            rightAxis.SetRange(0, 10);
            lineChart.AddAxis(rightAxis);

            ChartAxis bottomAxis = new ChartAxis(ChartAxisType.Bottom);

            bottomAxis.SetRange(0, 10);
            lineChart.AddAxis(bottomAxis);

            ChartAxis leftAxis = new ChartAxis(ChartAxisType.Left);

            leftAxis.SetRange(0, 10);
            lineChart.AddAxis(leftAxis);

            return(lineChart.GetUrl());
        }
Ejemplo n.º 41
0
        public static string axesStyleTest()
        {
            int[] line1 = new int[] { 5, 10, 50, 34, 10, 25 };
            int[] line2 = new int[] { 15, 20, 60, 44, 20, 35 };

            List <int[]> dataset = new List <int[]>();

            dataset.Add(line1);
            dataset.Add(line2);

            LineChart lineChart = new LineChart(250, 150);

            lineChart.SetTitle("Axes Style Test", "0000FF", 14);
            lineChart.SetData(dataset);

            ChartAxis topAxis = new ChartAxis(ChartAxisType.Top);

            topAxis.SetRange(0, 10);
            topAxis.AddLabel(new ChartAxisLabel("test", 2));
            topAxis.AddLabel(new ChartAxisLabel("test", 6));
            topAxis.FontSize  = 12;
            topAxis.Color     = "FF0000";
            topAxis.Alignment = AxisAlignmentType.Left;
            lineChart.AddAxis(topAxis);

            ChartAxis bottomAxis = new ChartAxis(ChartAxisType.Bottom);

            bottomAxis.AddLabel(new ChartAxisLabel("test", 2));
            bottomAxis.AddLabel(new ChartAxisLabel("test", 6));
            bottomAxis.SetRange(0, 10);
            bottomAxis.FontSize  = 14;
            bottomAxis.Color     = "00FF00";
            bottomAxis.Alignment = AxisAlignmentType.Right;
            lineChart.AddAxis(bottomAxis);

            return(lineChart.GetUrl());
        }
Ejemplo n.º 42
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            var nazione = await App.Database.GetNazioneUltimaAsync();

            Ricoverati_con_sintomi.Text     = nazione.First().ricoverati_con_sintomi.ToString();
            Terapia_intensiva.Text          = nazione.First().terapia_intensiva.ToString();
            Totale_ospedalizati.Text        = nazione.First().totale_ospedalizzati.ToString();
            Isolamento_domiciliare.Text     = nazione.First().isolamento_domiciliale.ToString();
            Totale_positivi.Text            = nazione.First().totale_positivi.ToString();
            Variazione_totale_positivi.Text = nazione.First().variazione_totale_positivi.ToString();
            Nuovi_positivi.Text             = nazione.First().nuovi_positivi.ToString();
            Dimessi_guariti.Text            = nazione.First().dimessi_guariti.ToString();
            Deceduti.Text     = nazione.First().deceduti.ToString();
            Totale_casi.Text  = nazione.First().totale_casi.ToString();
            Tamponi.Text      = nazione.First().tamponi.ToString();
            Casi_testati.Text = nazione.First().casi_testati.ToString();
            var chart = new LineChart()
            {
                Entries = await Getentries.GetentrieNaz()
            };

            chartView.Chart = chart;
        }
        private void ShowChart()
        {
            GUILayout.BeginHorizontal(GUILayout.Width(200), GUILayout.Height(20), GUILayout.MinWidth(100), GUILayout.MaxWidth(300));
            if (GUILayout.Button("back", GUILayout.Width(80), GUILayout.Height(20), GUILayout.MinWidth(40), GUILayout.MaxWidth(160)))
            {
                routeToShow = null;
                return;
            }
            if (GUILayout.Button("clear", GUILayout.Width(80), GUILayout.Height(20), GUILayout.MinWidth(40), GUILayout.MaxWidth(160)))
            {
                while (routeToShow.averageSizeChart.Count > 0)
                {
                    routeToShow.dataChart.RemoveAt(0);
                    routeToShow.averageSizeChart.RemoveAt(0);
                    routeToShow.messageNbrChart.RemoveAt(0);
                }
            }
            if (GUILayout.Button("Export", GUILayout.Width(80), GUILayout.Height(20), GUILayout.MinWidth(40), GUILayout.MaxWidth(160)))
            {
                int i = 0;
                while (System.IO.File.Exists("Export" + i.ToString() + ".csv"))
                    i++;
                var file = System.IO.File.CreateText("Export" + i.ToString() + ".csv");
                i = 0;
                while (i < routeToShow.averageSizeChart.Count)
                {
                    file.WriteLine(string.Join(";", new string[] { routeToShow.dataChart[i].ToString(), routeToShow.averageSizeChart[i].ToString(), routeToShow.messageNbrChart[i].ToString() }));
                    i++;
                }
            }
            GUILayout.EndHorizontal();

            ChartSlider = GUILayout.HorizontalSlider(ChartSlider, 0, routeToShow.dataChart.Count - 1);
            if (ChartSlider >= routeToShow.dataChart.Count - 2)
                ChartSlider = routeToShow.dataChart.Count - 1;

            if (routeToShow.dataChart.Count > 0)
            {
                int count = 60;
                int pos = (int)ChartSlider;
                calcRange(routeToShow.dataChart.Count - 1, ref pos, ref count);

                if (chart == null)
                    chart = new LineChart(window, window.position.height - window.position.height / 10);

                chart.data = new List<float>[3];
                chart.data[0] = routeToShow.dataChart.GetRange(pos, count);
                chart.data[1] = routeToShow.averageSizeChart.GetRange(pos, count);
                chart.data[2] = routeToShow.messageNbrChart.GetRange(pos, count);

                chart.dataLabels = new List<string> { "bytes per seconds", "average packet size", "number of messages" };
                chart.axisLabels = new List<string> { "0" };
                chart.DrawChart();
            }
        }
Ejemplo n.º 44
0
 public static Chart CreateChart(ChartType type, ChartModel model)
 {
   Chart chart = null;
   if (type == ChartType.VBAR || 
       type == ChartType.VBAR_STACKED || 
       type == ChartType.BAR_LINE_COMBO ||
       type == ChartType.BAR_AREA_COMBO ||
       type == ChartType.BAR_LINE_AREA_COMBO)
   {
     chart = new BarChart(type, model);
   }
   else if (type == ChartType.HBAR || type == ChartType.HBAR_STACKED)
   {
     chart = new HorizontalBarChart(type, model);
   }
   else if( type == ChartType.CYLINDERBAR)
   {
     chart = new CylinderBarChart(type, model);
   }
   
   else if (type == ChartType.PIE)
   {
     chart = new PieChart(type, model);
   }
   else if (type == ChartType.AREA || type == ChartType.AREA_STACKED)
   {
     chart = new AreaChart(type, model);
   }
   else if (type == ChartType.LINE)
   {
     chart = new LineChart(type, model);
   }
   else if (type == ChartType.SCATTER_PLOT)
   {
     chart = new ScatterPlotChart(type, model);
   }
   else if (type == ChartType.XYLINE)
   {
     chart = new XYLineChart(type, model);
   }
   else if (type == ChartType.RADAR || type == ChartType.RADAR_AREA)
   {
     chart = new RadarChart(type, model);
   }
   else if (type == ChartType.FUNNEL)
   {
     chart = new FunnelChart(type, model);
   }
   else if (type == ChartType.SEMI_CIRCULAR_GAUGE)
   {
     chart = new SemiCircularGaugeChart(type, model);
   }
   else if (type == ChartType.CIRCULAR_GAUGE)
   {
     chart = new GaugeChart(type, model);
   }
   else if (type == ChartType.CANDLE_STICK)
   {
     chart = new CandleStickChart(type, model);
   }
   return chart;
 }
        private LineChart GenerateLineChart(GraphWithDescriptionModel data)
        {
            // check if  enough data for line chart (with one point the chart is broken)
            if (data.GraphData.Count < 2)
            {
                return null;
            }
            var lineChart = new LineChart
            {
                ComplexData =
                {
                    Labels = data.GraphData.Select(graphData => graphData.Label).ToList(),
                    Datasets = this.GenerateDataSets(data)
                }
            };
            // graph settings for dynamic charts
            lineChart.ChartConfiguration.ScaleBeginAtZero = false;
            lineChart.ChartConfiguration.Responsive = true;
            lineChart.ChartConfiguration.BezierCurve = false;
            lineChart.ChartConfiguration.PointHitDetectionRadius = 1;

            return lineChart;
        }
Ejemplo n.º 46
0
        public void LoadGraph()
        {
            ChartEngine tempChartEngine = new ChartEngine();
            tempChartEngine.Size = GraphPictureBox.Size;
            tempChartEngine.ShowXValues = true;
            tempChartEngine.ShowYValues = true;
              //  tempChartEngine.Padding = 40;
            tempChartEngine.BottomChartPadding = 30;
            tempChartEngine.LeftChartPadding = 40;

            ChartText tempChartText = new ChartText();
            tempChartText.Text = "Hourly Sales";
            tempChartEngine.Title = tempChartText;

            CPaymentManager tempPaymentManager = new CPaymentManager();
            CResult oResult = tempPaymentManager.GetSortedPayment(DateTime.Now);
            double MaxAmount = 0.0;
            if (oResult.IsSuccess && oResult.Data != null)
            {
                MaxAmount = (double)oResult.Data;
            }

               // tempChartEngine.YValuesInterval = (int)Math.Floor(MaxAmount / 20);
            tempChartEngine.YValuesInterval = GetInterVal(MaxAmount);
            tempChartEngine.YCustomEnd = GetCustomEnd(GetInterVal(MaxAmount), MaxAmount);

            ChartCollection tempChartCollection = new ChartCollection(tempChartEngine);
            tempChartEngine.Charts = tempChartCollection;
            DateTime inCurrentDate = DateTime.Now;
            GetTimeSpan(inCurrentDate);

            //Data Access

            try
            {
                CPcInfoManager tempPcInfoManager = new CPcInfoManager();
                IPHostEntry ipEntry = System.Net.Dns.GetHostByName(Dns.GetHostName());
                CPcInfo tempPcInfo = (CPcInfo)tempPcInfoManager.PcInfoByPcIP(ipEntry.AddressList[0].ToString()).Data;

                DataSet tempHourlySaleDataSet = new DataSet();
                CCommonConstants oConstants = ConfigManager.GetConfig<CCommonConstants>();
                String sSql = String.Format("select 'NewTime' as \"NewTime\",bill_print_time.payment_time as \"Time\",payment.total_amount as \"Amount\" from payment,bill_print_time where payment.order_id=bill_print_time.order_id and bill_print_time.payment_time>={0} and bill_print_time.payment_time<{1} and payment.pc_id={2}", m_oStartTime, m_oEndTime, tempPcInfo.PcID);
                SqlDataAdapter tempSqlDataAdapter = new SqlDataAdapter(sSql, oConstants.DBConnection);
                tempSqlDataAdapter.Fill(tempHourlySaleDataSet);

                sSql = String.Format("select 'NewTime' as \"NewTime\",deposit_time as \"Time\",total_amount as \"Amount\" from deposit where deposit_time >= {0} and deposit_time < {1} and deposit.pc_id={2}", m_oStartTime, m_oEndTime, tempPcInfo.PcID);
                tempSqlDataAdapter = new SqlDataAdapter(sSql, oConstants.DBConnection);
                tempSqlDataAdapter.Fill(tempHourlySaleDataSet);

                ConvertTime(ref tempHourlySaleDataSet);

                //start dummy time
                DataRow row1 = tempHourlySaleDataSet.Tables[0].NewRow();
                row1["NewTime"] = "0:00";
                row1["Amount"] = "0.000";

                //end dummy time
                DataRow row2 = tempHourlySaleDataSet.Tables[0].NewRow();
                row2["NewTime"] = "23:59";
                row2["Amount"] = "0.000";

                tempHourlySaleDataSet.Tables[0].Rows.Add(row1);
                tempHourlySaleDataSet.Tables[0].Rows.Add(row2);

                Chart tempLineChart = new LineChart();
                tempLineChart.Line.Color = Color.Red;
                tempLineChart.ShowLineMarkers = false;
                tempLineChart.Line.Width = (float)2.0;

                DataTableReader oReader = tempHourlySaleDataSet.Tables[0].CreateDataReader();

                tempLineChart.DataSource = oReader;

                tempLineChart.DataXValueField = "NewTime";
                tempLineChart.DataYValueField = "Amount";
                tempLineChart.DataBind();
                tempChartCollection.Add(tempLineChart);

                Image image = tempChartEngine.GetBitmap();
                GraphPictureBox.Image = image;
                GraphPictureBox.Update();
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
        private List<LineChart> RefreshListaMoedas()
        {
            MoedasDoJson.Clear();

            List<string> busca = Repositorio.OrigemRepositorio.GetOne();

            if (busca.Count == 0)
            {
                ParseJsonMoedas();
                List<string> listaMoedas = Repositorio.OrigemRepositorio.GetOne();
                this.lpkMoedas.ItemsSource = listaMoedas;

                // List<Cota> listaFav = Repositorio.CotaRepositorio.Get(id);

                string apelido = lpkMoedas.SelectedItem.ToString();
                List<Cota> lista = Repositorio.CotaRepositorio.ListaNome(apelido);
               // this.LstMoedas.ItemsSource = listaFav;

            }
            else
            {
                List<string> listaMoedas = Repositorio.OrigemRepositorio.GetOne();
                this.lpkMoedas.ItemsSource = listaMoedas;

                //List<Cota> listaFav = Repositorio.CotaRepositorio.Get(id);
                string apelido = lpkMoedas.SelectedItem.ToString();
                List<Cota> lista = Repositorio.CotaRepositorio.ListaNome(apelido);
             //   this.LstMoedas.ItemsSource = listaFav;

            //ORIGINAL
               // List<CompraEntidade> lista = Repositorio.CompraRepositorio.Get(id);
            // List<LineChart> CarrosDoJson = new List<LineChart>();

            foreach (var item in lista)
            {

                DateTime dt = Convert.ToDateTime(item.data_consulta);
                Console.WriteLine("Year: {0}, Month: {1}, Day: {2}", dt.Year, dt.Month, dt.Day);

                LineChart lineChart = new LineChart
                {
                    label = Convert.ToString(dt.Day) + "/" + Convert.ToString(dt.Month),
                    val1 = Convert.ToDouble(item.indice.ToString("0.000"))

                    //meuNumeroDouble.ToString("0.00");
                    //val1 = item.indice
                };
                MoedasDoJson.Add(lineChart);

                //  new LineChart() { label = item.Data, val1 = item.preco};

                // new LineChart() { label = "02/10", val1 = 3.953/10}
            }

            }

            #region Rascunho lista

            //teste
            //List<Classificacao> listag = Repositorio.ClassificRepositorio.Get(id);
            //lstCompras.ItemsSource = listag;

            #endregion

            return MoedasDoJson;
        }
        /*
         * Een nieuwe lijn aanmaken voor een LineChart.
         * @author: Richard
         */
        private LineChart newLine(DataTable dataSet, string lineName, Color lineColor, float lineWidth, int userId, int tripId)
        {
            LineChart chart = new LineChart();
            chart.Legend = lineName;
            chart.Fill.Color = Color.FromArgb(50, lineColor);
            chart.Line.Color = lineColor;
            chart.Line.Width = lineWidth;

            int count = 0;
            foreach (DataRow r in dataSet.Rows)
            {

                if (Convert.ToInt32(r.ItemArray.ElementAt((int)DatasetHelper.CarDataColumn.TripId).ToString()) == tripId)
                {
                    string number = count.ToString();
                    int point = Convert.ToInt32(r.ItemArray.ElementAt(6).ToString());
                    point = (point * 3600);
                    point = (point / 1000);
                    chart.Data.Add(new ChartPoint("", point));
                    count++;
                }
            }

            if (count == 0)
            {

                return null;
            }

            return chart;
        }
Ejemplo n.º 49
0
    public List<object> returnDataDates(string param1, string param2, string dateBeg, string dateEnd)
    {
        const string coffeeColor = "#72A435";
        const string dairyColor = "#878787";
        const string fruitColor = "#3186AD";
        const string grainColor = "#EAEFF9";
        const string vegColor = "#EE5921";
        const string paperColor = "#484848";

        const string coffeeColorT = "rbga(114, 164, 53,0.2)";
        const string dairyColorT = "rgba(135,135,135,0.2)";
        const string fruitColorT = "rgba(49,134,173,0.2)";
        const string grainColorT = "rgba(234,239,249,0.2)";
        const string vegColorT = "rgba(238,89,33,0.2)";
        const string paperColorT = "rgba(72,72,72,0.2)";

        List<object> result = new List<object>();

        //Group By Section Queries

        //Foodwaste
        if (param1 == "GetVendorDates")
        {
            var vendDates = ((from vends in db.Composts where vends.Vendor == param2 select vends.date.ToString()).ToList());
            foreach (var vend in vendDates)
            {
                result.Add(vend);
            }
        }

        if (param1 == "Foodwaste - By Vendor")
        {
            var vendReturn = (from vends in db.Composts where (vends.date.ToString() == dateBeg) && (vends.Vendor == param2) select vends).ToList();

            var firstVendor = vendReturn[0];
            // Add Coffee Grounds
            PieDonutGraph p = new PieDonutGraph();
            p.value = (double)firstVendor.percentCoffeeGrounds;
            p.color = coffeeColor;
            p.highlight = "#FFFF66";
            p.label = "Coffee Grounds";
            result.Add(p);
            //Add Dairy
            p = new PieDonutGraph();
            p.value = (double)firstVendor.percentDairy;
            p.color = dairyColor;
            p.highlight = "#FFFF66";
            p.label = "Dairy";
            result.Add(p);
            // Add Fruit 
            p = new PieDonutGraph();
            p.value = (double)firstVendor.percentFruit;
            p.color = fruitColor;
            p.highlight = "#FFFF66";
            p.label = "Fruit";
            result.Add(p);
            // Add Grains 
            p = new PieDonutGraph();
            p.value = (double)firstVendor.percentGrains;
            p.color = grainColor;
            p.highlight = "#FFFF66";
            p.label = "Grains";
            result.Add(p);
            // Add Veg 
            p = new PieDonutGraph();
            p.value = (double)firstVendor.percentVeg;
            p.color = vegColor;
            p.highlight = "#FFFF66";
            p.label = "Vegtables";
            result.Add(p);
            // Add Veg 
            p = new PieDonutGraph();
            p.value = (double)firstVendor.percentPaper;
            p.color = paperColor;
            p.highlight = "#FFFF66";
            p.label = "Paper";
            result.Add(p);
        }
        if (param1 == "Foodwaste - by Vendor Line/Bar")
        {
            var vendReturn = (from vends in db.Composts where (vends.date >= Convert.ToDateTime(dateBeg)) && (vends.date <= Convert.ToDateTime(dateEnd)) && (vends.Vendor == param2) select vends).ToList();
            string[] labelHold = new string[vendReturn.Count];
            int counter = 0;
            List<double> coffee = new List<double>();
            List<double> dairy = new List<double>();
            List<double> fruit = new List<double>();
            List<double> grains = new List<double>();
            List<double> paper = new List<double>();
            List<double> veg = new List<double>();

            foreach (var vend in vendReturn)
            {
                coffee.Add((double)vend.percentCoffeeGrounds);
                dairy.Add((double)vend.percentDairy);
                fruit.Add((double)vend.percentFruit);
                grains.Add((double)vend.percentGrains);
                paper.Add((double)vend.percentPaper);
                veg.Add((double)vend.percentVeg);
                labelHold[counter] = vend.date.ToShortDateString();
                counter++;
            }
            result.Add(labelHold);
            //Cofee Grounds
            LineChart dataIn = new LineChart();
            dataIn.label = "Percent Cofee Grounds";
            dataIn.fillColor = coffeeColorT;
            dataIn.strokeColor = coffeeColor;
            dataIn.pointColor = coffeeColor;
            dataIn.pointStrokeColor = "#fff";
            dataIn.pointHighlightFill = "#fff";
            dataIn.pointHighlightStroke = coffeeColor;
            dataIn.data = coffee.ToArray();
            result.Add(dataIn);
            //Dairy
            dataIn = new LineChart();
            dataIn.label = "Percent Dairy";
            dataIn.fillColor = dairyColorT;
            dataIn.strokeColor = dairyColor;
            dataIn.pointColor = dairyColor;
            dataIn.pointStrokeColor = "#fff";
            dataIn.pointHighlightFill = "#fff";
            dataIn.pointHighlightStroke = dairyColor;
            dataIn.data = dairy.ToArray();
            result.Add(dataIn);
            //Grains
            dataIn = new LineChart();
            dataIn.label = "Percent Grains";
            dataIn.fillColor = grainColorT;
            dataIn.strokeColor = grainColor;
            dataIn.pointColor = grainColor;
            dataIn.pointStrokeColor = "#fff";
            dataIn.pointHighlightFill = "#fff";
            dataIn.pointHighlightStroke = grainColor;
            dataIn.data = grains.ToArray();
            result.Add(dataIn);
            //Fruit
            dataIn = new LineChart();
            dataIn.label = "Percent Fruit";
            dataIn.fillColor = fruitColorT;
            dataIn.strokeColor = fruitColor;
            dataIn.pointColor = fruitColor;
            dataIn.pointStrokeColor = "#fff";
            dataIn.pointHighlightFill = "#fff";
            dataIn.pointHighlightStroke = fruitColor;
            dataIn.data = fruit.ToArray();
            result.Add(dataIn);
            //Veg
            dataIn = new LineChart();
            dataIn.label = "Percent Vegtables";
            dataIn.fillColor = vegColorT;
            dataIn.strokeColor = vegColor;
            dataIn.pointColor = vegColor;
            dataIn.pointStrokeColor = "#fff";
            dataIn.pointHighlightFill = "#fff";
            dataIn.pointHighlightStroke = vegColor;
            dataIn.data = veg.ToArray();
            result.Add(dataIn);
            //Paper
            dataIn = new LineChart();
            dataIn.label = "Percent Paper";
            dataIn.fillColor = paperColorT;
            dataIn.strokeColor = paperColor;
            dataIn.pointColor = paperColor;
            dataIn.pointStrokeColor = "#fff";
            dataIn.pointHighlightFill = "#fff";
            dataIn.pointHighlightStroke = paperColor;
            dataIn.data = paper.ToArray();
            result.Add(dataIn);


        }
    
        if (param1 == "Foodwaste - by Type of Waste Line/Bar" && param2 == "Coffee Grounds")
        {
            var vendGroups = (from vends in db.Composts group vends by vends.Vendor);
            List<string> dateLabelHold = new List<string>();

            for (DateTime date = Convert.ToDateTime(dateBeg); date.Date <= Convert.ToDateTime(dateEnd).Date; date = date.AddDays(1))
            {
                dateLabelHold.Add(date.ToShortDateString());
            }

            result.Add(dateLabelHold);

            foreach (var vend in vendGroups)
            {
                if (vend.Key != null)
                {
                    List<Compost> vendReturn = new List<Compost>();
                    LineChart dataIn = new LineChart();
                    dataIn.label = vend.Key;
                    dataIn.fillColor = coffeeColorT;
                    dataIn.strokeColor = coffeeColor;
                    dataIn.pointColor = coffeeColor;
                    dataIn.pointStrokeColor = "#fff";
                    dataIn.pointHighlightFill = "#fff";
                    dataIn.pointHighlightStroke = coffeeColor;
     
                    List<double> dateHold = new List<double>();
                    var counter = 0;
                    vendReturn = (from vends in db.Composts where (vends.date >= Convert.ToDateTime(dateBeg)) && (vends.date <= Convert.ToDateTime(dateEnd)) && (vends.Vendor == vend.Key) orderby vends.date select vends).ToList();
                    for (DateTime date = Convert.ToDateTime(dateBeg).Date; date.Date <= Convert.ToDateTime(dateEnd).Date; date = date.AddDays(1))
                    {
                        if (counter < vendReturn.Count)
                        {
                            System.Diagnostics.Debug.WriteLine(vendReturn[counter].date.Date);
                            System.Diagnostics.Debug.WriteLine(date.Date);
                            if (Equals(vendReturn[counter].date.Date, date.Date))
                            {
                                dateHold.Add((double)vendReturn[counter].percentCoffeeGrounds);
                                System.Diagnostics.Debug.WriteLine("Im here");
                                counter++;
                            }
                            else
                            {
                                dateHold.Add(0);
                            }
                        }
                        else
                        {
                            dateHold.Add(0);
                        }
                    }
                    dataIn.data = dateHold.ToArray();
                    result.Add(dataIn);
                }
            }
        }
        foreach (var p in result)
        {
            System.Diagnostics.Debug.WriteLine(p.ToString());
        }

        return result;
    }
Ejemplo n.º 50
0
        public static LineChart GetLineChart()
        {
            var lineChart = new LineChart();

            lineChart.Item.Add("500");
            lineChart.Item.Add("600");
            lineChart.Item.Add("531");
            lineChart.Settings = new LineChartSettings
                                     {
                                         Axisx = new List<string>{ "Jun", "Jul", "Aug" },
                                         Axisy = new List<string>{ "Min", "Max" },
                                         Colour = ColorToHexString(Color.Yellow)
                                     };

            return lineChart;
        }
Ejemplo n.º 51
0
 public static LineChart GetGamesRevenuesLine(IList<DetailedStatistics> detailedStatistics)
 {
     var lineChartData = detailedStatistics.Select(s => detailedStatistics.Where(ds => ds.Date.Date <= s.Date.Date)
     .SelectMany(sr => sr.Reports).Sum(r => r.Cost)).Select(s => double.Parse(s.ToString()));
       var gamesCountLine = new LineChart();
       gamesCountLine.ComplexData.Labels.AddRange(detailedStatistics.Select(s => s.Date.ToShortDateString()));
       gamesCountLine.ComplexData.Datasets.AddRange(new List<ComplexDataset>
       {
     new ComplexDataset
     {
         Data = lineChartData.ToList(),
         Label = "Доход от игр",
         FillColor = Colors.Yellow,
         StrokeColor = Colors.Yellow,
         PointColor = Colors.Yellow,
         PointStrokeColor = "#fff",
         PointHighlightFill = "#fff",
         PointHighlightStroke = "rgba(220,220,220,1)",
     }
       });
       gamesCountLine.ChartConfiguration.Responsive = true;
       return gamesCountLine;
 }
Ejemplo n.º 52
0
 private void RefreshCharts()
 {
     scoreChart = new LineChart(Screen.width / 2, Screen.height / 3, "score");
     unitNumChart = new LineChart(Screen.width / 2, Screen.height / 3, "unit_num");
     populationChart = new LineChart(Screen.width / 2, Screen.height / 3, "population");
     chartsReady = true;
 }