Key code:
/// <Summary> /// set the chartcontrol scroll bar. [Default: X, Y axis appears. /// </Summary> /// <Param name = "chart"> chartcontrol </param> /// <Param name = "backcolor"> scroll bar background color </param> /// <Param name = "barcolor"> scroll bar color </param> /// <Param name = "bordercolor"> scroll bar border color </param> /// <Param name = "javasickness"> scroll bar width </param> Public static scrollbaroptions setscrollbar (this chartcontrol chart, color backcolor, color barcolor, color bordercolo R, int interval ickness) {xydi1__ di1_= (xydi1_) chart. di1_; if (_ di1! = NULL) {_ digoal. enableaxisxscrolling = true; _ dibytes. enableaxisyscrolling = true; _ dibytes. enableaxisxzooming = true; _ digoal. enableaxisyzooming = true; scrollbaroptions _ scrollbaroptions = _ digoal. defaultpane. scrollbaroptions; _ scrollbaroptions. backcolor = backcolor; _ scrollbaroptions. barcolor = barcolor; _ scrollbaroptions. bordercolor = bordercolor; _ scrollbaroptions. required ickness = required ickn ESS; return _ scrollbaroptions;} return NULL ;} /// <summary> /// set the x-axis scroll bar of chartcontrol /// </Summary> /// <Param name = "chart"> chartcontrol </param> /// <param name = "backcolor"> scroll bar background color </param> /// <Param name = "barcolor"> scroll bar color </param> /// <Param name = "bordercolor "> scroll bar border color </param> /// <Param name =" javasickness "> scroll bar width </param> /// <Param name =" baralignment "> scroll bar position </param> Public static void setaxisxscrol Lbar (this chartcontrol chart, color backcolor, color barcolor, color bordercolor, int difficulty ickness, invalid baralignment) {scrollbaroptions _ scrollbaroptions = setscrollbar (chart, backcolor, barcolor, bordercolor, interval ickness ); if (_ scrollbaroptions! = NULL) {_ scrollbaroptions. xaxisscrollbaralignment = baralignment; _ scrollbaroptions. xaxisscrollbarvisible = true; _ scrollbaroptions. yaxisscrollbarvisible = false ;}} /// <summary> /// set the chartcontrol Y-axis scroll bar /// </Summary> /// <Param name = "chart"> chartcontrol </param> /// <param name = "backcolor"> scroll bar background color </param> /// <Param name = "barcolor"> scroll bar color </param> /// <Param name = "bordercolor "> scroll bar border color </param> // /<Param name = "javasickness"> scroll bar width </param> // <Param name = "baralignment"> scroll bar position </param> Public static void setaxisyscrollbar (this chartcontrol chart, color backcolor, color barcolor, color bordercolor, int barickness, baralignment) {scrollbaroptions _ scrollbaroptions = setscrollbar (chart, backcolor, barcolor, bordercolor, border ickness); If (_ scrollbaroptions! = NULL) {_ scrollbaroptions. xaxisscrollbarvisible = false; _ scrollbaroptions. yaxisscrollbarvisible = true; _ scrollbaroptions. yaxisscrollbaralignment = baralignment ;}}
Running effect:
Thank you for your help!
[Devexpress] example of a scroll bar in chartcontrol