burjanroppa Posted November 24, 2008 Report Posted November 24, 2008 How do I draw a horizontal Constant line using ChartFX 7.0 and VS 2008? thanks Ram Quote
Frank Posted November 24, 2008 Report Posted November 24, 2008 You need to create a custom gridline on the main Y axis: chart.AxisY.CustomGridlines.Add(new CustomGridLine(value)); Quote
burjanroppa Posted November 24, 2008 Author Report Posted November 24, 2008 Frank, thanks for the reply. I tried your solution, there are no errors, but the line is not visible Here is my code With chartCDMIVolume .DataSourceSettings.DataSource = dt .AxisY.Title.Text = "CDMI Percent".AxisY.DataFormat.Format = ChartFX.WebForms.AxisFormat.Percentage .AxisY.LabelsFormat.Format = ChartFX.WebForms.AxisFormat.Percentage .AxisX.Title.Text = "Process Date".AxisX.DataFormat.Format = ChartFX.WebForms.AxisFormat.Date .ToolBar.Visible = True.LegendBox.Visible = FalseDim oLine As New ChartFX.WebForms.CustomGridLine oLine.Value = (cdmi_percent / lDayCount) * 100 oLine.Text = "Average"oLine.Color = Drawing.Color.Red .AxisY.CustomGridLines.Add(oLine) End Withdt is a datatable with 2 columns. Y axis has values between 0 and 7 percent and X axis displays date values. The Average I am computing comes to 3.50 percent and I need a horizontal line plotted at this value. Any help is appreciated. Thanks Quote
Frank Posted November 24, 2008 Report Posted November 24, 2008 Make sure the scales match. Percentage means values from 0 to 1, so if you want to plot 3.5% that would be a value of .035 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.