@nativescript-community/ui-chart 2.0.4 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/package.json +3 -3
  2. package/animation/ChartAnimator.d.ts +0 -61
  3. package/animation/ChartAnimator.js +0 -95
  4. package/animation/ChartAnimator.js.map +0 -1
  5. package/animation/Tween.d.ts +0 -4
  6. package/animation/Tween.js +0 -25
  7. package/animation/Tween.js.map +0 -1
  8. package/buffer/AbstractBuffer.d.ts +0 -40
  9. package/buffer/AbstractBuffer.js +0 -49
  10. package/buffer/AbstractBuffer.js.map +0 -1
  11. package/buffer/BarBuffer.d.ts +0 -15
  12. package/buffer/BarBuffer.js +0 -109
  13. package/buffer/BarBuffer.js.map +0 -1
  14. package/buffer/HorizontalBarBuffer.d.ts +0 -6
  15. package/buffer/HorizontalBarBuffer.js +0 -81
  16. package/buffer/HorizontalBarBuffer.js.map +0 -1
  17. package/charts/BarChart.d.ts +0 -94
  18. package/charts/BarChart.js +0 -141
  19. package/charts/BarChart.js.map +0 -1
  20. package/charts/BarLineChartBase.d.ts +0 -592
  21. package/charts/BarLineChartBase.js +0 -1253
  22. package/charts/BarLineChartBase.js.map +0 -1
  23. package/charts/BubbleChart.d.ts +0 -27
  24. package/charts/BubbleChart.js +0 -20
  25. package/charts/BubbleChart.js.map +0 -1
  26. package/charts/CandleStickChart.d.ts +0 -29
  27. package/charts/CandleStickChart.js +0 -19
  28. package/charts/CandleStickChart.js.map +0 -1
  29. package/charts/Chart.d.ts +0 -491
  30. package/charts/Chart.js +0 -778
  31. package/charts/Chart.js.map +0 -1
  32. package/charts/CombinedChart.d.ts +0 -78
  33. package/charts/CombinedChart.js +0 -119
  34. package/charts/CombinedChart.js.map +0 -1
  35. package/charts/HorizontalBarChart.d.ts +0 -54
  36. package/charts/HorizontalBarChart.js +0 -180
  37. package/charts/HorizontalBarChart.js.map +0 -1
  38. package/charts/LineChart.d.ts +0 -20
  39. package/charts/LineChart.js +0 -19
  40. package/charts/LineChart.js.map +0 -1
  41. package/charts/PieChart.d.ts +0 -249
  42. package/charts/PieChart.js +0 -468
  43. package/charts/PieChart.js.map +0 -1
  44. package/charts/PieRadarChartBase.d.ts +0 -130
  45. package/charts/PieRadarChartBase.js +0 -360
  46. package/charts/PieRadarChartBase.js.map +0 -1
  47. package/charts/RadarChart.d.ts +0 -101
  48. package/charts/RadarChart.js +0 -181
  49. package/charts/RadarChart.js.map +0 -1
  50. package/charts/ScatterChart.d.ts +0 -36
  51. package/charts/ScatterChart.js +0 -31
  52. package/charts/ScatterChart.js.map +0 -1
  53. package/charts/index.d.ts +0 -9
  54. package/charts/index.js +0 -10
  55. package/charts/index.js.map +0 -1
  56. package/components/AxisBase.d.ts +0 -299
  57. package/components/AxisBase.js +0 -351
  58. package/components/AxisBase.js.map +0 -1
  59. package/components/ComponentBase.d.ts +0 -60
  60. package/components/ComponentBase.js +0 -77
  61. package/components/ComponentBase.js.map +0 -1
  62. package/components/Description.d.ts +0 -22
  63. package/components/Description.js +0 -21
  64. package/components/Description.js.map +0 -1
  65. package/components/IMarker.d.ts +0 -39
  66. package/components/IMarker.js +0 -2
  67. package/components/IMarker.js.map +0 -1
  68. package/components/Legend.d.ts +0 -198
  69. package/components/Legend.js +0 -386
  70. package/components/Legend.js.map +0 -1
  71. package/components/LegendEntry.d.ts +0 -50
  72. package/components/LegendEntry.js +0 -51
  73. package/components/LegendEntry.js.map +0 -1
  74. package/components/LimitLine.d.ts +0 -55
  75. package/components/LimitLine.js +0 -62
  76. package/components/LimitLine.js.map +0 -1
  77. package/components/MarkerImage.d.ts +0 -1
  78. package/components/MarkerImage.js +0 -97
  79. package/components/MarkerImage.js.map +0 -1
  80. package/components/XAxis.d.ts +0 -55
  81. package/components/XAxis.js +0 -59
  82. package/components/XAxis.js.map +0 -1
  83. package/components/YAxis.d.ts +0 -135
  84. package/components/YAxis.js +0 -205
  85. package/components/YAxis.js.map +0 -1
  86. package/data/BarData.d.ts +0 -38
  87. package/data/BarData.js +0 -122
  88. package/data/BarData.js.map +0 -1
  89. package/data/BarDataSet.d.ts +0 -47
  90. package/data/BarDataSet.js +0 -109
  91. package/data/BarDataSet.js.map +0 -1
  92. package/data/BarEntry.d.ts +0 -11
  93. package/data/BarEntry.js +0 -2
  94. package/data/BarEntry.js.map +0 -1
  95. package/data/BarLineScatterCandleBubbleData.d.ts +0 -10
  96. package/data/BarLineScatterCandleBubbleData.js +0 -9
  97. package/data/BarLineScatterCandleBubbleData.js.map +0 -1
  98. package/data/BarLineScatterCandleBubbleDataSet.d.ts +0 -17
  99. package/data/BarLineScatterCandleBubbleDataSet.js +0 -18
  100. package/data/BarLineScatterCandleBubbleDataSet.js.map +0 -1
  101. package/data/BaseDataSet.d.ts +0 -180
  102. package/data/BaseDataSet.js +0 -220
  103. package/data/BaseDataSet.js.map +0 -1
  104. package/data/BaseEntry.d.ts +0 -10
  105. package/data/BaseEntry.js +0 -2
  106. package/data/BaseEntry.js.map +0 -1
  107. package/data/BubbleData.d.ts +0 -12
  108. package/data/BubbleData.js +0 -15
  109. package/data/BubbleData.js.map +0 -1
  110. package/data/BubbleDataSet.d.ts +0 -18
  111. package/data/BubbleDataSet.js +0 -36
  112. package/data/BubbleDataSet.js.map +0 -1
  113. package/data/BubbleEntry.d.ts +0 -5
  114. package/data/BubbleEntry.js +0 -2
  115. package/data/BubbleEntry.js.map +0 -1
  116. package/data/CandleData.d.ts +0 -5
  117. package/data/CandleData.js +0 -4
  118. package/data/CandleData.js.map +0 -1
  119. package/data/CandleDataSet.d.ts +0 -76
  120. package/data/CandleDataSet.js +0 -116
  121. package/data/CandleDataSet.js.map +0 -1
  122. package/data/CandleEntry.d.ts +0 -11
  123. package/data/CandleEntry.js +0 -2
  124. package/data/CandleEntry.js.map +0 -1
  125. package/data/ChartData.d.ts +0 -320
  126. package/data/ChartData.js +0 -702
  127. package/data/ChartData.js.map +0 -1
  128. package/data/CombinedData.d.ts +0 -61
  129. package/data/CombinedData.js +0 -153
  130. package/data/CombinedData.js.map +0 -1
  131. package/data/DataSet.d.ts +0 -98
  132. package/data/DataSet.js +0 -424
  133. package/data/DataSet.js.map +0 -1
  134. package/data/Entry.d.ts +0 -3
  135. package/data/Entry.js +0 -2
  136. package/data/Entry.js.map +0 -1
  137. package/data/LineData.d.ts +0 -10
  138. package/data/LineData.js +0 -9
  139. package/data/LineData.js.map +0 -1
  140. package/data/LineDataSet.d.ts +0 -106
  141. package/data/LineDataSet.js +0 -153
  142. package/data/LineDataSet.js.map +0 -1
  143. package/data/LineRadarDataSet.d.ts +0 -32
  144. package/data/LineRadarDataSet.js +0 -29
  145. package/data/LineRadarDataSet.js.map +0 -1
  146. package/data/LineScatterCandleRadarDataSet.d.ts +0 -36
  147. package/data/LineScatterCandleRadarDataSet.js +0 -44
  148. package/data/LineScatterCandleRadarDataSet.js.map +0 -1
  149. package/data/PieData.d.ts +0 -39
  150. package/data/PieData.js +0 -55
  151. package/data/PieData.js.map +0 -1
  152. package/data/PieDataSet.d.ts +0 -52
  153. package/data/PieDataSet.js +0 -54
  154. package/data/PieDataSet.js.map +0 -1
  155. package/data/PieEntry.d.ts +0 -7
  156. package/data/PieEntry.js +0 -2
  157. package/data/PieEntry.js.map +0 -1
  158. package/data/RadarData.d.ts +0 -17
  159. package/data/RadarData.js +0 -15
  160. package/data/RadarData.js.map +0 -1
  161. package/data/RadarDataSet.d.ts +0 -14
  162. package/data/RadarDataSet.js +0 -20
  163. package/data/RadarDataSet.js.map +0 -1
  164. package/data/RadarEntry.d.ts +0 -3
  165. package/data/RadarEntry.js +0 -2
  166. package/data/RadarEntry.js.map +0 -1
  167. package/data/ScatterData.d.ts +0 -9
  168. package/data/ScatterData.js +0 -17
  169. package/data/ScatterData.js.map +0 -1
  170. package/data/ScatterDataSet.d.ts +0 -40
  171. package/data/ScatterDataSet.js +0 -61
  172. package/data/ScatterDataSet.js.map +0 -1
  173. package/formatter/DefaultAxisValueFormatter.d.ts +0 -23
  174. package/formatter/DefaultAxisValueFormatter.js +0 -30
  175. package/formatter/DefaultAxisValueFormatter.js.map +0 -1
  176. package/formatter/DefaultFillFormatter.d.ts +0 -6
  177. package/formatter/DefaultFillFormatter.js +0 -29
  178. package/formatter/DefaultFillFormatter.js.map +0 -1
  179. package/formatter/DefaultValueFormatter.d.ts +0 -3
  180. package/formatter/DefaultValueFormatter.js +0 -4
  181. package/formatter/DefaultValueFormatter.js.map +0 -1
  182. package/formatter/IAxisValueFormatter.d.ts +0 -23
  183. package/formatter/IAxisValueFormatter.js +0 -2
  184. package/formatter/IAxisValueFormatter.js.map +0 -1
  185. package/formatter/IFillFormatter.d.ts +0 -30
  186. package/formatter/IFillFormatter.js +0 -2
  187. package/formatter/IFillFormatter.js.map +0 -1
  188. package/formatter/IValueFormatter.d.ts +0 -25
  189. package/formatter/IValueFormatter.js +0 -2
  190. package/formatter/IValueFormatter.js.map +0 -1
  191. package/formatter/ValueFormatter.d.ts +0 -81
  192. package/formatter/ValueFormatter.js +0 -90
  193. package/formatter/ValueFormatter.js.map +0 -1
  194. package/highlight/BarHighlighter.d.ts +0 -33
  195. package/highlight/BarHighlighter.js +0 -89
  196. package/highlight/BarHighlighter.js.map +0 -1
  197. package/highlight/ChartHighlighter.d.ts +0 -102
  198. package/highlight/ChartHighlighter.js +0 -220
  199. package/highlight/ChartHighlighter.js.map +0 -1
  200. package/highlight/CombinedHighlighter.d.ts +0 -17
  201. package/highlight/CombinedHighlighter.js +0 -59
  202. package/highlight/CombinedHighlighter.js.map +0 -1
  203. package/highlight/Highlight.d.ts +0 -69
  204. package/highlight/Highlight.js +0 -8
  205. package/highlight/Highlight.js.map +0 -1
  206. package/highlight/HorizontalBarHighlighter.d.ts +0 -10
  207. package/highlight/HorizontalBarHighlighter.js +0 -54
  208. package/highlight/HorizontalBarHighlighter.js.map +0 -1
  209. package/highlight/IHighlighter.d.ts +0 -15
  210. package/highlight/IHighlighter.js +0 -2
  211. package/highlight/IHighlighter.js.map +0 -1
  212. package/highlight/PieHighlighter.d.ts +0 -9
  213. package/highlight/PieHighlighter.js +0 -21
  214. package/highlight/PieHighlighter.js.map +0 -1
  215. package/highlight/PieRadarHighlighter.d.ts +0 -25
  216. package/highlight/PieRadarHighlighter.js +0 -33
  217. package/highlight/PieRadarHighlighter.js.map +0 -1
  218. package/highlight/RadarHighlighter.d.ts +0 -20
  219. package/highlight/RadarHighlighter.js +0 -59
  220. package/highlight/RadarHighlighter.js.map +0 -1
  221. package/index.d.ts +0 -11
  222. package/index.js +0 -15
  223. package/index.js.map +0 -1
  224. package/interfaces/dataprovider/BarDataProvider.d.ts +0 -9
  225. package/interfaces/dataprovider/BarLineScatterCandleBubbleDataProvider.d.ts +0 -19
  226. package/interfaces/dataprovider/BubbleDataProvider.d.ts +0 -6
  227. package/interfaces/dataprovider/CandleDataProvider.d.ts +0 -6
  228. package/interfaces/dataprovider/ChartInterface.d.ts +0 -60
  229. package/interfaces/dataprovider/CombinedDataProvider.d.ts +0 -13
  230. package/interfaces/dataprovider/LineDataProvider.d.ts +0 -9
  231. package/interfaces/dataprovider/ScatterDataProvider.d.ts +0 -6
  232. package/interfaces/datasets/IBarDataSet.d.ts +0 -47
  233. package/interfaces/datasets/IBarLineScatterCandleBubbleDataSet.d.ts +0 -12
  234. package/interfaces/datasets/IBubbleDataSet.d.ts +0 -19
  235. package/interfaces/datasets/ICandleDataSet.d.ts +0 -81
  236. package/interfaces/datasets/IDataSet.d.ts +0 -385
  237. package/interfaces/datasets/ILineDataSet.d.ts +0 -67
  238. package/interfaces/datasets/ILineRadarDataSet.d.ts +0 -35
  239. package/interfaces/datasets/ILineScatterCandleRadarDataSet.d.ts +0 -32
  240. package/interfaces/datasets/IPieDataSet.d.ts +0 -49
  241. package/interfaces/datasets/IRadarDataSet.d.ts +0 -21
  242. package/interfaces/datasets/IScatterDataSet.d.ts +0 -37
  243. package/jobs/AnimatedMoveViewJob.d.ts +0 -15
  244. package/jobs/AnimatedMoveViewJob.js +0 -42
  245. package/jobs/AnimatedMoveViewJob.js.map +0 -1
  246. package/jobs/AnimatedViewPortJob.d.ts +0 -31
  247. package/jobs/AnimatedViewPortJob.js +0 -52
  248. package/jobs/AnimatedViewPortJob.js.map +0 -1
  249. package/jobs/AnimatedZoomJob.d.ts +0 -23
  250. package/jobs/AnimatedZoomJob.js +0 -63
  251. package/jobs/AnimatedZoomJob.js.map +0 -1
  252. package/jobs/MoveViewJob.d.ts +0 -14
  253. package/jobs/MoveViewJob.js +0 -36
  254. package/jobs/MoveViewJob.js.map +0 -1
  255. package/jobs/ViewPortJob.d.ts +0 -13
  256. package/jobs/ViewPortJob.js +0 -14
  257. package/jobs/ViewPortJob.js.map +0 -1
  258. package/jobs/ZoomJob.d.ts +0 -15
  259. package/jobs/ZoomJob.js +0 -48
  260. package/jobs/ZoomJob.js.map +0 -1
  261. package/listener/BarLineChartTouchListener.d.ts +0 -187
  262. package/listener/BarLineChartTouchListener.js +0 -544
  263. package/listener/BarLineChartTouchListener.js.map +0 -1
  264. package/listener/ChartTouchListener.d.ts +0 -69
  265. package/listener/ChartTouchListener.js +0 -81
  266. package/listener/ChartTouchListener.js.map +0 -1
  267. package/listener/PieRadarChartTouchListener.d.ts +0 -100
  268. package/listener/PieRadarChartTouchListener.js +0 -282
  269. package/listener/PieRadarChartTouchListener.js.map +0 -1
  270. package/model/GradientColor.d.ts +0 -9
  271. package/model/GradientColor.js +0 -19
  272. package/model/GradientColor.js.map +0 -1
  273. package/renderer/AxisRenderer.d.ts +0 -101
  274. package/renderer/AxisRenderer.js +0 -219
  275. package/renderer/AxisRenderer.js.map +0 -1
  276. package/renderer/BarChartRenderer.d.ts +0 -40
  277. package/renderer/BarChartRenderer.js +0 -366
  278. package/renderer/BarChartRenderer.js.map +0 -1
  279. package/renderer/BarLineScatterCandleBubbleRenderer.d.ts +0 -57
  280. package/renderer/BarLineScatterCandleBubbleRenderer.js +0 -63
  281. package/renderer/BarLineScatterCandleBubbleRenderer.js.map +0 -1
  282. package/renderer/BubbleChartRenderer.d.ts +0 -22
  283. package/renderer/BubbleChartRenderer.js +0 -204
  284. package/renderer/BubbleChartRenderer.js.map +0 -1
  285. package/renderer/CandleStickChartRenderer.d.ts +0 -18
  286. package/renderer/CandleStickChartRenderer.js +0 -268
  287. package/renderer/CandleStickChartRenderer.js.map +0 -1
  288. package/renderer/CombinedChartRenderer.d.ts +0 -40
  289. package/renderer/CombinedChartRenderer.js +0 -133
  290. package/renderer/CombinedChartRenderer.js.map +0 -1
  291. package/renderer/DataRenderer.d.ts +0 -103
  292. package/renderer/DataRenderer.js +0 -110
  293. package/renderer/DataRenderer.js.map +0 -1
  294. package/renderer/HorizontalBarChartRenderer.d.ts +0 -20
  295. package/renderer/HorizontalBarChartRenderer.js +0 -303
  296. package/renderer/HorizontalBarChartRenderer.js.map +0 -1
  297. package/renderer/LegendRenderer.d.ts +0 -54
  298. package/renderer/LegendRenderer.js +0 -340
  299. package/renderer/LegendRenderer.js.map +0 -1
  300. package/renderer/LineChartRenderer.d.ts +0 -100
  301. package/renderer/LineChartRenderer.js +0 -766
  302. package/renderer/LineChartRenderer.js.map +0 -1
  303. package/renderer/LineRadarRenderer.d.ts +0 -30
  304. package/renderer/LineRadarRenderer.js +0 -85
  305. package/renderer/LineRadarRenderer.js.map +0 -1
  306. package/renderer/LineScatterCandleRadarRenderer.d.ts +0 -20
  307. package/renderer/LineScatterCandleRadarRenderer.js +0 -45
  308. package/renderer/LineScatterCandleRadarRenderer.js.map +0 -1
  309. package/renderer/PieChartRenderer.d.ts +0 -86
  310. package/renderer/PieChartRenderer.js +0 -718
  311. package/renderer/PieChartRenderer.js.map +0 -1
  312. package/renderer/RadarChartRenderer.d.ts +0 -33
  313. package/renderer/RadarChartRenderer.js +0 -290
  314. package/renderer/RadarChartRenderer.js.map +0 -1
  315. package/renderer/Renderer.d.ts +0 -13
  316. package/renderer/Renderer.js +0 -11
  317. package/renderer/Renderer.js.map +0 -1
  318. package/renderer/ScatterChartRenderer.d.ts +0 -16
  319. package/renderer/ScatterChartRenderer.js +0 -147
  320. package/renderer/ScatterChartRenderer.js.map +0 -1
  321. package/renderer/XAxisRenderer.d.ts +0 -58
  322. package/renderer/XAxisRenderer.js +0 -458
  323. package/renderer/XAxisRenderer.js.map +0 -1
  324. package/renderer/XAxisRendererHorizontalBarChart.d.ts +0 -31
  325. package/renderer/XAxisRendererHorizontalBarChart.js +0 -271
  326. package/renderer/XAxisRendererHorizontalBarChart.js.map +0 -1
  327. package/renderer/XAxisRendererRadarChart.d.ts +0 -17
  328. package/renderer/XAxisRendererRadarChart.js +0 -51
  329. package/renderer/XAxisRendererRadarChart.js.map +0 -1
  330. package/renderer/YAxisRenderer.d.ts +0 -60
  331. package/renderer/YAxisRenderer.js +0 -379
  332. package/renderer/YAxisRenderer.js.map +0 -1
  333. package/renderer/YAxisRendererHorizontalBarChart.d.ts +0 -33
  334. package/renderer/YAxisRendererHorizontalBarChart.js +0 -250
  335. package/renderer/YAxisRendererHorizontalBarChart.js.map +0 -1
  336. package/renderer/YAxisRendererRadarChart.d.ts +0 -14
  337. package/renderer/YAxisRendererRadarChart.js +0 -180
  338. package/renderer/YAxisRendererRadarChart.js.map +0 -1
  339. package/renderer/scatter/ChevronDownShapeRenderer.d.ts +0 -11
  340. package/renderer/scatter/ChevronDownShapeRenderer.js +0 -15
  341. package/renderer/scatter/ChevronDownShapeRenderer.js.map +0 -1
  342. package/renderer/scatter/ChevronUpShapeRenderer.d.ts +0 -11
  343. package/renderer/scatter/ChevronUpShapeRenderer.js +0 -15
  344. package/renderer/scatter/ChevronUpShapeRenderer.js.map +0 -1
  345. package/renderer/scatter/CircleShapeRenderer.d.ts +0 -11
  346. package/renderer/scatter/CircleShapeRenderer.js +0 -31
  347. package/renderer/scatter/CircleShapeRenderer.js.map +0 -1
  348. package/renderer/scatter/CrossShapeRenderer.d.ts +0 -11
  349. package/renderer/scatter/CrossShapeRenderer.js +0 -15
  350. package/renderer/scatter/CrossShapeRenderer.js.map +0 -1
  351. package/renderer/scatter/IShapeRenderer.d.ts +0 -20
  352. package/renderer/scatter/IShapeRenderer.js +0 -2
  353. package/renderer/scatter/IShapeRenderer.js.map +0 -1
  354. package/renderer/scatter/SquareShapeRenderer.d.ts +0 -11
  355. package/renderer/scatter/SquareShapeRenderer.js +0 -31
  356. package/renderer/scatter/SquareShapeRenderer.js.map +0 -1
  357. package/renderer/scatter/TriangleShapeRenderer.d.ts +0 -12
  358. package/renderer/scatter/TriangleShapeRenderer.js +0 -43
  359. package/renderer/scatter/TriangleShapeRenderer.js.map +0 -1
  360. package/renderer/scatter/XShapeRenderer.d.ts +0 -11
  361. package/renderer/scatter/XShapeRenderer.js +0 -15
  362. package/renderer/scatter/XShapeRenderer.js.map +0 -1
  363. package/utils/ColorTemplate.d.ts +0 -34
  364. package/utils/ColorTemplate.js +0 -51
  365. package/utils/ColorTemplate.js.map +0 -1
  366. package/utils/HorizontalViewPortHandler.d.ts +0 -6
  367. package/utils/HorizontalViewPortHandler.js +0 -7
  368. package/utils/HorizontalViewPortHandler.js.map +0 -1
  369. package/utils/MPPointD.d.ts +0 -5
  370. package/utils/MPPointF.d.ts +0 -7
  371. package/utils/MPSize.d.ts +0 -7
  372. package/utils/ObjectPool.d.ts +0 -81
  373. package/utils/ObjectPool.js +0 -183
  374. package/utils/ObjectPool.js.map +0 -1
  375. package/utils/Transformer.d.ts +0 -175
  376. package/utils/Transformer.js +0 -356
  377. package/utils/Transformer.js.map +0 -1
  378. package/utils/TransformerHorizontalBarChart.d.ts +0 -14
  379. package/utils/TransformerHorizontalBarChart.js +0 -30
  380. package/utils/TransformerHorizontalBarChart.js.map +0 -1
  381. package/utils/Utils.d.ts +0 -203
  382. package/utils/Utils.js +0 -653
  383. package/utils/Utils.js.map +0 -1
  384. package/utils/ViewPortHandler.d.ts +0 -299
  385. package/utils/ViewPortHandler.js +0 -580
  386. package/utils/ViewPortHandler.js.map +0 -1
  387. package/utils/colors/colorful.d.ts +0 -1
  388. package/utils/colors/colorful.js +0 -2
  389. package/utils/colors/colorful.js.map +0 -1
  390. package/utils/colors/joyful.d.ts +0 -1
  391. package/utils/colors/joyful.js +0 -2
  392. package/utils/colors/joyful.js.map +0 -1
  393. package/utils/colors/liberty.d.ts +0 -1
  394. package/utils/colors/liberty.js +0 -2
  395. package/utils/colors/liberty.js.map +0 -1
  396. package/utils/colors/material.d.ts +0 -1
  397. package/utils/colors/material.js +0 -2
  398. package/utils/colors/material.js.map +0 -1
  399. package/utils/colors/pastel.d.ts +0 -1
  400. package/utils/colors/pastel.js +0 -2
  401. package/utils/colors/pastel.js.map +0 -1
  402. package/utils/colors/vordiplom.d.ts +0 -1
  403. package/utils/colors/vordiplom.js +0 -2
  404. package/utils/colors/vordiplom.js.map +0 -1
package/charts/Chart.js DELETED
@@ -1,778 +0,0 @@
1
- import { Align, Canvas, CanvasView } from '@nativescript-community/ui-canvas';
2
- import { Utils as NUtils, Trace } from '@nativescript/core';
3
- import { ChartAnimator } from '../animation/ChartAnimator';
4
- import { Description } from '../components/Description';
5
- import { Legend } from '../components/Legend';
6
- import { XAxis } from '../components/XAxis';
7
- import { DefaultValueFormatter } from '../formatter/DefaultValueFormatter';
8
- import { LegendRenderer } from '../renderer/LegendRenderer';
9
- import { CLog, CLogTypes, Utils } from '../utils/Utils';
10
- import { ViewPortHandler } from '../utils/ViewPortHandler';
11
- const LOG_TAG = 'NSChart';
12
- /**
13
- * Baseclass of all Chart-Views.
14
- *
15
-
16
- */
17
- export class Chart extends CanvasView {
18
- /**
19
- * default constructor for initialization in code
20
- */
21
- constructor() {
22
- super();
23
- /**
24
- * object that holds all data that was originally set for the chart, before
25
- * it was modified or any filtering algorithms had been applied
26
- */
27
- this.mData = null;
28
- /**
29
- * If set to true, chart continues to scroll after touch up
30
- */
31
- this.dragDecelerationEnabled = true;
32
- /**
33
- * Deceleration friction coefficient in [0 ; 1] interval, higher values
34
- * indicate that speed will decrease slowly, for example if it set to 0, it
35
- * will stop immediately. value must be < 1.0
36
- */
37
- this.dragDecelerationFrictionCoef = 0.9;
38
- /**
39
- * the default IValueFormatter that has been determined by the chart
40
- * considering the provided minimum and maximum values, number of digits depends on provided chart-data
41
- */
42
- this.defaultValueFormatter = new DefaultValueFormatter(0);
43
- /**
44
- * text that is displayed when the chart is empty
45
- */
46
- this.noDataText = null;
47
- /**
48
- * object that manages the bounds and drawing constraints of the chart
49
- */
50
- this.viewPortHandler = new ViewPortHandler();
51
- /**
52
- * Extra offsets to be appended to the viewport
53
- */
54
- this.extraTopOffset = 0;
55
- this.extraRightOffset = 0;
56
- this.extraBottomOffset = 0;
57
- this.extraLeftOffset = 0;
58
- /**
59
- * let the chart know it does not need to compute autoScale
60
- * (it can used the cached ones)
61
- */
62
- this.noComputeAutoScaleOnNextDraw = false;
63
- /**
64
- * let the chart know it does not need to compute axis and legends
65
- * (it can used the cached ones)
66
- */
67
- this.noComputeAxisOnNextDraw = false;
68
- /**
69
- * The maximum distance in dp away from an entry causing it to highlight.
70
- */
71
- this.maxHighlightDistance = 500;
72
- /**
73
- * Wether to filter highlights by axis. Default is true
74
- */
75
- this.highlightsFilterByAxis = true;
76
- /**
77
- * tasks to be done after the view is setup
78
- */
79
- this.jobs = [];
80
- // /**
81
- // * Set a new (e.g. custom) ChartTouchListener NOTE: make sure to
82
- // * setTouchEnabled(true); if you need touch gestures on the chart
83
- // *
84
- // * @param l
85
- // */
86
- // public setOnTouchListener(ChartTouchListener l) {
87
- // this.chartTouchListener = l;
88
- // }
89
- // /**
90
- // * Returns an instance of the currently active touch listener.
91
- // *
92
- // * @return
93
- // */
94
- // public ChartTouchListener getOnTouchListener() {
95
- // return this.chartTouchListener;
96
- // }
97
- /**
98
- * ################ ################ ################ ################
99
- */
100
- /** BELOW CODE IS FOR THE MARKER VIEW */
101
- /**
102
- * if set to true, the marker view is drawn when a value is clicked
103
- */
104
- this.drawMarkersEnabled = true;
105
- this.init();
106
- }
107
- initNativeView() {
108
- super.initNativeView();
109
- this.chartTouchListener && this.chartTouchListener.init();
110
- }
111
- disposeNativeView() {
112
- super.disposeNativeView();
113
- this.chartTouchListener && this.chartTouchListener.dispose();
114
- }
115
- /**
116
- * initialize all paints and stuff
117
- */
118
- init() {
119
- this.animator = new ChartAnimator((state) => {
120
- // during animations we dont need to compute autoScale nor axis things
121
- this.noComputeAutoScaleOnNextDraw = true;
122
- this.noComputeAxisOnNextDraw = true;
123
- this.invalidate();
124
- });
125
- this.xAxis = new XAxis(new WeakRef(this));
126
- if (Trace.isEnabled()) {
127
- CLog(CLogTypes.log, this.constructor.name, 'init()');
128
- }
129
- }
130
- get infoPaint() {
131
- if (!this.mInfoPaint) {
132
- this.mInfoPaint = Utils.getTemplatePaint('black-fill');
133
- this.mInfoPaint.setTextAlign(Align.CENTER);
134
- this.mInfoPaint.setTextSize(12);
135
- }
136
- return this.mInfoPaint;
137
- }
138
- /**
139
- * Sets a new data object for the chart. The data object contains all values
140
- * and information needed for displaying.
141
- *
142
- * @param data
143
- */
144
- set data(data) {
145
- this.mData = data;
146
- this.offsetsCalculated = false;
147
- if (!data) {
148
- return;
149
- }
150
- // Calculate how many digits are needed
151
- this.setupDefaultFormatter(data.yMin, data.yMax);
152
- for (const set of this.mData.dataSets) {
153
- if (set.needsFormatter || set.valueFormatter === this.defaultValueFormatter) {
154
- set.valueFormatter = this.defaultValueFormatter;
155
- }
156
- }
157
- // let the chart know there is new data
158
- this.notifyDataSetChanged();
159
- }
160
- /**
161
- * Returns the ChartData object that has been set for the chart.
162
- */
163
- get data() {
164
- return this.mData;
165
- }
166
- get viewPortScaleX() {
167
- return this.viewPortHandler.scaleX;
168
- }
169
- get viewPortScaleY() {
170
- return this.viewPortHandler.scaleY;
171
- }
172
- /**
173
- * Clears the chart from all data (sets it to null) and refreshes it (by
174
- * calling invalidate()).
175
- */
176
- clear() {
177
- this.mData = null;
178
- this.offsetsCalculated = false;
179
- this.indicesToHighlight = null;
180
- if (this.chartTouchListener) {
181
- this.chartTouchListener.lastHighlighted = null;
182
- }
183
- this.invalidate();
184
- }
185
- /**
186
- * Removes all DataSets (and thereby Entries) from the chart. Does not set the data object to null. Also refreshes the
187
- * chart by calling invalidate().
188
- */
189
- clearValues() {
190
- this.mData.clearValues();
191
- this.invalidate();
192
- }
193
- /**
194
- * Returns true if the chart is empty (meaning it's data object is either
195
- * null or contains no entries).
196
- */
197
- get length() {
198
- if (!this.mData)
199
- return true;
200
- else {
201
- if (this.mData.entryCount <= 0)
202
- return true;
203
- else
204
- return false;
205
- }
206
- }
207
- /**
208
- * Calculates the required number of digits for the values that might be
209
- * drawn in the chart (if enabled), and creates the default-value-formatter
210
- */
211
- setupDefaultFormatter(min, max) {
212
- let reference = 0;
213
- if (!this.mData || this.mData.entryCount < 2) {
214
- reference = Math.max(Math.abs(min), Math.abs(max));
215
- }
216
- else {
217
- reference = Math.abs(max - min);
218
- }
219
- const digits = Utils.getDecimals(reference);
220
- // setup the formatter with a new number of digits
221
- this.defaultValueFormatter.setup(digits);
222
- }
223
- onDraw(canvas) {
224
- super.onDraw(canvas);
225
- if (!this.mData) {
226
- const hasText = this.noDataText && this.noDataText.length > 0;
227
- if (hasText) {
228
- const c = this.center;
229
- canvas.drawText(this.noDataText, c.x, c.y, this.infoPaint);
230
- }
231
- }
232
- this.notify({ eventName: 'postDraw', object: this, canvas });
233
- }
234
- /**
235
- * Draws the description text in the bottom right corner of the chart (per default)
236
- */
237
- drawDescription(c) {
238
- // check if description should be drawn
239
- if (this.mDescription?.enabled) {
240
- const position = this.mDescription.position;
241
- const paint = Utils.getTempPaint();
242
- paint.setFont(this.mDescription.typeface);
243
- paint.setColor(this.mDescription.textColor);
244
- paint.setTextAlign(this.mDescription.textAlign);
245
- let x, y;
246
- const vph = this.viewPortHandler;
247
- // if no position specified, draw on default position
248
- if (!position) {
249
- x = vph.chartWidth - vph.offsetRight - this.mDescription.xOffset;
250
- y = vph.chartHeight - vph.offsetBottom - this.mDescription.yOffset;
251
- }
252
- else {
253
- x = position.x;
254
- y = position.y;
255
- }
256
- c.drawText(this.mDescription.text, x, y, paint);
257
- }
258
- }
259
- /**
260
- * Returns the array of currently highlighted values. This might a null or
261
- * empty array if nothing is highlighted.
262
- */
263
- get highlighted() {
264
- return this.indicesToHighlight;
265
- }
266
- /**
267
- * Returns true if there are values to highlight, false if there are no
268
- * values to highlight. Checks if the highlight array is null, has a length
269
- * of zero or if the first object is null.
270
- *
271
- */
272
- get hasValuesToHighlight() {
273
- return this.indicesToHighlight?.[0] !== undefined;
274
- }
275
- /**
276
- * Sets the last highlighted value for the touchlistener.
277
- *
278
- * @param highs
279
- */
280
- set lastHighlighted(highs) {
281
- if (!this.chartTouchListener) {
282
- return;
283
- }
284
- if (highs?.[0] === undefined) {
285
- this.chartTouchListener.lastHighlighted = null;
286
- }
287
- else {
288
- this.chartTouchListener.lastHighlighted = highs[0];
289
- }
290
- }
291
- /**
292
- * Highlights the values at the given indices in the given DataSets. Provide
293
- * null or an empty array to undo all highlighting. This should be used to
294
- * programmatically highlight values.
295
- * This method *will not* call the listener.
296
- *
297
- * @param highs
298
- */
299
- highlightValues(highs) {
300
- // set the indices to highlight
301
- this.indicesToHighlight = highs;
302
- this.lastHighlighted = highs;
303
- // redraw the chart
304
- this.noComputeAutoScaleOnNextDraw = true;
305
- this.noComputeAxisOnNextDraw = true;
306
- this.invalidate();
307
- }
308
- // /**
309
- // * Highlights any y-value at the given x-value in the given DataSet.
310
- // * Provide -1 as the dataSetIndex to undo all highlighting.
311
- // * This method will call the listener.
312
- // * @param x The x-value to highlight
313
- // * @param dataSetIndex The dataset index to search in
314
- // */
315
- // public highlightValue( x, dataSetIndex) {
316
- // this.highlightValue(x, dataSetIndex, true);
317
- // }
318
- // /**
319
- // * Highlights the value at the given x-value and y-value in the given DataSet.
320
- // * Provide -1 as the dataSetIndex to undo all highlighting.
321
- // * This method will call the listener.
322
- // * @param x The x-value to highlight
323
- // * @param y The y-value to highlight. Supply `NaN` for "any"
324
- // * @param dataSetIndex The dataset index to search in
325
- // */
326
- // public highlightValue(x, y, dataSetIndex) {
327
- // this.highlightValue(x, y, dataSetIndex, true);
328
- // }
329
- // /**
330
- // * Highlights any y-value at the given x-value in the given DataSet.
331
- // * Provide -1 as the dataSetIndex to undo all highlighting.
332
- // * @param x The x-value to highlight
333
- // * @param dataSetIndex The dataset index to search in
334
- // * @param callListener Should the listener be called for this change
335
- // */
336
- // public highlightValue(x, dataSetIndex, callListener = true) {
337
- // this.highlightValue(x, NaN, dataSetIndex, callListener);
338
- // }
339
- /**
340
- * Highlights any y-value at the given x-value in the given DataSet.
341
- * Provide -1 as the dataSetIndex to undo all highlighting.
342
- * @param x The x-value to highlight
343
- * @param y The y-value to highlight. Supply `NaN` for "any"
344
- * @param dataSetIndex The dataset index to search in
345
- * @param callListener Should the listener be called for this change
346
- */
347
- highlightValue(x, y, dataSetIndex, callListener = false) {
348
- if (dataSetIndex < 0 || dataSetIndex >= this.mData.dataSetCount) {
349
- this.highlight(null, callListener);
350
- }
351
- else {
352
- this.highlight({ x, y, dataSetIndex }, callListener);
353
- }
354
- }
355
- /**
356
- * Highlights the value selected by touch gesture. Unlike
357
- * highlightValues(...), this generates a callback to the
358
- * OnChartValueSelectedListener.
359
- *
360
- * @param high - the highlight object
361
- * @param callListener - call the listener
362
- */
363
- highlight(high, callListener = false) {
364
- let e = null;
365
- let highlight = Array.isArray(high) ? high[0] : high;
366
- if (!high) {
367
- this.indicesToHighlight = null;
368
- }
369
- else {
370
- e = this.mData.getEntryForHighlight(highlight);
371
- if (!e) {
372
- this.indicesToHighlight = null;
373
- highlight = null;
374
- }
375
- else {
376
- highlight.entry = e;
377
- // set the indices to highlight
378
- this.indicesToHighlight = [highlight];
379
- }
380
- }
381
- this.lastHighlighted = this.indicesToHighlight;
382
- if (callListener) {
383
- this.notify({ eventName: 'highlight', object: this, entry: e, highlight, highlights: Array.isArray(high) ? high : [highlight] });
384
- }
385
- // redraw the chart
386
- this.noComputeAutoScaleOnNextDraw = true;
387
- this.noComputeAxisOnNextDraw = true;
388
- this.invalidate();
389
- }
390
- /**
391
- * Highlights the value selected by touch gesture. Unlike
392
- * highlightValues(...), this generates a callback to the
393
- * OnChartValueSelectedListener.
394
- *
395
- * @param high - the highlight object
396
- * @param callListener - call the listener
397
- */
398
- highlights(highs, callListener = false) {
399
- const e = null;
400
- if (highs.length === 0) {
401
- this.indicesToHighlight = null;
402
- }
403
- else {
404
- highs = highs
405
- .map((h) => {
406
- if (!h.entry) {
407
- h.entry = this.mData.getEntryForHighlight(h);
408
- }
409
- return h;
410
- })
411
- .filter((h) => !!h.entry);
412
- this.indicesToHighlight = highs.length ? highs : null;
413
- }
414
- this.lastHighlighted = this.indicesToHighlight;
415
- if (callListener) {
416
- this.notify({ eventName: 'highlight', object: this, entry: highs?.[0]?.entry, highlight: highs?.[0], highlights: highs });
417
- }
418
- // redraw the chart
419
- this.noComputeAutoScaleOnNextDraw = true;
420
- this.noComputeAxisOnNextDraw = true;
421
- this.invalidate();
422
- }
423
- /**
424
- * Returns the Highlights (contains x-index and DataSet index) of the
425
- * selected value at the given touch polet inside the Line-, Scatter-, or
426
- * CandleStick-Chart.
427
- *
428
- * @param x
429
- * @param y
430
- * @return
431
- */
432
- getHighlightsByTouchPoint(x, y) {
433
- return this.highlighter.getHighlight(x, y);
434
- }
435
- /**
436
- * Returns the Highlight object (contains x-index and DataSet index) of the
437
- * selected value at the given touch polet inside the Line-, Scatter-, or
438
- * CandleStick-Chart.
439
- *
440
- * @param x
441
- * @param y
442
- * @return
443
- */
444
- getHighlightByTouchPoint(x, y) {
445
- return this.getHighlightsByTouchPoint(x, y)?.[0];
446
- }
447
- /**
448
- * Returns the Highlight object (contains x-index and DataSet index) of the
449
- * selected value at the given touch polet inside the Line-, Scatter-, or
450
- * CandleStick-Chart.
451
- *
452
- * @param x
453
- * @param y
454
- * @return
455
- */
456
- getHighlightByXValue(xValue) {
457
- if (!this.mData) {
458
- return null;
459
- }
460
- else {
461
- return this.highlighter.getHighlightsAtXValue(xValue);
462
- }
463
- }
464
- /**
465
- * draws all MarkerViews on the highlighted positions
466
- */
467
- drawMarkers(canvas) {
468
- // if there is no marker view or drawing marker is disabled
469
- if (!this.marker || !this.drawMarkersEnabled || !this.hasValuesToHighlight)
470
- return;
471
- for (let i = 0; i < this.indicesToHighlight.length; i++) {
472
- const highlight = this.indicesToHighlight[i];
473
- const set = this.mData.getDataSetByIndex(highlight.dataSetIndex);
474
- const e = highlight.entry || this.mData.getEntryForHighlight(highlight);
475
- const entryIndex = set.getEntryIndex(e);
476
- // make sure entry not null
477
- if (!e || entryIndex > set.entryCount * this.animator.phaseX)
478
- continue;
479
- const pos = this.getMarkerPosition(highlight);
480
- // check bounds
481
- if (!this.viewPortHandler.isInBounds(pos[0], pos[1]))
482
- continue;
483
- // callbacks to update the content
484
- this.marker.refreshContent(e, highlight);
485
- // draw the marker
486
- this.marker.draw(canvas, pos[0], pos[1]);
487
- }
488
- }
489
- /**
490
- * Returns the actual position in pixels of the MarkerView for the given
491
- * Highlight object.
492
- *
493
- * @param high
494
- * @return
495
- */
496
- getMarkerPosition(high) {
497
- return [high.drawX, high.drawY];
498
- }
499
- /**
500
- * ################ ################ ################ ################
501
- * ANIMATIONS ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
502
- */
503
- /** CODE BELOW THIS RELATED TO ANIMATION */
504
- /**
505
- * Returns the animator responsible for animating chart values.
506
- */
507
- get description() {
508
- if (!this.mDescription) {
509
- this.mDescription = new Description();
510
- }
511
- return this.mDescription;
512
- }
513
- /**
514
- * ################ ################ ################ ################
515
- * ANIMATIONS ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
516
- */
517
- /** CODE BELOW FOR PROVIDING EASING FUNCTIONS */
518
- /**
519
- * Animates the drawing / rendering of the chart on both x- and y-axis with
520
- * the specified animation time. If animate(...) is called, no further
521
- * calling of invalidate() is necessary to refresh the chart. ANIMATIONS
522
- * ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
523
- *
524
- * @param durationMillisX
525
- * @param durationMillisY
526
- * @param easingX a custom easing function to be used on the animation phase
527
- * @param easingY a custom easing function to be used on the animation phase
528
- */
529
- animateXY(durationMillisX, durationMillisY, easingX, easingY) {
530
- this.animator.animateXY(durationMillisX, durationMillisY, easingX, easingY);
531
- }
532
- /**
533
- * Animates the rendering of the chart on the x-axis with the specified
534
- * animation time. If animate(...) is called, no further calling of
535
- * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
536
- * API LEVEL 11 (Android 3.0.x) AND HIGHER.
537
- *
538
- * @param durationMillis
539
- * @param easing a custom easing function to be used on the animation phase
540
- */
541
- animateX(durationMillis, easing) {
542
- this.animator.animateX(durationMillis, easing);
543
- }
544
- /**
545
- * Animates the rendering of the chart on the y-axis with the specified
546
- * animation time. If animate(...) is called, no further calling of
547
- * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
548
- * API LEVEL 11 (Android 3.0.x) AND HIGHER.
549
- *
550
- * @param durationMillis
551
- * @param easing a custom easing function to be used on the animation phase
552
- */
553
- animateY(durationMillis, easing) {
554
- this.animator.animateY(durationMillis, easing);
555
- }
556
- /**
557
- * ################ ################ ################ ################
558
- */
559
- /** BELOW THIS ONLY GETTERS AND SETTERS */
560
- /**
561
- * returns the current y-max value across all DataSets
562
- */
563
- get yMax() {
564
- return this.mData.yMax;
565
- }
566
- /**
567
- * returns the current y-min value across all DataSets
568
- */
569
- get yMin() {
570
- return this.mData.yMin;
571
- }
572
- get xChartMax() {
573
- return this.xAxis.axisMaximum;
574
- }
575
- get xChartMin() {
576
- return this.xAxis.axisMinimum;
577
- }
578
- get xRange() {
579
- return this.xAxis.axisRange;
580
- }
581
- /**
582
- * Returns a recyclable MPPointF instance.
583
- * Returns the center polet of the chart (the whole View) in pixels.
584
- */
585
- get center() {
586
- return { x: this.viewPortHandler.chartWidth / 2, y: this.viewPortHandler.chartHeight / 2 };
587
- }
588
- /**
589
- * Returns a recyclable MPPointF instance.
590
- * Returns the center of the chart taking offsets under consideration.
591
- * (returns the center of the content rectangle)
592
- */
593
- get centerOffsets() {
594
- return this.viewPortHandler.contentCenter;
595
- }
596
- /**
597
- * Sets extra offsets (around the chart view) to be appended to the
598
- * auto-calculated offsets.
599
- *
600
- * @param left
601
- * @param top
602
- * @param right
603
- * @param bottom
604
- */
605
- setExtraOffsets(left, top, right, bottom) {
606
- this.extraLeftOffset = left;
607
- this.extraTopOffset = top;
608
- this.extraRightOffset = right;
609
- this.extraBottomOffset = bottom;
610
- }
611
- /**
612
- * Sets extra offsets (around the chart view) to be appended to the
613
- * auto-calculated offsets.
614
- *
615
- * @param left
616
- * @param top
617
- * @param right
618
- * @param bottom
619
- */
620
- set extraOffsets(value) {
621
- this.extraLeftOffset = value[0];
622
- this.extraTopOffset = value[1];
623
- this.extraRightOffset = value[2];
624
- this.extraBottomOffset = value[3];
625
- }
626
- /**
627
- * Sets the color of the no data text.
628
- *
629
- * @param color
630
- */
631
- set noDataTextColor(color) {
632
- this.infoPaint.setColor(color);
633
- }
634
- /**
635
- * Sets the typeface to be used for the no data text.
636
- */
637
- set noDataTextTypeface(tf) {
638
- this.infoPaint.setTypeface(tf);
639
- }
640
- /**
641
- * Returns the Legend object of the chart. This method can be used to get an
642
- * instance of the legend in order to customize the automatically generated
643
- * Legend.
644
- */
645
- get legend() {
646
- if (!this.mLegend) {
647
- this.mLegend = new Legend();
648
- this.legendRenderer = new LegendRenderer(this.viewPortHandler, this.mLegend);
649
- }
650
- return this.mLegend;
651
- }
652
- /**
653
- * Returns the rectangle that defines the borders of the chart-value surface
654
- * (into which the actual values are drawn).
655
- */
656
- get contentRect() {
657
- return this.viewPortHandler.contentRect;
658
- }
659
- /**
660
- * Returns a recyclable MPPointF instance.
661
- */
662
- get centerOfView() {
663
- return this.center;
664
- }
665
- /**
666
- * Returns the bitmap that represents the chart.
667
- */
668
- get chartBitmap() {
669
- //Define a bitmap with the same size as the view
670
- const canvas = new Canvas(this.getMeasuredWidth(), this.getMeasuredHeight());
671
- canvas.drawColor(this.backgroundColor);
672
- // draw the view on the canvas
673
- this.onDraw(canvas);
674
- // return the bitmap
675
- return canvas.getImage();
676
- }
677
- removeViewportJob(job) {
678
- const index = this.jobs.indexOf(job);
679
- if (index >= 0) {
680
- this.jobs.splice(index, 1);
681
- }
682
- }
683
- clearAllViewportJobs() {
684
- this.jobs = [];
685
- }
686
- /**
687
- * Either posts a job immediately if the chart has already setup it's
688
- * dimensions or adds the job to the execution queue.
689
- *
690
- * @param job
691
- */
692
- addViewportJob(job) {
693
- if (this.viewPortHandler.hasChartDimens) {
694
- setTimeout(() => {
695
- job.run();
696
- }, 0);
697
- }
698
- else {
699
- this.jobs.push(job);
700
- }
701
- }
702
- /**
703
- * Returns all jobs that are scheduled to be executed after
704
- * onSizeChanged(...).
705
- */
706
- getJobs() {
707
- return this.jobs;
708
- }
709
- onSetWidthHeight(w, h) {
710
- const needsDataSetChanged = !this.viewPortHandler.hasChartDimens;
711
- if (Trace.isEnabled()) {
712
- CLog(CLogTypes.info, LOG_TAG, 'onSetWidthHeight', w, h, needsDataSetChanged);
713
- }
714
- if (w > 0 && h > 0) {
715
- if (Trace.isEnabled()) {
716
- CLog(CLogTypes.info, LOG_TAG, 'Setting chart dimens, width: ' + w + ', height: ' + h);
717
- }
718
- this.viewPortHandler.setChartDimens(w, h);
719
- }
720
- // This may cause the chart view to mutate properties affecting the view port --
721
- // lets do this before we try to run any pending jobs on the view port itself
722
- // this.notifyDataSetChanged();
723
- if (needsDataSetChanged) {
724
- this.notifyDataSetChanged();
725
- }
726
- else {
727
- this.offsetsCalculated = false;
728
- this.invalidate(); // needs chart size
729
- }
730
- for (const r of this.jobs) {
731
- setTimeout(() => {
732
- r.run();
733
- }, 0);
734
- }
735
- this.jobs = [];
736
- this.notify({ eventName: 'sizeChanged', object: this });
737
- }
738
- onLayout(left, top, right, bottom) {
739
- super.onLayout(left, top, right, bottom);
740
- if (__IOS__) {
741
- this.onSetWidthHeight(Math.round(NUtils.layout.toDeviceIndependentPixels(right - left)), Math.round(NUtils.layout.toDeviceIndependentPixels(bottom - top)));
742
- }
743
- }
744
- onSizeChanged(w, h, oldw, oldh) {
745
- super.onSizeChanged(w, h, oldw, oldh);
746
- if (__ANDROID__) {
747
- this.onSetWidthHeight(Math.round(w), Math.round(h));
748
- }
749
- }
750
- /**
751
- * Setting this to true will set the layer-type HARDWARE for the view, false
752
- * will set layer-type SOFTWARE.
753
- *
754
- * @param enabled
755
- */
756
- set hardwareAccelerationEnabled(enabled) {
757
- this.hardwareAccelerated = enabled;
758
- }
759
- /**
760
- * disables intercept touchevents
761
- */
762
- disableScroll() {
763
- if (__ANDROID__) {
764
- const parent = this.nativeViewProtected?.getParent();
765
- parent?.requestDisallowInterceptTouchEvent(true);
766
- }
767
- }
768
- /**
769
- * enables intercept touchevents
770
- */
771
- enableScroll() {
772
- if (__ANDROID__) {
773
- const parent = this.nativeViewProtected?.getParent();
774
- parent?.requestDisallowInterceptTouchEvent(false);
775
- }
776
- }
777
- }
778
- //# sourceMappingURL=Chart.js.map