I have a bar chart that I am binding to data collected at run-time. I need to be able to add a series of line charts to the chart but I'm having a hard time getting them to appear.
In my code below I am getting some data using linq and binding it to my chart. I then want to add a line series to the chart to represent a target (For eample my chart shows test scores for a group of students using a bar chart and I want to add a line across the 80% mark to represent a target score) How would I go about doing this?
I tried:
I have also tried a few other ways unsuccessfully and I haven't been able to find any examples. There must be something I am missing.
By the way, my bar chart is displayed horizontally and I would like the line to run vertically (I.E. at the 80% mark).
Thanks!
In my code below I am getting some data using linq and binding it to my chart. I then want to add a line series to the chart to represent a target (For eample my chart shows test scores for a group of students using a bar chart and I want to add a line across the 80% mark to represent a target score) How would I go about doing this?
I tried:
var ReopenRate = from myRow in dtTSEdata.AsEnumerable() |
orderby myRow.Field<int>("tm_join") descending |
select new { name = myRow.Field<string>("ln_fi"), value = myRow.Field<System.Nullable<double>>("reopen_rate") }; |
RadChart1.DataSource = ReopenRate; |
RadChart1.DataBind(); |
RadChart1.Series[0].DefaultLabelValue = "#Y{P1}"; |
RadChart1.Series[0].PlotArea.YAxis.Appearance.CustomFormat = "P0"; |
// attempting to add line series to chart ChartSeries csud = new ChartSeries(); |
csud.Type = ChartSeriesType.Line; |
csud.AddItem(80, "Target", System.Drawing.Color.Red); |
I have also tried a few other ways unsuccessfully and I haven't been able to find any examples. There must be something I am missing.
By the way, my bar chart is displayed horizontally and I would like the line to run vertically (I.E. at the 80% mark).
Thanks!