大牛幫忙看看, 用Infragistics.UltraChart插件 可以畫下面的圖嗎 ?資料從oracle抓取。
怎么畫柱狀圖疊加

uj5u.com熱心網友回復:
代碼部分:this.UltraChart1.Axis.Y.TickmarkStyle = AxisTickStyle.DataInterval;
this.UltraChart1.Axis.Y.TickmarkInterval = 25;
myChartArea.Axes.Add(axisX);
myChartArea.Axes.Add(axisY);
//step4:Add some data series to the Series collection.
NumericSeries seriesA = oh.GetNumericSeriesBound(PLANT, STEP, MODEL, FROM_DATE);
// NumericSeries seriesB = oh.GetNumericSeriesUnBound();
this.UltraChart1.CompositeChart.Series.Add(seriesA);
// this.UltraChart1.CompositeChart.Series.Add(seriesB);
//step5:Add a chart layer.
ChartLayerAppearance myColumnLayer = new ChartLayerAppearance();
myColumnLayer.ChartType = ChartType.ColumnChart;
//myColumnLayer.ChartType = ChartType.LineChart;線狀
myColumnLayer.ChartArea = myChartArea;
myColumnLayer.AxisX = axisX;
myColumnLayer.AxisY = axisY;
myColumnLayer.Series.Add(seriesA);
//創建繪圖區域
this.UltraChart1.CompositeChart.ChartLayers.Add(myColumnLayer);
Infragistics.UltraChart.Resources.Appearance.CompositeLegend myLegend = new Infragistics.UltraChart.Resources.Appearance.CompositeLegend();
myLegend.ChartLayers.Add(myColumnLayer);
myLegend.Bounds = new Rectangle(0, 75, 100, 100);
myLegend.BoundsMeasureType = MeasureType.Percentage;
myLegend.PE.ElementType = PaintElementType.Gradient;
myLegend.PE.FillGradientStyle = Infragistics.UltraChart.Shared.Styles.GradientStyle.ForwardDiagonal;
myLegend.PE.Fill = Color.CornflowerBlue;
myLegend.PE.FillStopColor = Color.Transparent;
myLegend.Border.CornerRadius = 10;
myLegend.Border.Thickness = 0;
this.UltraChart1.CompositeChart.Legends.Add(myLegend);
資料部分:
public NumericSeries GetNumericSeriesBound(string PLANT, string STEP, string MODEL, string FROM_DATE)
{
NumericSeries series = new NumericSeries();
series.Label = "Series A";
// DataTable table = GetData();
DataTable table = SearchChart(PLANT, STEP, MODEL, FROM_DATE);
series.Data.DataSource = table;
series.Data.LabelColumn = "STATUS";
series.Data.ValueColumn = "201908";
return series;
}
uj5u.com熱心網友回復:
有大佬知道嗎?uj5u.com熱心網友回復:
沒有用過這個 組件,推薦你用 WPF 然后 Elementhost 轉換到 WINDOWSFORM轉載請註明出處,本文鏈接:https://www.uj5u.com/net/117612.html
標籤:C#
下一篇:怎么判斷當前時間是否在指定時間內
