I have a Line chart and I would like to diplay a vertical stripe every 10 data points which shouls cover the next 10 data points. I tried the following code in the Form_load from the example, but nothing happened. Why?
Infragistics.UltraChart.Resources.Appearance.PaintElement striplinepe = new Infragistics.UltraChart.Resources.Appearance.PaintElement();
striplinepe.ElementType = Infragistics.UltraChart.Shared.Styles.PaintElementType.Hatch;
striplinepe.Fill = Color.Khaki;
striplinepe.FillOpacity = 255;
striplinepe.Hatch = Infragistics.UltraChart.Shared.Styles.FillHatchStyle.DiagonalCross;
mychart.Axis.X.StripLines.PE = striplinepe;
mychart.Axis.X.StripLines.Interval = 20;
mychart.Axis.X.StripLines.Visible = true;
Unfortunately, the strip lines only apply to the charts that perform item grouping, such as column and bar charts. It won't work for a line chart. A potential workaround is to handle FillSceneGraph event of the chart and manually draw a colored region where a strip line would normally be. Perhaps this link can help you get started:http://help.infragistics.com/NetAdvantage/WinForms/2010.3/CLR2.0?page=Chart_Modify_Scene_Graph_Using_FillSceneGraph_Event.html
Thank you. Just to verify:
What is the best way to find out the coordinates
a) by data number (e.g., the x-coordinate of the 10th datapoint)
b) by axis value (e.g., the x-coordinate of x-axis-value=10)
c) by extrenum (e.g., the y-coordinate of the line maximum)
Thank you in advance.
The results will depend on the axis type. In the case of the LineChart the screen coordinate of the n-th data point is the same as the screen coordinate of x=n, because the x axis displays the index values of your data. If you have 10 points in the line, x axis will range from 0 to 10.The min or max value of the line can either be obtained by iterating through the data source or frome.ChartCore.GetCurrentDataRef().GetDataMin()Once you get the axis from the grid hashtable, you can map axis values to screen coordinates:xAxis.Map(myValue) or similar for the y axis.