Hi,
I have 2 sets of data series. There are 5 series in each set. The second set of series is the same as the first set excpet that the value of the points on the y axis have been shifted (this is done in the data source before it reaches the chart). This means they can all be plotted on the same axis.
I need to always show the first set of series and toggle to also plot the second set of series. I can do the toggling to show/hide the second set of lines by using a check box and handling the checked event as the user checks/unchecks the checkbox:
for (int i = 0; i < StrategyGraphChart.Series.Count; i++){ if (StrategyGraphChart.Series[i].Key.Contains("tvum")) { XYSeries series = StrategyGraphChart.Series[i] as XYSeries; if (series != null) { series.Visible = chkTvum.Checked; } }}
What I would like to do is the have the lines of the second set of series be dashed (or some similar format) to distinguish them from the first set. I can not figure this out using the code above.
How can I do this? Do i need to use layers?
Thanks.
Got it:
//add NumericTimeSeries
NumericTimeSeries someSeries1 = new NumericTimeSeries();
NumericTimeSeries someSeries2 = new NumericTimeSeries();
myChart.LineChart.ChartComponent.Series.Add(someSeries1);
//create LineAppearance for 1st NumericTimeSeries
LineAppearance someLineApp1 = new LineAppearance();
someLineApp1.Thickness = 3;
someLineApp1.LineStyle.DrawStyle = LineDrawStyle.Solid;
myChart.LineChart.LineAppearance.Add(someLineApp1)
//create ChartLayerAppearance for 1st NumericTimeSeries
ChartLayerAppeance someLayer1 = new ChartLayerAppearance();
someLayer1.ChartType = ChartType.LineChart;
someLayer1.Series.Add(someSeries1);
//REPEAT for 2nd NumericTimeSeries
//create LineAppearance for 2nd NumericTimeSeries
LineAppearance someLineApp2 = new LineAppearance();
someLineApp2.Thickness = 1;
someLineApp2.LineStyle.DrawStyle = LineDrawStyle.Dash;
myChart.LineChart.LineAppearance.Add(someLineApp2)
//create ChartLayerAppearance for 2nd NumericTimeSeries
ChartLayerAppeance someLayer2 = new ChartLayerAppearance();
someLayer2.ChartType = ChartType.LineChart;
someLayer2.Series.Add(someSeries2);
That's great for setting different line appearances, but how do i assign them to individual chart component series?
How do I assign a line appearance to a numeric time series?
//set time series line draw styles
LineAppearance grndElLine = new LineAppearance();
grndElLine.Thickness = 3;
grndElLine.LineStyle.DrawStyle = LineDrawStyle.Solid;
//add the line appearance to the line chart
chartGwData.LineChart.LineAppearances.Add(grndElLine);
//add the numeric time series to the chart
chartGwData.LineChart.ChartComponent.Series.Add(grndElSeries);
does this link help you? http://help.infragistics.com/NetAdvantage/WinForms/2010.2/CLR2.0/?page=Chart_Customize_the_Appearance_of_Lines_in_Line_and_Area_Charts.html
Let me know if that helps.
-Graham