LinesWidth(获得方法)

获得使用线型绘制曲线时的线型宽度。

int  LinesWidth()

返回值

线型宽度。

LinesWidth(设置方法)

设置使用线型绘制曲线时的线型宽度。

void  LinesWidth(

   const int  width      //线型宽度

   )

参数

width

[in]  使用线型绘制曲线时的线型宽度。

示例:

通过以下代码改变线型宽度:

//+------------------------------------------------------------------+

//|                                                CandleGraphic.mq5 |

//|                        Copyright 2016, MetaQuotes Software Corp. |

//|                                             https://www.mql5.com |

//+------------------------------------------------------------------+

#include <Graphics\Graphic.mqh>

//+------------------------------------------------------------------+

//| 脚本程序起始函数                                                   |

//+------------------------------------------------------------------+

void OnStart()

  {

   double x[]= { -100,-40,-10,20,30,40,50,60,70,80,120 };

   double y[]= { -5,4,-10,23,17,18,-9,13,17,4,9 };

//--- 创建图形

   CGraphic graphic;

   if(!graphic.Create(0,"ThickLineGraphic",0,30,30,780,380))

     {

      graphic.Attach(0,"ThickLineGraphic");

     }

//--- 创建曲线

   CCurve *curve=graphic.CurveAdd(x,y,CURVE_LINES);

//--- 设置曲线属性

   curve.LinesSmooth(true);

   curve.LinesStyle(STYLE_DASH);

   curve.LinesEndStyle(LINE_END_ROUND);

   curve.LinesWidth(10);

//--- 绘制 

   graphic.CurvePlotAll();

   graphic.Update();

  }