Esempio n. 1
0
        public override void Load(IServiceProvider provider)
        {
            graph      = new GraphControl();
            graph.Dock = DockStyle.Fill;
            graph.GraphPane.Chart.Border.IsVisible    = true;
            graph.GraphPane.YAxis.MajorGrid.IsVisible = true;
            graph.GraphPane.YAxis.MajorGrid.DashOff   = 0;
            graph.GraphPane.YAxis.Title.IsVisible     = true;
            graph.GraphPane.YAxis.Title.Text          = "Time (s)";
            graph.GraphPane.XAxis.Type = AxisType.Text;
            graph.GraphPane.XAxis.Scale.FontSpec.Angle = 90;
            graph.GraphPane.XAxis.MajorTic.IsInside    = false;
            graph.GraphPane.XAxis.MinorTic.IsAllTics   = false;
            graph.GraphPane.XAxis.MajorGrid.IsVisible  = true;
            graph.GraphPane.XAxis.MajorGrid.DashOff    = 0;
            Graph.GraphPane.XAxis.Title.IsVisible      = true;
            Graph.GraphPane.XAxis.Title.Text           = "State";
            var barSeries = new BarItem(string.Empty, values, graph.GetNextColor());

            barSeries.Bar.Fill.Type        = FillType.Solid;
            barSeries.Bar.Border.IsVisible = false;
            graph.GraphPane.CurveList.Add(barSeries);

            var visualizerService = (IDialogTypeVisualizerService)provider.GetService(typeof(IDialogTypeVisualizerService));

            if (visualizerService != null)
            {
                visualizerService.AddControl(graph);
            }
        }
Esempio n. 2
0
 void EnsureSeries(int count)
 {
     if (barSeries == null || barSeries.Length != count)
     {
         graph.ResetColorCycle();
         graph.GraphPane.CurveList.Clear();
         barSeries = new IPointListEdit[count];
         for (int i = 0; i < barSeries.Length; i++)
         {
             var color  = graph.GetNextColor();
             var values = controller.Capacity > 0
                 ? (IPointListEdit) new RollingPointPairList(controller.Capacity)
                 : new PointPairList();
             var barItem = new BarItem(labelBars ? controller.ValueLabels[i] : null, values, color);
             barItem.Bar.Fill.Type        = FillType.Solid;
             barItem.Bar.Border.IsVisible = false;
             graph.GraphPane.CurveList.Add(barItem);
             barSeries[i] = values;
         }
     }
 }
Esempio n. 3
0
 void EnsureSeries(int count)
 {
     if (lineSeries == null || lineSeries.Length != count)
     {
         graph.ResetColorCycle();
         graph.GraphPane.CurveList.Clear();
         lineSeries = new IPointListEdit[count];
         for (int i = 0; i < lineSeries.Length; i++)
         {
             var color  = graph.GetNextColor();
             var values = controller.Capacity > 0
                 ? (IPointListEdit) new RollingPointPairList(controller.Capacity)
                 : new PointPairList();
             var lineItem = new LineItem(labelLines ? controller.ValueLabels[i] : null, values, color, SymbolType.None, 1);
             lineItem.Line.IsAntiAlias     = true;
             lineItem.Line.IsOptimizedDraw = true;
             graph.GraphPane.CurveList.Add(lineItem);
             lineSeries[i] = values;
         }
     }
 }
Esempio n. 4
0
        void EnsureSeries(int count)
        {
            if (lineSeries == null || lineSeries.Length != count)
            {
                graph.ResetColorCycle();
                graph.GraphPane.CurveList.Clear();
                lineSeries = new IPointListEdit[count];
                var labelLines = controller.ValueLabels != null;
                if (labelLines && controller.ValueLabels.Length == 2 && count == 1)
                {
                    labelLines = false;
                    GraphHelper.SetAxisLabel(graph.GraphPane.XAxis, controller.ValueLabels[0]);
                    GraphHelper.SetAxisLabel(graph.GraphPane.YAxis, controller.ValueLabels[1]);
                }

                for (int i = 0; i < lineSeries.Length; i++)
                {
                    var color  = graph.GetNextColor();
                    var values = controller.Capacity > 0
                        ? (IPointListEdit) new RollingPointPairList(controller.Capacity)
                        : new PointPairList();
                    var lineItem = new LineItem(
                        labelLines ? controller.ValueLabels[i] : null,
                        values,
                        color,
                        controller.SymbolType,
                        controller.LineWidth);
                    lineItem.Line.IsAntiAlias     = true;
                    lineItem.Line.IsOptimizedDraw = true;
                    lineItem.Symbol.Fill.Type     = FillType.Solid;
                    lineItem.Symbol.IsAntiAlias   = true;
                    graph.GraphPane.CurveList.Add(lineItem);
                    lineSeries[i] = values;
                }
            }
        }