I have an UltraChart of type LineChart. I create a number of NumericTime series and add them to the chart without problemm, but I can't seem to add legend items. Is this because I'm putting NumericTimeSeries in a LineChart?
Infragistics.UltraChart.Resources.Appearance.NumericTimeSeries gwElevSeries = new Infragistics.UltraChart.Resources.Appearance.NumericTimeSeries();
foreach (DataRow gwElevDr in qrySelectGwMonRecords)
{
gwElevSeries.Points.Add(new Infragistics.UltraChart.Resources.Appearance.NumericTimeDataPoint(System.DateTime.Parse(gwElevDr.ItemArray[2].ToString()), System.Double.Parse(gwElevDr.ItemArray[8].ToString()), String.Format("{0:M/d/yyyy}", gwElevDr.ItemArray[2]), false));
}
chartGwData.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.LineChart;
chartGwData.Series.Add(gwElevSeries);
chartGwData.Visible = true;
If anyone can help me place the NumericTimeSeries legend item into the LineChart legend it would be much appreciated. Thanks in advance. Ruben
Hi,
Make sure that you have set:
series.Label = "Series 1";
and the legend is visible:
this.ultraChart1.Legend.Visible = true;
Ok thanks much. Now how do I get the line's appearance in the legend to look like it does in the UltraChart?
This is now it looks in the code:
grndElSeries = numTimeSeriesDict["grndElSeries"];
grndElSeries.Label = "Ground Elev. (ft)";
grndElSeries.PEs.Add(new PaintElement(Color.DarkKhaki));
LineAppearance grndElLineApp = new LineAppearance();
grndElLineApp.Thickness = 10;
grndElLineApp.LineStyle.DrawStyle = LineDrawStyle.Solid;
chartGwData.LineChart.ChartComponent.Series.Add(grndElSeries);
chartGwData.LineChart.LineAppearance.Add(grndElLineApp);
But when I do this i get a thick line on the chart but a thin line in the Legend. How do I get the legend line customized?? Thanks VERY much.