Ejemplo n.º 1
0
Archivo: Graph.cs Proyecto: 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();
        }
Ejemplo n.º 2
0
Archivo: Graph.cs Proyecto: 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();
        }
Ejemplo n.º 3
0
Archivo: Graph.cs Proyecto: 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);
 }
Ejemplo n.º 4
0
Archivo: Graph.cs Proyecto: 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);
 }