public void ApplyColorizer() { level = Convert.ToDouble(textBox1.Text); Series series = chartControl1.Series[0]; StepLineSeriesView view = new StepLineSeriesView(); series.View = view; RangeSegmentColorizer colorizer = new RangeSegmentColorizer(); colorizer.RangeStops.AddRange(new double[] { minPointValue, level, maxPointValue }); colorizer.LegendItemPattern = "{V1:0.###} - {V2:0.###}"; view.SegmentColorizer = colorizer; }
private Series CreateLineSeries(StrategyDataItemInfo info) { Series s = new Series(); s.Name = info.FieldName; s.ArgumentDataMember = "Time"; s.ValueDataMembers.AddRange(info.FieldName); s.ValueScaleType = ScaleType.Numerical; s.ShowInLegend = true; StepLineSeriesView view = new StepLineSeriesView(); view.Color = info.Color; view.LineStyle.Thickness = (int)(info.GraphWidth * DpiProvider.Default.DpiScaleFactor); s.View = view; s.DataSource = Strategy.StrategyData; return(s); }
Series CreateLineSeries(string str, Color color) { Series s = new Series(); s.Name = str; s.ArgumentDataMember = "Time"; s.ValueDataMembers.AddRange(str); s.ValueScaleType = ScaleType.Numerical; s.ShowInLegend = true; StepLineSeriesView view = new StepLineSeriesView(); view.Color = color; view.LineStyle.Thickness = (int)(21 * DpiProvider.Default.DpiScaleFactor); s.View = view; s.DataSource = History; return(s); }
private void Form1_Load(object sender, EventArgs e) { // Create a new chart. ChartControl stepLineChart = new ChartControl(); // Create a step line series. Series series1 = new Series("Series 1", ViewType.StepLine); // Add points to it. series1.Points.Add(new SeriesPoint("A", 12)); series1.Points.Add(new SeriesPoint("B", 4)); series1.Points.Add(new SeriesPoint("C", 17)); series1.Points.Add(new SeriesPoint("D", 7)); series1.Points.Add(new SeriesPoint("E", 12)); series1.Points.Add(new SeriesPoint("F", 4)); series1.Points.Add(new SeriesPoint("G", 17)); series1.Points.Add(new SeriesPoint("H", 7)); // Add the series to the chart. stepLineChart.Series.Add(series1); // Customize the view-type-specific properties of the series. StepLineSeriesView myView = (StepLineSeriesView)series1.View; myView.LineMarkerOptions.Kind = MarkerKind.Star; myView.LineMarkerOptions.StarPointCount = 5; myView.LineStyle.DashStyle = DashStyle.Dash; // Access the diagram's options. ((XYDiagram)stepLineChart.Diagram).Rotated = true; // Hide the legend (if necessary). stepLineChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; // Add a title to the chart (if necessary). stepLineChart.Titles.Add(new ChartTitle()); stepLineChart.Titles[0].Text = "A Step Line Chart"; // Add the chart to the form. stepLineChart.Dock = DockStyle.Fill; this.Controls.Add(stepLineChart); }