Esempio n. 1
0
File: Graph.cs Progetto: zrolfs/pwiz
        /// <summary>
        /// Create a bar graph for the given labels and values arrays.
        /// </summary>
        public void CreateBars(string[] labels, double[] values)
        {
            var pane = _graphControl.GraphPane;

            pane.CurveList.Clear();

            pane.AddBar(null, null, values, Color.Red);
            pane.XAxis.Scale.TextLabels = labels.ToArray();
            pane.XAxis.Type             = AxisType.Text;

            _graphControl.AxisChange();
            GraphUtilities.ScaleAxisLabels(_graphControl.Width, pane);
            _graphControl.Refresh();
        }
Esempio n. 2
0
File: Graph.cs Progetto: zrolfs/pwiz
        /// <summary>
        /// Create chromatogram graph.
        /// </summary>
        public void CreateChromatograms(IEnumerable <Chromatogram> chromatograms, string name)
        {
            var pane = _graphControl.GraphPane;

            pane.CurveList.Clear();
            pane.Title.IsVisible      = true;
            pane.Title.Text           = name;
            _graphControl.IsAntiAlias = false;

            foreach (var chromatogram in chromatograms)
            {
                var line = pane.AddCurve("", ToDoubles(chromatogram.Times), ToDoubles(chromatogram.Intensities), chromatogram.Color, SymbolType.None);
                line.Line.Width       = 2.0f;
                line.Line.IsAntiAlias = true;
            }

            _graphControl.AxisChange();
            GraphUtilities.ScaleAxisLabels(_graphControl.Width, pane);
            _graphControl.Refresh();
        }
Esempio n. 3
0
File: Graph.cs Progetto: zrolfs/pwiz
 /// <summary>
 /// Rescale axis font size when graph size is changed.
 /// </summary>
 void GraphSizeChanged(object sender, EventArgs e)
 {
     GraphUtilities.ScaleAxisLabels(_graphControl.Width, _graphControl.GraphPane);
 }
Esempio n. 4
0
File: Graph.cs Progetto: zrolfs/pwiz
 /// <summary>
 /// Rescale axis font size when user zooms.
 /// </summary>
 void GraphZoomEvent(ZedGraphControl sender, ZoomState oldState, ZoomState newState, PointF mousePosition)
 {
     GraphUtilities.ScaleAxisLabels(_graphControl.Width, _graphControl.GraphPane);
 }