Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
305
Changing Line Appearances in Line Charts
posted

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);

Parents Reply Children