There are many questions on changing line appearances for line charts, but none quite fit what I want to do. I find it hard to believe I'm the only person that has wanted to do this, but I can't find the answer so...
In the following code I would like to change the line style for 9th row "hissy limit":
mydata.Rows.Add(new Object[] { "RC 50", 70, 65, 60, 55, 50, 45, 40 }); mydata.Rows.Add(new Object[] { "RC 45", 65, 60, 55, 50, 45, 40, 35 }); mydata.Rows.Add(new Object[] { "RC 40", 60, 55, 50, 45, 40, 35, 30 }); mydata.Rows.Add(new Object[] { "RC 35", 55, 50, 45, 40, 35, 30, 25 }); mydata.Rows.Add(new Object[] { "RC 30", 50, 45, 40, 35, 30, 25, 20 }); mydata.Rows.Add(new Object[] { "RC 25", 45, 40, 35, 30, 25, 20, 15 }); mydata.Rows.Add(new Object[] { "User Input", userInput[0], userInput[1], userInput[2], userInput[3], userInput[4], userInput[5], userInput[6] }); mydata.Rows.Add(new Object[] { "Rumble Limit", speechInterferenceLine + 25, speechInterferenceLine + 20, speechInterferenceLine + 15, speechInterferenceLine + 10, null, null, null }); mydata.Rows.Add(new Object[] { "Hissy Limit", null, null, null, null, speechInterferenceLine + 3, speechInterferenceLine + -2, speechInterferenceLine - 7 }); mydata.Rows.Add(new Object[] { "Reference Line", speechInterferenceLine + 20, speechInterferenceLine + 15, speechInterferenceLine + 10, speechInterferenceLine + 5, speechInterferenceLine, speechInterferenceLine - 5, speechInterferenceLine - 10 });
TO THIS:
// Overrideing to dashes LineAppearance lineApp3 = new LineAppearance(); lineApp3.LineStyle.DrawStyle = LineDrawStyle.Dash; lineApp3.LineStyle.MidPointAnchors = true; lineApp3.Thickness = 7; this.ultraChart1.LineChart.LineAppearances.Add(lineApp3);
Hello Amanda,
Thank you for contacting Infragistics.
Please see the following page in our documentation: http://help.infragistics.com/doc/WinForms/2014.1/CLR4.0/?page=Chart_Line_Appearances.html.
According to that page, you need to add a LineAppearance for each line you will have in the chart because the chart applies LineAppearances in a cyclical fashion. For example, if you have four lines and two line appearances, each line appearance will be used twice.
Please let me know if you have any other questions about this.