How to draw a histogram overlay
CodePudding user response:
Code section:Enclosing UltraChart1. Axis. Y.T ickmarkStyle=AxisTickStyle. DataInterval;
Enclosing UltraChart1. Axis. Y.T ickmarkInterval=25;
MyChartArea. Axes. The Add (axisX);
MyChartArea. Axes. The 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.Com positeChart. Series. The Add (seriesA);
//this.UltraChart1.Com positeChart. Series. The Add (seriesB);
//step5: Add a chart layer.
ChartLayerAppearance myColumnLayer=new ChartLayerAppearance ();
MyColumnLayer. ChartType=ChartType. ColumnChart;
//myColumnLayer ChartType=ChartType. LineChart; Linear
MyColumnLayer. ChartArea=myChartArea;
MyColumnLayer. AxisX=AxisX;
MyColumnLayer. AxisY=AxisY;
MyColumnLayer. Series. The Add (seriesA);
//create a drawing area
This.UltraChart1.Com positeChart. ChartLayers. Add (myColumnLayer);
Infragistics.UltraChart.Resources.Appearance.Com positeLegend myLegend=new Infragistics.UltraChart.Resources.Appearance.Com positeLegend ();
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. The Fill=Color. CornflowerBlue;
MyLegend. PE. FillStopColor=Color. Transparent;
MyLegend. Border. CornerRadius=10;
MyLegend. Border. Thickness=0;
This.UltraChart1.Com positeChart. Legends. The Add (myLegend);
Data section:
Public NumericSeries GetNumericSeriesBound (string PLANT, string STEP, string MODEL, string FROM_DATE)
{
NumericSeries series=new NumericSeries ();
Series. The Label="series A";
//the DataTable table=GetData ();
DataTable table=SearchChart (PLANT, STEP, MODEL, FROM_DATE);
Series. The Data. The DataSource=table;
Series. Data. LabelColumn="STATUS";
Series. Data. ValueColumn="201908";
The return series.
}
CodePudding user response:
There are bosses know?CodePudding user response:
Have not used this component, recommend you use WPF then Elementhost into WINDOWSFORM