blingbling.linegraph.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <head>
  6. <title>Reference</title>
  7. <link rel="stylesheet" href="../ldoc.css" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <!-- Menu -->
  18. <div id="navigation">
  19. <br/>
  20. <h1>ldoc</h1>
  21. <ul>
  22. <li><a href="../index.html">Index</a></li>
  23. </ul>
  24. <h2>Contents</h2>
  25. <ul>
  26. <li><a href="#Functions">Functions</a></li>
  27. </ul>
  28. <h2>Modules</h2>
  29. <ul class="$(kind=='Topics' and '' or 'nowrap'">
  30. <li><a href="../modules/blingbling.calendar.html">blingbling.calendar</a></li>
  31. <li><a href="../modules/blingbling.clock.html">blingbling.clock</a></li>
  32. <li><a href="../modules/blingbling.helpers.html">blingbling.helpers</a></li>
  33. <li><strong>blingbling.linegraph</strong></li>
  34. <li><a href="../modules/blingbling.widget.html">blingbling.widget</a></li>
  35. <li><a href="../modules/blingbling.popups.html">blingbling.popups</a></li>
  36. <li><a href="../modules/blingbling.progress_graph.html">blingbling.progress_graph</a></li>
  37. <li><a href="../modules/blingbling.system.html">blingbling.system</a></li>
  38. <li><a href="../modules/blingbling.tagslist.html">blingbling.tagslist</a></li>
  39. <li><a href="../modules/blingbling.task_warrior.html">blingbling.task_warrior</a></li>
  40. <li><a href="../modules/blingbling.text_box.html">blingbling.text_box</a></li>
  41. <li><a href="../modules/blingbling.transient.html">blingbling.transient</a></li>
  42. <li><a href="../modules/blingbling.triangular_progress_graph.html">blingbling.triangular_progress_graph</a></li>
  43. <li><a href="../modules/blingbling.udisks_glue.html">blingbling.udisks_glue</a></li>
  44. <li><a href="../modules/blingbling.value_text_box.html">blingbling.value_text_box</a></li>
  45. <li><a href="../modules/blingbling.volume.html">blingbling.volume</a></li>
  46. <li><a href="../modules/blingbling.wlourf_circle_graph.html">blingbling.wlourf_circle_graph</a></li>
  47. </ul>
  48. </div>
  49. <div id="content">
  50. <h1>Module <code>blingbling.linegraph</code></h1>
  51. <p>Graph widget.</p>
  52. <p></p>
  53. <h2><a href="#Functions">Functions</a></h2>
  54. <table class="function_list">
  55. <tr>
  56. <td class="name" nowrap><a href="#set_background_color">set_background_color (color)</a></td>
  57. <td class="summary">Fill all the widget (width * height) with this color (default is none ).</td>
  58. </tr>
  59. <tr>
  60. <td class="name" nowrap><a href="#set_graph_background_color">set_graph_background_color (color)</a></td>
  61. <td class="summary">Fill the graph area background with this color (default is none).</td>
  62. </tr>
  63. <tr>
  64. <td class="name" nowrap><a href="#set_rounded_size">set_rounded_size (rounded_size)</a></td>
  65. <td class="summary">Set rounded corners for background and graph background.</td>
  66. </tr>
  67. <tr>
  68. <td class="name" nowrap><a href="#set_v_margin">set_v_margin (margin)</a></td>
  69. <td class="summary">Define the top and bottom margin for the graph area.</td>
  70. </tr>
  71. <tr>
  72. <td class="name" nowrap><a href="#set_h_margin">set_h_margin (margin)</a></td>
  73. <td class="summary">Define the left and right margin for the graph area.</td>
  74. </tr>
  75. <tr>
  76. <td class="name" nowrap><a href="#set_graph_color">set_graph_color (color)</a></td>
  77. <td class="summary">Define the graph color.</td>
  78. </tr>
  79. <tr>
  80. <td class="name" nowrap><a href="#set_graph_line_color">set_graph_line_color (color)</a></td>
  81. <td class="summary">Define the graph outline.</td>
  82. </tr>
  83. <tr>
  84. <td class="name" nowrap><a href="#set_show_text">set_show_text (boolean)</a></td>
  85. <td class="summary">Display text on the graph or not.</td>
  86. </tr>
  87. <tr>
  88. <td class="name" nowrap><a href="#set_value_format">set_value_format (graph, printf)</a></td>
  89. <td class="summary">Define displayed text value format string</td>
  90. </tr>
  91. <tr>
  92. <td class="name" nowrap><a href="#set_text_color">set_text_color (color)</a></td>
  93. <td class="summary">Define the color of the text.</td>
  94. </tr>
  95. <tr>
  96. <td class="name" nowrap><a href="#set_text_background_color">set_text_background_color (color)</a></td>
  97. <td class="summary">Define the background color of the text.</td>
  98. </tr>
  99. <tr>
  100. <td class="name" nowrap><a href="#set_font">set_font (font)</a></td>
  101. <td class="summary">Define the text's font .</td>
  102. </tr>
  103. <tr>
  104. <td class="name" nowrap><a href="#set_font_size">set_font_size (size)</a></td>
  105. <td class="summary">Define the text font size.</td>
  106. </tr>
  107. <tr>
  108. <td class="name" nowrap><a href="#set_label">set_label (text)</a></td>
  109. <td class="summary">Define the template of the text to display.</td>
  110. </tr>
  111. <tr>
  112. <td class="name" nowrap><a href="#set_height">set_height (height)</a></td>
  113. <td class="summary">Set the graph height.</td>
  114. </tr>
  115. <tr>
  116. <td class="name" nowrap><a href="#set_width">set_width (width)</a></td>
  117. <td class="summary">Set the graph width.</td>
  118. </tr>
  119. <tr>
  120. <td class="name" nowrap><a href="#new">new (args)</a></td>
  121. <td class="summary">Create a graph widget.</td>
  122. </tr>
  123. </table>
  124. <br/>
  125. <br/>
  126. <h2><a name="Functions"></a>Functions</h2>
  127. <dl class="function">
  128. <dt>
  129. <a name = "set_background_color"></a>
  130. <strong>set_background_color (color)</strong>
  131. </dt>
  132. <dd>
  133. Fill all the widget (width * height) with this color (default is none ).
  134. <h3>Parameters:</h3>
  135. <ul>
  136. <li><span class="parameter">color</span>
  137. a string "#rrggbbaa" or "#rrggbb"
  138. </li>
  139. </ul>
  140. <h3>Usage:</h3>
  141. <ul>
  142. <pre class="example">mygraph:set_background_color(<span class="global">string</span>) --&gt;<span class="string">"#rrggbbaa"</span></pre>
  143. </ul>
  144. </dd>
  145. <dt>
  146. <a name = "set_graph_background_color"></a>
  147. <strong>set_graph_background_color (color)</strong>
  148. </dt>
  149. <dd>
  150. Fill the graph area background with this color (default is none).
  151. <h3>Parameters:</h3>
  152. <ul>
  153. <li><span class="parameter">color</span>
  154. a string "#rrggbbaa" or "#rrggbb"
  155. </li>
  156. </ul>
  157. <h3>Usage:</h3>
  158. <ul>
  159. <pre class="example">mygraph:set_graph_background_color(<span class="global">string</span>) --&gt;<span class="string">"#rrggbbaa"</span></pre>
  160. </ul>
  161. </dd>
  162. <dt>
  163. <a name = "set_rounded_size"></a>
  164. <strong>set_rounded_size (rounded_size)</strong>
  165. </dt>
  166. <dd>
  167. Set rounded corners for background and graph background.
  168. <h3>Parameters:</h3>
  169. <ul>
  170. <li><span class="parameter">rounded_size</span>
  171. float in [0,1]
  172. </li>
  173. </ul>
  174. <h3>Usage:</h3>
  175. <ul>
  176. <pre class="example">mygraph:set_rounded_size(a) -&gt; a <span class="keyword">in</span> [<span class="number">0</span>,<span class="number">1</span>]</pre>
  177. </ul>
  178. </dd>
  179. <dt>
  180. <a name = "set_v_margin"></a>
  181. <strong>set_v_margin (margin)</strong>
  182. </dt>
  183. <dd>
  184. Define the top and bottom margin for the graph area.
  185. <h3>Parameters:</h3>
  186. <ul>
  187. <li><span class="parameter">margin</span>
  188. an integer for top and bottom margin
  189. </li>
  190. </ul>
  191. <h3>Usage:</h3>
  192. <ul>
  193. <pre class="example">mygraph:set_v_margin(integer)</pre>
  194. </ul>
  195. </dd>
  196. <dt>
  197. <a name = "set_h_margin"></a>
  198. <strong>set_h_margin (margin)</strong>
  199. </dt>
  200. <dd>
  201. Define the left and right margin for the graph area.
  202. <h3>Parameters:</h3>
  203. <ul>
  204. <li><span class="parameter">margin</span>
  205. an integer for left and right margin
  206. </li>
  207. </ul>
  208. <h3>Usage:</h3>
  209. <ul>
  210. <pre class="example">mygraph:set_h_margin(integer)</pre>
  211. </ul>
  212. </dd>
  213. <dt>
  214. <a name = "set_graph_color"></a>
  215. <strong>set_graph_color (color)</strong>
  216. </dt>
  217. <dd>
  218. Define the graph color.
  219. <h3>Parameters:</h3>
  220. <ul>
  221. <li><span class="parameter">color</span>
  222. a string "#rrggbbaa" or "#rrggbb"
  223. </li>
  224. </ul>
  225. <h3>Usage:</h3>
  226. <ul>
  227. <pre class="example">mygraph:set_graph_color(<span class="global">string</span>) --&gt;<span class="string">"#rrggbbaa"</span></pre>
  228. </ul>
  229. </dd>
  230. <dt>
  231. <a name = "set_graph_line_color"></a>
  232. <strong>set_graph_line_color (color)</strong>
  233. </dt>
  234. <dd>
  235. Define the graph outline.
  236. <h3>Parameters:</h3>
  237. <ul>
  238. <li><span class="parameter">color</span>
  239. a string "#rrggbbaa" or "#rrggbb"
  240. </li>
  241. </ul>
  242. <h3>Usage:</h3>
  243. <ul>
  244. <pre class="example">mygraph:set_graph_line_color(<span class="global">string</span>) --&gt;<span class="string">"#rrggbbaa"</span></pre>
  245. </ul>
  246. </dd>
  247. <dt>
  248. <a name = "set_show_text"></a>
  249. <strong>set_show_text (boolean)</strong>
  250. </dt>
  251. <dd>
  252. Display text on the graph or not.
  253. <h3>Parameters:</h3>
  254. <ul>
  255. <li><span class="parameter">boolean</span>
  256. true or false (default is false)
  257. </li>
  258. </ul>
  259. <h3>Usage:</h3>
  260. <ul>
  261. <pre class="example">mygraph:set_show_text(boolean) --&gt; <span class="keyword">true</span> <span class="keyword">or</span> <span class="keyword">false</span></pre>
  262. </ul>
  263. </dd>
  264. <dt>
  265. <a name = "set_value_format"></a>
  266. <strong>set_value_format (graph, printf)</strong>
  267. </dt>
  268. <dd>
  269. Define displayed text value format string
  270. <h3>Parameters:</h3>
  271. <ul>
  272. <li><span class="parameter">graph</span>
  273. the graph
  274. </li>
  275. <li><span class="parameter">printf</span>
  276. format string for display text
  277. </li>
  278. </ul>
  279. <h3>Usage:</h3>
  280. <ul>
  281. <pre class="example">mygraph:set_value_format(<span class="global">string</span>) --&gt; <span class="string">"%2.f"</span></pre>
  282. </ul>
  283. </dd>
  284. <dt>
  285. <a name = "set_text_color"></a>
  286. <strong>set_text_color (color)</strong>
  287. </dt>
  288. <dd>
  289. Define the color of the text.
  290. <h3>Parameters:</h3>
  291. <ul>
  292. <li><span class="parameter">color</span>
  293. a string "#rrggbbaa" or "#rrggbb" defaul is white
  294. </li>
  295. </ul>
  296. <h3>Usage:</h3>
  297. <ul>
  298. <pre class="example">mygraph:set_text_color(<span class="global">string</span>) --&gt;<span class="string">"#rrggbbaa"</span></pre>
  299. </ul>
  300. </dd>
  301. <dt>
  302. <a name = "set_text_background_color"></a>
  303. <strong>set_text_background_color (color)</strong>
  304. </dt>
  305. <dd>
  306. Define the background color of the text.
  307. <h3>Parameters:</h3>
  308. <ul>
  309. <li><span class="parameter">color</span>
  310. a string "#rrggbbaa" or "#rrggbb"
  311. </li>
  312. </ul>
  313. <h3>Usage:</h3>
  314. <ul>
  315. <pre class="example">mygraph:set_text_background_color(<span class="global">string</span>) --&gt;<span class="string">"#rrggbbaa"</span></pre>
  316. </ul>
  317. </dd>
  318. <dt>
  319. <a name = "set_font"></a>
  320. <strong>set_font (font)</strong>
  321. </dt>
  322. <dd>
  323. Define the text's font .
  324. <h3>Parameters:</h3>
  325. <ul>
  326. <li><span class="parameter">font</span>
  327. a string that contains the font name family and weight
  328. </li>
  329. </ul>
  330. <h3>Usage:</h3>
  331. <ul>
  332. <pre class="example">mygraph:set_font(<span class="global">string</span>)</pre>
  333. </ul>
  334. </dd>
  335. <dt>
  336. <a name = "set_font_size"></a>
  337. <strong>set_font_size (size)</strong>
  338. </dt>
  339. <dd>
  340. Define the text font size.
  341. <h3>Parameters:</h3>
  342. <ul>
  343. <li><span class="parameter">size</span>
  344. the font size
  345. </li>
  346. </ul>
  347. <h3>Usage:</h3>
  348. <ul>
  349. <pre class="example">mygraph:set_font_size(integer)</pre>
  350. </ul>
  351. </dd>
  352. <dt>
  353. <a name = "set_label"></a>
  354. <strong>set_label (text)</strong>
  355. </dt>
  356. <dd>
  357. Define the template of the text to display.
  358. <h3>Parameters:</h3>
  359. <ul>
  360. <li><span class="parameter">text</span>
  361. the text to display
  362. </li>
  363. </ul>
  364. <h3>Usage:</h3>
  365. <ul>
  366. <pre class="example"> mygraph:set_label(<span class="global">string</span>)
  367. By default the text is : (value_send_to_the_widget *<span class="number">100</span>) .. <span class="string">"%"</span>
  368. static <span class="global">string</span>: example set_label(<span class="string">"CPU usage:"</span>) will display <span class="string">"CUP usage:"</span> on the graph
  369. dynamic <span class="global">string</span>: use $percent <span class="keyword">in</span> the <span class="global">string</span> example set_label(<span class="string">"Load $percent %"</span>) will display <span class="string">"Load 10%"</span> </pre>
  370. </ul>
  371. </dd>
  372. <dt>
  373. <a name = "set_height"></a>
  374. <strong>set_height (height)</strong>
  375. </dt>
  376. <dd>
  377. Set the graph height.
  378. <h3>Parameters:</h3>
  379. <ul>
  380. <li><span class="parameter">height</span>
  381. The height to set.
  382. </li>
  383. </ul>
  384. </dd>
  385. <dt>
  386. <a name = "set_width"></a>
  387. <strong>set_width (width)</strong>
  388. </dt>
  389. <dd>
  390. Set the graph width.
  391. <h3>Parameters:</h3>
  392. <ul>
  393. <li><span class="parameter">width</span>
  394. The width to set.
  395. </li>
  396. </ul>
  397. </dd>
  398. <dt>
  399. <a name = "new"></a>
  400. <strong>new (args)</strong>
  401. </dt>
  402. <dd>
  403. Create a graph widget.
  404. <h3>Parameters:</h3>
  405. <ul>
  406. <li><span class="parameter">args</span>
  407. Standard widget() arguments. You should add width and height
  408. key to set graph geometry.
  409. </li>
  410. </ul>
  411. <h3>Returns:</h3>
  412. <ol>
  413. A graph widget.
  414. </ol>
  415. </dd>
  416. </dl>
  417. </div> <!-- id="content" -->
  418. </div> <!-- id="main" -->
  419. <div id="about">
  420. <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
  421. <i style="float:right;">Last updated 2015-08-04 10:16:50 </i>
  422. </div> <!-- id="about" -->
  423. </div> <!-- id="container" -->
  424. </body>
  425. </html>