@nativescript-community/ui-chart 2.0.5 → 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
@@ -1,1253 +0,0 @@
1
- import { Matrix } from '@nativescript-community/ui-canvas';
2
- import { Observable, Trace, profile } from '@nativescript/core';
3
- import { getEventOrGestureName } from '@nativescript/core/ui/core/bindable';
4
- import { GestureTypes } from '@nativescript/core/ui/gestures';
5
- import { LegendHorizontalAlignment, LegendOrientation, LegendVerticalAlignment } from '../components/Legend';
6
- import { XAxisPosition } from '../components/XAxis';
7
- import { AxisDependency, YAxis } from '../components/YAxis';
8
- import { ChartHighlighter } from '../highlight/ChartHighlighter';
9
- import { AnimatedMoveViewJob } from '../jobs/AnimatedMoveViewJob';
10
- import { AnimatedZoomJob } from '../jobs/AnimatedZoomJob';
11
- import { MoveViewJob } from '../jobs/MoveViewJob';
12
- import { ZoomJob } from '../jobs/ZoomJob';
13
- import { BarLineChartTouchListener } from '../listener/BarLineChartTouchListener';
14
- import { XAxisRenderer } from '../renderer/XAxisRenderer';
15
- import { YAxisRenderer } from '../renderer/YAxisRenderer';
16
- import { Transformer } from '../utils/Transformer';
17
- import { CLog, CLogTypes, Utils } from '../utils/Utils';
18
- import { Chart } from './Chart';
19
- const LOG_TAG = 'BarLineChartBase';
20
- export class BarLineChartBase extends Chart {
21
- constructor() {
22
- super(...arguments);
23
- /**
24
- * the maximum number of entries to which values will be drawn
25
- * (entry numbers greater than this value will cause value-labels to disappear)
26
- */
27
- this.maxVisibleValueCount = 100;
28
- /**
29
- * flag that indicates if auto scaling on the y axis is enabled
30
- */
31
- this.autoScaleMinMaxEnabled = true;
32
- /**
33
- * flag that indicates zoomed pan gesture should only work with 2 pointers
34
- */
35
- this.zoomedPanWith2Pointers = false;
36
- this.clipValuesToContent = true;
37
- this.clipDataToContent = true;
38
- this.drawHighlight = true;
39
- /**
40
- * Sets the minimum offset (padding) around the chart, defaults to 15
41
- */
42
- this.minOffset = 15;
43
- // for performance tracking
44
- this.totalTime = 0;
45
- this.drawCycles = 0;
46
- // public onTouchEvent( event) {
47
- // super.onTouchEvent(event);
48
- // if (mChartTouchListener == null || this.mData == null)
49
- // return false;
50
- // // check if touch gestures are enabled
51
- // if (!mTouchEnabled)
52
- // return false;
53
- // else
54
- // return this.chartTouchListener.onTouch(this, event);
55
- // }
56
- // public computeScroll() {
57
- // if (this.chartTouchListener instanceof BarLineChartTouchListener)
58
- // (this.chartTouchListener).computeScroll();
59
- // }
60
- /**
61
- * ################ ################ ################ ################
62
- */
63
- /**
64
- * CODE BELOW THIS RELATED TO SCALING AND GESTURES AND MODIFICATION OF THE
65
- * VIEWPORT
66
- */
67
- this.mZoomMatrixBuffer = new Matrix();
68
- this.mFitScreenMatrixBuffer = new Matrix();
69
- /**
70
- * wheter to highlight drawing will be clipped to contentRect,
71
- * otherwise they can bleed outside the content rect.
72
- */
73
- this.clipHighlightToContent = true;
74
- /**
75
- * buffer for storing lowest visible x point
76
- */
77
- this.posForGetLowestVisibleX = { x: 0, y: 0 };
78
- /**
79
- * buffer for storing highest visible x point
80
- */
81
- this.posForGetHighestVisibleX = { x: 0, y: 0 };
82
- this.mOnSizeChangedBuffer = Utils.createArrayBuffer(2);
83
- }
84
- // /** the approximator object used for data filtering */
85
- // private Approximator this.mApproximator;
86
- init() {
87
- super.init();
88
- this.mAxisLeft = new YAxis(AxisDependency.LEFT, new WeakRef(this));
89
- this.leftAxisTransformer = new Transformer(this.viewPortHandler);
90
- this.rendererLeftYAxis = new YAxisRenderer(this.viewPortHandler, this.mAxisLeft, this.leftAxisTransformer);
91
- this.rendererXAxis = new XAxisRenderer(this.viewPortHandler, this.xAxis, this.leftAxisTransformer);
92
- this.highlighter = new ChartHighlighter(this);
93
- }
94
- get gridBackgroundPaint() {
95
- if (!this.mGridBackgroundPaint) {
96
- this.mGridBackgroundPaint = Utils.getTemplatePaint('black-fill');
97
- this.mGridBackgroundPaint.setColor('#F0F0F0'); // light
98
- }
99
- return this.mGridBackgroundPaint;
100
- }
101
- get borderPaint() {
102
- if (!this.mBorderPaint) {
103
- this.mBorderPaint = Utils.getTemplatePaint('black-stroke');
104
- }
105
- return this.mBorderPaint;
106
- }
107
- getOrCreateBarTouchListener() {
108
- if (!this.chartTouchListener) {
109
- this.chartTouchListener = new BarLineChartTouchListener(this, this.viewPortHandler.getMatrixTouch(), 3);
110
- if (!!this.nativeViewProtected) {
111
- this.chartTouchListener.init();
112
- }
113
- }
114
- return this.chartTouchListener;
115
- }
116
- onDraw(canvas) {
117
- const startTime = Date.now();
118
- super.onDraw(canvas);
119
- const noComputeAutoScaleOnNextDraw = this.noComputeAutoScaleOnNextDraw;
120
- const noComputeAxisOnNextDraw = this.noComputeAxisOnNextDraw;
121
- this.noComputeAxisOnNextDraw = false;
122
- this.noComputeAutoScaleOnNextDraw = false;
123
- if (!this.mData)
124
- return;
125
- // execute all drawing commands
126
- this.drawGridBackground(canvas);
127
- const xAxis = this.xAxis;
128
- const axisLeft = this.mAxisLeft;
129
- const axisRight = this.mAxisRight;
130
- // the order is important:
131
- // * computeAxis needs axis.axisMinimum set in autoScale
132
- // * calculateOffsets needs computeAxis because it needs axis longestLabel
133
- if (!noComputeAutoScaleOnNextDraw && this.autoScaleMinMaxEnabled) {
134
- this.autoScale();
135
- }
136
- if (!noComputeAxisOnNextDraw) {
137
- this.rendererLeftYAxis?.computeAxis(axisLeft.axisMinimum, axisLeft.axisMaximum, axisLeft.inverted);
138
- this.rendererRightYAxis?.computeAxis(axisRight.axisMinimum, axisRight.axisMaximum, axisRight.inverted);
139
- this.rendererXAxis?.computeAxis(this.xAxis.axisMinimum, this.xAxis.axisMaximum, false);
140
- }
141
- if (!this.offsetsCalculated) {
142
- this.calculateOffsets(false);
143
- this.offsetsCalculated = true;
144
- }
145
- if (xAxis.drawGridLinesBehindData)
146
- this.rendererXAxis.renderGridLines(canvas);
147
- if (axisLeft.drawGridLinesBehindData)
148
- this.rendererLeftYAxis.renderGridLines(canvas);
149
- if (axisRight?.drawGridLinesBehindData)
150
- this.rendererRightYAxis.renderGridLines(canvas);
151
- if (xAxis.drawLimitLinesBehindData)
152
- this.rendererXAxis.renderLimitLines(canvas);
153
- if (axisLeft.drawLimitLinesBehindData)
154
- this.rendererLeftYAxis.renderLimitLines(canvas);
155
- if (axisRight?.drawLimitLinesBehindData)
156
- this.rendererRightYAxis.renderLimitLines(canvas);
157
- this.rendererXAxis.renderAxisLine(canvas);
158
- this.rendererLeftYAxis.renderAxisLine(canvas);
159
- this.rendererRightYAxis?.renderAxisLine(canvas);
160
- if (xAxis.drawLabelsBehindData)
161
- this.rendererXAxis.renderAxisLabels(canvas);
162
- if (axisLeft.drawLabelsBehindData)
163
- this.rendererLeftYAxis.renderAxisLabels(canvas);
164
- if (axisRight?.drawLabelsBehindData)
165
- this.rendererRightYAxis.renderAxisLabels(canvas);
166
- // make sure the data cannot be drawn outside the content-rect
167
- if (this.clipDataToContent) {
168
- canvas.save();
169
- canvas.clipRect(this.viewPortHandler.contentRect);
170
- this.renderer.drawData(canvas);
171
- }
172
- else {
173
- this.renderer.drawData(canvas);
174
- }
175
- if (!xAxis.drawGridLinesBehindData)
176
- this.rendererXAxis.renderGridLines(canvas);
177
- if (!axisLeft.drawGridLinesBehindData)
178
- this.rendererLeftYAxis.renderGridLines(canvas);
179
- if (axisRight?.drawGridLinesBehindData === false)
180
- this.rendererRightYAxis.renderGridLines(canvas);
181
- if (!this.clipHighlightToContent && this.clipDataToContent) {
182
- // restore before drawing highlight
183
- canvas.restore();
184
- }
185
- if (this.hasValuesToHighlight && this.drawHighlight) {
186
- this.renderer.drawHighlighted(canvas, this.indicesToHighlight, this.drawHighlight);
187
- }
188
- // Removes clipping rectangle
189
- if (this.clipHighlightToContent && this.clipDataToContent) {
190
- canvas.restore();
191
- }
192
- this.renderer.drawExtras(canvas);
193
- if (!xAxis.drawLimitLinesBehindData)
194
- this.rendererXAxis.renderLimitLines(canvas);
195
- if (!axisLeft.drawLimitLinesBehindData)
196
- this.rendererLeftYAxis.renderLimitLines(canvas);
197
- if (axisRight?.drawLimitLinesBehindData === false)
198
- this.rendererRightYAxis.renderLimitLines(canvas);
199
- if (!xAxis.drawLabelsBehindData)
200
- this.rendererXAxis.renderAxisLabels(canvas);
201
- if (!axisLeft.drawLabelsBehindData)
202
- this.rendererLeftYAxis.renderAxisLabels(canvas);
203
- if (axisRight?.drawLabelsBehindData === false)
204
- this.rendererRightYAxis.renderAxisLabels(canvas);
205
- if (this.clipValuesToContent) {
206
- canvas.save();
207
- canvas.clipRect(this.viewPortHandler.contentRect);
208
- this.renderer.drawValues(canvas);
209
- canvas.restore();
210
- }
211
- else {
212
- this.renderer.drawValues(canvas);
213
- }
214
- this.legendRenderer?.renderLegend(canvas);
215
- this.drawDescription(canvas);
216
- this.drawMarkers(canvas);
217
- this.notify({ eventName: 'postDraw', canvas, object: this });
218
- if (Trace.isEnabled()) {
219
- const drawtime = Date.now() - startTime;
220
- this.totalTime += drawtime;
221
- this.drawCycles += 1;
222
- const average = this.totalTime / this.drawCycles;
223
- CLog(CLogTypes.log, this.constructor.name, 'Drawtime: ' + drawtime + ' ms, average: ' + average + ' ms, cycles: ' + this.drawCycles);
224
- }
225
- }
226
- /**
227
- * RESET PERFORMANCE TRACKING FIELDS
228
- */
229
- resetTracking() {
230
- this.totalTime = 0;
231
- this.drawCycles = 0;
232
- }
233
- prepareValuePxMatrix() {
234
- if (Trace.isEnabled()) {
235
- CLog(CLogTypes.info, LOG_TAG, 'Preparing Value-Px Matrix, xmin: ' + this.xAxis.axisMinimum + ', xmax: ' + this.xAxis.axisMaximum + ', xdelta: ' + this.xAxis.axisRange);
236
- }
237
- if (this.mAxisRight?.enabled) {
238
- this.rightAxisTransformer.prepareMatrixValuePx(this.xAxis.axisMinimum, this.xAxis.axisRange, this.mAxisRight.axisRange, this.mAxisRight.axisMinimum);
239
- }
240
- if (this.mAxisLeft?.enabled || this.xAxis.enabled) {
241
- this.leftAxisTransformer.prepareMatrixValuePx(this.xAxis.axisMinimum, this.xAxis.axisRange, this.mAxisLeft.axisRange, this.mAxisLeft.axisMinimum);
242
- }
243
- }
244
- prepareOffsetMatrix() {
245
- if (this.mAxisRight?.enabled) {
246
- this.rightAxisTransformer.prepareMatrixOffset(this.mAxisRight.inverted);
247
- }
248
- if (this.mAxisLeft?.enabled || this.xAxis.enabled) {
249
- this.leftAxisTransformer.prepareMatrixOffset(this.mAxisLeft.inverted);
250
- }
251
- }
252
- notifyDataSetChanged() {
253
- if (!this.mData || this.mData.dataSetCount === 0) {
254
- if (Trace.isEnabled()) {
255
- CLog(CLogTypes.info, LOG_TAG, 'Preparing... DATA NOT SET.');
256
- }
257
- return;
258
- }
259
- else if (!this.viewPortHandler.hasChartDimens) {
260
- if (Trace.isEnabled()) {
261
- CLog(CLogTypes.info, LOG_TAG, 'Preparing... NOT SIZED YET.');
262
- }
263
- return;
264
- }
265
- else {
266
- if (Trace.isEnabled()) {
267
- CLog(CLogTypes.info, LOG_TAG, 'Preparing...');
268
- }
269
- }
270
- this.renderer?.initBuffers();
271
- this.calcMinMax();
272
- if (this.mAxisLeft?.enabled) {
273
- this.rendererLeftYAxis.computeAxis(this.mAxisLeft.axisMinimum, this.mAxisLeft.axisMaximum, this.mAxisLeft.inverted);
274
- }
275
- if (this.mAxisRight?.enabled) {
276
- this.rendererRightYAxis.computeAxis(this.mAxisRight.axisMinimum, this.mAxisRight.axisMaximum, this.mAxisRight.inverted);
277
- }
278
- if (this.xAxis.enabled) {
279
- this.rendererXAxis.computeAxis(this.xAxis.axisMinimum, this.xAxis.axisMaximum, false);
280
- }
281
- if (this.mLegend?.enabled) {
282
- this.legendRenderer.computeLegend(this.mData);
283
- }
284
- // offsets will be calculated on draw
285
- this.offsetsCalculated = false;
286
- this.invalidate();
287
- }
288
- /**
289
- * Performs auto scaling of the axis by recalculating the minimum and maximum y-values based on the entries currently in view.
290
- */
291
- autoScale() {
292
- const fromX = this.lowestVisibleX;
293
- const toX = this.highestVisibleX;
294
- this.mData.calcMinMaxYRange(fromX, toX);
295
- this.xAxis.calculate(this.mData.xMin, this.mData.xMax);
296
- // calculate axis range (min / max) according to provided data
297
- if (this.mAxisLeft?.enabled) {
298
- this.mAxisLeft.calculate(this.mData.getYMin(AxisDependency.LEFT), this.mData.getYMax(AxisDependency.LEFT));
299
- }
300
- if (this.mAxisRight?.enabled) {
301
- this.mAxisRight.calculate(this.mData.getYMin(AxisDependency.RIGHT), this.mData.getYMax(AxisDependency.RIGHT));
302
- }
303
- }
304
- calcMinMax() {
305
- this.xAxis.calculate(this.mData.xMin, this.mData.xMax);
306
- // calculate axis range (min / max) according to provided data
307
- if (this.mAxisLeft?.enabled) {
308
- this.mAxisLeft.calculate(this.mData.getYMin(AxisDependency.LEFT), this.mData.getYMax(AxisDependency.LEFT));
309
- }
310
- if (this.mAxisRight?.enabled) {
311
- this.mAxisRight.calculate(this.mData.getYMin(AxisDependency.RIGHT), this.mData.getYMax(AxisDependency.RIGHT));
312
- }
313
- }
314
- calculateLegendOffsets(offsets) {
315
- offsets.left = 0;
316
- offsets.right = 0;
317
- offsets.top = 0;
318
- offsets.bottom = 0;
319
- // setup offsets for legend
320
- if (this.mLegend?.enabled && !this.mLegend.drawInside) {
321
- switch (this.mLegend.orientation) {
322
- case LegendOrientation.VERTICAL:
323
- switch (this.mLegend.horizontalAlignment) {
324
- case LegendHorizontalAlignment.LEFT:
325
- offsets.left += Math.min(this.mLegend.mNeededWidth, this.viewPortHandler.chartWidth * this.mLegend.maxSizePercent) + this.mLegend.xOffset;
326
- break;
327
- case LegendHorizontalAlignment.RIGHT:
328
- offsets.right += Math.min(this.mLegend.mNeededWidth, this.viewPortHandler.chartWidth * this.mLegend.maxSizePercent) + this.mLegend.xOffset;
329
- break;
330
- case LegendHorizontalAlignment.CENTER:
331
- switch (this.mLegend.verticalAlignment) {
332
- case LegendVerticalAlignment.TOP:
333
- offsets.top += Math.min(this.mLegend.mNeededHeight, this.viewPortHandler.chartHeight * this.mLegend.maxSizePercent) + this.mLegend.yOffset;
334
- break;
335
- case LegendVerticalAlignment.BOTTOM:
336
- offsets.bottom += Math.min(this.mLegend.mNeededHeight, this.viewPortHandler.chartHeight * this.mLegend.maxSizePercent) + this.mLegend.yOffset;
337
- break;
338
- default:
339
- break;
340
- }
341
- }
342
- break;
343
- case LegendOrientation.HORIZONTAL:
344
- switch (this.mLegend.verticalAlignment) {
345
- case LegendVerticalAlignment.TOP:
346
- offsets.top += Math.min(this.mLegend.mNeededHeight, this.viewPortHandler.chartHeight * this.mLegend.maxSizePercent) + this.mLegend.yOffset;
347
- break;
348
- case LegendVerticalAlignment.BOTTOM:
349
- offsets.bottom += Math.min(this.mLegend.mNeededHeight, this.viewPortHandler.chartHeight * this.mLegend.maxSizePercent) + this.mLegend.yOffset;
350
- break;
351
- default:
352
- break;
353
- }
354
- break;
355
- }
356
- }
357
- }
358
- calculateOffsets(force = true) {
359
- if (this.offsetsCalculated && !force) {
360
- return;
361
- }
362
- this.offsetsCalculated = true;
363
- if (!this.mCustomViewPortEnabled) {
364
- const offsetBuffer = Utils.getTempRectF();
365
- this.calculateLegendOffsets(offsetBuffer);
366
- let offsetLeft = offsetBuffer.left;
367
- let offsetTop = offsetBuffer.top;
368
- let offsetRight = offsetBuffer.right;
369
- let offsetBottom = offsetBuffer.bottom;
370
- // offsets for y-labels
371
- if (this.mAxisLeft?.needsOffset) {
372
- offsetLeft += this.mAxisLeft.getRequiredWidthSpace(this.rendererLeftYAxis.axisLabelsPaint);
373
- }
374
- if (this.mAxisRight?.needsOffset) {
375
- offsetRight += this.mAxisRight.getRequiredWidthSpace(this.rendererRightYAxis.axisLabelsPaint);
376
- }
377
- if (this.xAxis.enabled && this.xAxis.drawLabels) {
378
- const xLabelHeight = this.xAxis.mLabelRotatedHeight + this.xAxis.yOffset;
379
- // offsets for x-labels
380
- if (this.xAxis.position === XAxisPosition.BOTTOM) {
381
- offsetBottom += xLabelHeight;
382
- }
383
- else if (this.xAxis.position === XAxisPosition.TOP) {
384
- offsetTop += xLabelHeight;
385
- }
386
- else if (this.xAxis.position === XAxisPosition.BOTH_SIDED) {
387
- offsetBottom += xLabelHeight;
388
- offsetTop += xLabelHeight;
389
- }
390
- }
391
- offsetTop += this.extraTopOffset;
392
- offsetRight += this.extraRightOffset;
393
- offsetBottom += this.extraBottomOffset;
394
- offsetLeft += this.extraLeftOffset;
395
- const minOffset = this.minOffset;
396
- this.viewPortHandler.restrainViewPort(Math.max(minOffset, offsetLeft), Math.max(minOffset, offsetTop), Math.max(minOffset, offsetRight), Math.max(minOffset, offsetBottom));
397
- if (Trace.isEnabled()) {
398
- CLog(CLogTypes.info, LOG_TAG, 'offsetLeft: ' + offsetLeft + ', offsetTop: ' + offsetTop + ', offsetRight: ' + offsetRight + ', offsetBottom: ' + offsetBottom);
399
- CLog(CLogTypes.info, LOG_TAG, 'Content: ' + this.viewPortHandler.contentRect.toString());
400
- }
401
- }
402
- this.prepareOffsetMatrix();
403
- this.prepareValuePxMatrix();
404
- }
405
- /**
406
- * draws the grid background
407
- */
408
- drawGridBackground(c) {
409
- if (this.drawGridBackgroundEnabled) {
410
- // draw the grid background
411
- c.drawRect(this.viewPortHandler.contentRect, this.gridBackgroundPaint);
412
- }
413
- if (this.drawBorders) {
414
- c.drawRect(this.viewPortHandler.contentRect, this.borderPaint);
415
- }
416
- }
417
- /**
418
- * Returns the Transformer class that contains all matrices and is
419
- * responsible for transforming values into pixels on the screen and
420
- * backwards.
421
- */
422
- getTransformer(which) {
423
- if (which === undefined) {
424
- return this.transformer;
425
- }
426
- if (which === AxisDependency.LEFT)
427
- return this.leftAxisTransformer;
428
- else
429
- return this.rightAxisTransformer;
430
- }
431
- get transformer() {
432
- if (this.mAxisLeft.enabled) {
433
- return this.leftAxisTransformer;
434
- }
435
- return this.rightAxisTransformer;
436
- }
437
- /**
438
- * Zooms in by 1.4f, into the charts center.
439
- */
440
- zoomIn() {
441
- const center = this.viewPortHandler.contentCenter;
442
- this.viewPortHandler.zoomIn(center.x, -center.y, this.mZoomMatrixBuffer);
443
- this.viewPortHandler.refresh(this.mZoomMatrixBuffer, this, false);
444
- // Range might have changed, which means that Y-axis labels
445
- // could have changed in size, affecting Y-axis size.
446
- // So we need to recalculate offsets.
447
- this.calculateOffsets();
448
- this.invalidate();
449
- }
450
- /**
451
- * Zooms out by 0.7f, from the charts center.
452
- */
453
- zoomOut() {
454
- const center = this.viewPortHandler.contentCenter;
455
- this.viewPortHandler.zoomOut(center.x, -center.y, this.mZoomMatrixBuffer);
456
- this.viewPortHandler.refresh(this.mZoomMatrixBuffer, this, false);
457
- // Range might have changed, which means that Y-axis labels
458
- // could have changed in size, affecting Y-axis size.
459
- // So we need to recalculate offsets.
460
- this.calculateOffsets();
461
- this.invalidate();
462
- }
463
- /**
464
- * Zooms out to original size.
465
- */
466
- resetZoom() {
467
- this.viewPortHandler.mMatrixTouch.reset();
468
- this.viewPortHandler.resetZoom(this.mZoomMatrixBuffer);
469
- this.viewPortHandler.refresh(this.mZoomMatrixBuffer, this, false);
470
- // Range might have changed, which means that Y-axis labels
471
- // could have changed in size, affecting Y-axis size.
472
- // So we need to recalculate offsets.
473
- this.calculateOffsets();
474
- this.invalidate();
475
- }
476
- /**
477
- * Zooms in or out by the given scale factor. x and y are the coordinates
478
- * (in pixels) of the zoom center.
479
- *
480
- * @param scaleX if < 1 --> zoom out, if > 1 --> zoom in
481
- * @param scaleY if < 1 --> zoom out, if > 1 --> zoom in
482
- * @param x
483
- * @param y
484
- */
485
- zoom(scaleX, scaleY, x, y) {
486
- this.viewPortHandler.zoomAtPosition(scaleX, scaleY, x, y, this.mZoomMatrixBuffer);
487
- this.viewPortHandler.refresh(this.mZoomMatrixBuffer, this, false);
488
- // Range might have changed, which means that Y-axis labels
489
- // could have changed in size, affecting Y-axis size.
490
- // So we need to recalculate offsets.
491
- this.calculateOffsets();
492
- this.invalidate();
493
- if (this.hasListeners('zoom')) {
494
- this.notify({ eventName: 'zoom', object: this, scaleX, scaleY, x, y });
495
- }
496
- }
497
- /**
498
- * Zooms in or out by the given scale factor.
499
- * x and y are the values (NOT PIXELS) of the zoom center..
500
- *
501
- * @param scaleX
502
- * @param scaleY
503
- * @param xValue
504
- * @param yValue
505
- * @param axis the axis relative to which the zoom should take place
506
- */
507
- zoomAtValue(scaleX, scaleY, xValue, yValue, axis) {
508
- const job = ZoomJob.getInstance(this.viewPortHandler, scaleX, scaleY, xValue, yValue, this.getTransformer(axis), axis, this);
509
- this.addViewportJob(job);
510
- }
511
- /**
512
- * Zooms to the center of the chart with the given scale factor.
513
- *
514
- * @param scaleX
515
- * @param scaleY
516
- */
517
- zoomToCenter(scaleX, scaleY) {
518
- const center = this.centerOffsets;
519
- const save = this.mZoomMatrixBuffer;
520
- this.viewPortHandler.zoomAtPosition(scaleX, scaleY, center.x, -center.y, save);
521
- this.viewPortHandler.refresh(save, this, false);
522
- }
523
- /**
524
- * Zooms by the specified scale factor to the specified values on the specified axis.
525
- *
526
- * @param scaleX
527
- * @param scaleY
528
- * @param xValue
529
- * @param yValue
530
- * @param axis
531
- * @param duration
532
- */
533
- zoomAndCenterAnimated(scaleX, scaleY, xValue, yValue, axis, duration) {
534
- const origin = this.getValuesByTouchPoint(this.viewPortHandler.contentLeft, this.viewPortHandler.contentTop, axis);
535
- const job = AnimatedZoomJob.getInstance(this.viewPortHandler, this, this.getTransformer(axis), this.getAxis(axis), this.xAxis.axisRange, scaleX, scaleY, this.viewPortHandler.getScaleX(), this.viewPortHandler.getScaleY(), xValue, yValue, origin.x, origin.y, duration);
536
- this.addViewportJob(job);
537
- }
538
- /**
539
- * Zooms by the specified scale factor to the specified values on the specified axis.
540
- *
541
- * @param scaleX
542
- * @param scaleY
543
- * @param xValue
544
- * @param yValue
545
- * @param axis
546
- */
547
- zoomAndCenter(scaleX, scaleY, xValue, yValue, axis) {
548
- const origin = this.getValuesByTouchPoint(this.viewPortHandler.contentLeft, this.viewPortHandler.contentTop, axis);
549
- const job = AnimatedZoomJob.getInstance(this.viewPortHandler, this, this.getTransformer(axis), this.getAxis(axis), this.xAxis.axisRange, scaleX, scaleY, this.viewPortHandler.getScaleX(), this.viewPortHandler.getScaleY(), xValue, yValue, origin.x, origin.y, 0);
550
- job.phase = 1;
551
- job.onAnimationUpdate(0);
552
- }
553
- /**
554
- * Resets all zooming and dragging and makes the chart fit exactly it's
555
- * bounds.
556
- */
557
- fitScreen() {
558
- const save = this.mFitScreenMatrixBuffer;
559
- this.viewPortHandler.fitScreen(save);
560
- this.viewPortHandler.refresh(save, this, false);
561
- this.calculateOffsets();
562
- this.invalidate();
563
- }
564
- /**
565
- * Sets the minimum scale factor value to which can be zoomed out. 1 =
566
- * fitScreen
567
- *
568
- * @param scaleX
569
- * @param scaleY
570
- */
571
- setScaleMinima(scaleX, scaleY) {
572
- this.viewPortHandler.setMinimumScaleX(scaleX);
573
- this.viewPortHandler.setMinimumScaleY(scaleY);
574
- }
575
- /**
576
- * Sets the scale factor. 1 =
577
- * fitScreen
578
- *
579
- * @param scaleX
580
- * @param scaleY
581
- */
582
- setScale(scaleX, scaleY) {
583
- this.viewPortHandler.setScale(scaleX, scaleY);
584
- // Range might have changed, which means that Y-axis labels
585
- // could have changed in size, affecting Y-axis size.
586
- // So we need to recalculate offsets.
587
- this.calculateOffsets();
588
- this.invalidate();
589
- }
590
- /**
591
- * Sets the size of the area (range on the x-axis) that should be maximum
592
- * visible at once (no further zooming out allowed). If this is e.g. set to
593
- * 10, no more than a range of 10 on the x-axis can be viewed at once without
594
- * scrolling.
595
- *
596
- * @param maxXRange The maximum visible range of x-values.
597
- */
598
- set visibleXRangeMaximum(maxXRange) {
599
- const xScale = this.xAxis.axisRange / maxXRange;
600
- this.viewPortHandler.setMinimumScaleX(xScale);
601
- }
602
- /**
603
- * Sets the size of the area (range on the x-axis) that should be minimum
604
- * visible at once (no further zooming in allowed). If this is e.g. set to
605
- * 10, no less than a range of 10 on the x-axis can be viewed at once without
606
- * scrolling.
607
- *
608
- * @param minXRange The minimum visible range of x-values.
609
- */
610
- set visibleXRangeMinimum(minXRange) {
611
- const xScale = this.xAxis.axisRange / minXRange;
612
- this.viewPortHandler.setMaximumScaleX(xScale);
613
- }
614
- /**
615
- * Limits the maximum and minimum x range that can be visible by pinching and zooming. e.g. minRange=10, maxRange=100 the
616
- * smallest range to be displayed at once is 10, and no more than a range of 100 values can be viewed at once without
617
- * scrolling
618
- *
619
- * @param minXRange
620
- * @param maxXRange
621
- */
622
- setVisibleXRange(minXRange, maxXRange) {
623
- const minScale = this.xAxis.axisRange / minXRange;
624
- const maxScale = this.xAxis.axisRange / maxXRange;
625
- this.viewPortHandler.setMinMaxScaleX(minScale, maxScale);
626
- }
627
- /**
628
- * Sets the size of the area (range on the y-axis) that should be maximum
629
- * visible at once.
630
- *
631
- * @param maxYRange the maximum visible range on the y-axis
632
- * @param axis the axis for which this limit should apply
633
- */
634
- setVisibleYRangeMaximum(maxYRange, axis) {
635
- const yScale = this.getAxisRange(axis) / maxYRange;
636
- this.viewPortHandler.setMinimumScaleY(yScale);
637
- }
638
- /**
639
- * Sets the size of the area (range on the y-axis) that should be minimum visible at once, no further zooming in possible.
640
- *
641
- * @param minYRange
642
- * @param axis the axis for which this limit should apply
643
- */
644
- setVisibleYRangeMinimum(minYRange, axis) {
645
- const yScale = this.getAxisRange(axis) / minYRange;
646
- this.viewPortHandler.setMaximumScaleY(yScale);
647
- }
648
- /**
649
- * Limits the maximum and minimum y range that can be visible by pinching and zooming.
650
- *
651
- * @param minYRange
652
- * @param maxYRange
653
- * @param axis
654
- */
655
- setVisibleYRange(minYRange, maxYRange, axis) {
656
- const minScale = this.getAxisRange(axis) / minYRange;
657
- const maxScale = this.getAxisRange(axis) / maxYRange;
658
- this.viewPortHandler.setMinMaxScaleY(minScale, maxScale);
659
- }
660
- /**
661
- * Moves the left side of the current viewport to the specified x-position.
662
- * This also refreshes the chart by calling invalidate().
663
- *
664
- * @param xValue
665
- */
666
- moveViewToX(xValue) {
667
- const job = MoveViewJob.getInstance(this.viewPortHandler, xValue, 0, this.transformer, this);
668
- this.addViewportJob(job);
669
- }
670
- /**
671
- * This will move the left side of the current viewport to the specified
672
- * x-value on the x-axis, and center the viewport to the specified y value on the y-axis.
673
- * This also refreshes the chart by calling invalidate().
674
- *
675
- * @param xValue
676
- * @param yValue
677
- * @param axis - which axis should be used as a reference for the y-axis
678
- */
679
- moveViewTo(xValue, yValue, axis) {
680
- const yInView = this.getAxisRange(axis) / this.viewPortHandler.getScaleY();
681
- const job = MoveViewJob.getInstance(this.viewPortHandler, xValue, yValue + yInView / 2, this.getTransformer(axis), this);
682
- this.addViewportJob(job);
683
- }
684
- /**
685
- * This will move the left side of the current viewport to the specified x-value
686
- * and center the viewport to the y value animated.
687
- * This also refreshes the chart by calling invalidate().
688
- *
689
- * @param xValue
690
- * @param yValue
691
- * @param axis
692
- * @param duration the duration of the animation in milliseconds
693
- */
694
- moveViewToAnimated(xValue, yValue, axis, duration) {
695
- const bounds = this.getValuesByTouchPoint(this.viewPortHandler.contentLeft, this.viewPortHandler.contentTop, axis);
696
- const yInView = this.getAxisRange(axis) / this.viewPortHandler.getScaleY();
697
- const job = AnimatedMoveViewJob.getInstance(this.viewPortHandler, xValue, yValue + yInView / 2, this.getTransformer(axis), this, bounds.x, bounds.y, duration);
698
- this.addViewportJob(job);
699
- // MPPointD.recycleInstance(bounds);
700
- }
701
- /**
702
- * Centers the viewport to the specified y value on the y-axis.
703
- * This also refreshes the chart by calling invalidate().
704
- *
705
- * @param yValue
706
- * @param axis - which axis should be used as a reference for the y-axis
707
- */
708
- centerViewToY(yValue, axis) {
709
- const valsInView = this.getAxisRange(axis) / this.viewPortHandler.getScaleY();
710
- const job = MoveViewJob.getInstance(this.viewPortHandler, 0, yValue + valsInView / 2, this.getTransformer(axis), this);
711
- this.addViewportJob(job);
712
- }
713
- /**
714
- * This will move the center of the current viewport to the specified
715
- * x and y value.
716
- * This also refreshes the chart by calling invalidate().
717
- *
718
- * @param xValue
719
- * @param yValue
720
- * @param axis - which axis should be used as a reference for the y axis
721
- */
722
- centerViewTo(xValue, yValue, axis) {
723
- const yInView = this.getAxisRange(axis) / this.viewPortHandler.getScaleY();
724
- const xInView = this.xAxis.axisRange / this.viewPortHandler.getScaleX();
725
- const job = MoveViewJob.getInstance(this.viewPortHandler, xValue - xInView / 2, yValue + yInView / 2, this.getTransformer(axis), this);
726
- this.addViewportJob(job);
727
- }
728
- /**
729
- * This will move the center of the current viewport to the specified
730
- * x and y value animated.
731
- *
732
- * @param xValue
733
- * @param yValue
734
- * @param axis
735
- * @param duration the duration of the animation in milliseconds
736
- */
737
- centerViewToAnimated(xValue, yValue, axis, duration) {
738
- const bounds = this.getValuesByTouchPoint(this.viewPortHandler.contentLeft, this.viewPortHandler.contentTop, axis);
739
- const yInView = this.getAxisRange(axis) / this.viewPortHandler.getScaleY();
740
- const xInView = this.xAxis.axisRange / this.viewPortHandler.getScaleX();
741
- const job = AnimatedMoveViewJob.getInstance(this.viewPortHandler, xValue - xInView / 2, yValue + yInView / 2, this.getTransformer(axis), this, bounds.x, bounds.y, duration);
742
- this.addViewportJob(job);
743
- // MPPointD.recycleInstance(bounds);
744
- }
745
- /**
746
- * Sets custom offsets for the current ViewPort (the offsets on the sides of
747
- * the actual chart window). Setting this will prevent the chart from
748
- * automatically calculating it's offsets. Use resetViewPortOffsets() to
749
- * undo this. ONLY USE THIS WHEN YOU KNOW WHAT YOU ARE DOING, else use
750
- * setExtraOffsets(...).
751
- *
752
- * @param left
753
- * @param top
754
- * @param right
755
- * @param bottom
756
- */
757
- setViewPortOffsets(left, top, right, bottom) {
758
- this.mCustomViewPortEnabled = true;
759
- // post(new Runnable() {
760
- // public run() {
761
- this.viewPortHandler.restrainViewPort(left, top, right, bottom);
762
- this.prepareOffsetMatrix();
763
- this.prepareValuePxMatrix();
764
- // }
765
- // });
766
- }
767
- /**
768
- * Resets all custom offsets set via setViewPortOffsets(...) method. Allows
769
- * the chart to again calculate all offsets automatically.
770
- */
771
- resetViewPortOffsets() {
772
- this.mCustomViewPortEnabled = false;
773
- this.calculateOffsets();
774
- }
775
- /**
776
- * ################ ################ ################ ################
777
- */
778
- /** CODE BELOW IS GETTERS AND SETTERS */
779
- /**
780
- * Returns the range of the specified axis.
781
- *
782
- * @param axis
783
- * @return
784
- */
785
- getAxisRange(axis) {
786
- if (axis === AxisDependency.LEFT)
787
- return this.mAxisLeft.axisRange;
788
- else
789
- return this.mAxisRight && this.mAxisRight.axisRange;
790
- }
791
- /**
792
- * Returns a recyclable MPPointF instance.
793
- * Returns the position (in pixels) the provided Entry has inside the chart
794
- * view or null, if the provided Entry is null.
795
- *
796
- * @param e
797
- * @return
798
- */
799
- getPosition(e, axis) {
800
- if (!e)
801
- return null;
802
- const pts = Utils.getTempArray(2);
803
- pts[0] = e.getX();
804
- pts[1] = e.getY();
805
- this.getTransformer(axis).pointValuesToPixel(pts);
806
- return { x: pts[0], y: pts[1] };
807
- }
808
- /**
809
- * Set this to true to allow highlighting per dragging over the chart
810
- * surface when it is fully zoomed out. Default: true
811
- *
812
- * @param enabled
813
- */
814
- set highlightPerDragEnabled(enabled) {
815
- this.mHighlightPerDragEnabled = enabled;
816
- if (enabled) {
817
- this.getOrCreateBarTouchListener().setPan(true);
818
- }
819
- else if (this.chartTouchListener) {
820
- this.chartTouchListener.setPan(false);
821
- }
822
- }
823
- get highlightPerDragEnabled() {
824
- return this.mHighlightPerDragEnabled;
825
- }
826
- /**
827
- * Sets the color for the background of the chart-drawing area (everything
828
- * behind the grid lines).
829
- *
830
- * @param color
831
- */
832
- set gridBackgroundColor(color) {
833
- this.gridBackgroundPaint.setColor(color);
834
- }
835
- /**
836
- * Set this to true to enable dragging (moving the chart with the finger)
837
- * for the chart (this does not effect scaling).
838
- *
839
- * @param enabled
840
- */
841
- set dragEnabled(enabled) {
842
- this.dragXEnabled = enabled;
843
- this.dragYEnabled = enabled;
844
- if (enabled) {
845
- this.getOrCreateBarTouchListener().setPan(true);
846
- }
847
- else if (this.chartTouchListener) {
848
- this.chartTouchListener.setPan(false);
849
- }
850
- }
851
- /**
852
- * Returns true if dragging is enabled for the chart, false if not.
853
- */
854
- get dragEnabled() {
855
- return this.dragXEnabled || this.dragYEnabled;
856
- }
857
- /**
858
- * Set this to true to enable scaling (zooming in and out by gesture) for
859
- * the chart (this does not effect dragging) on both X- and Y-Axis.
860
- *
861
- * @param enabled
862
- */
863
- set scaleEnabled(enabled) {
864
- this.mScaleXEnabled = enabled;
865
- this.mScaleYEnabled = enabled;
866
- if (enabled) {
867
- this.getOrCreateBarTouchListener().setPinch(true);
868
- }
869
- else if (this.chartTouchListener) {
870
- this.chartTouchListener.setPinch(false);
871
- }
872
- }
873
- set scaleXEnabled(enabled) {
874
- this.mScaleXEnabled = enabled;
875
- if (enabled) {
876
- this.getOrCreateBarTouchListener().setPinch(true);
877
- }
878
- else if (!this.mScaleYEnabled && this.chartTouchListener) {
879
- this.chartTouchListener.setPinch(false);
880
- }
881
- }
882
- get scaleXEnabled() {
883
- return this.mScaleXEnabled;
884
- }
885
- set scaleYEnabled(enabled) {
886
- this.mScaleYEnabled = enabled;
887
- if (enabled) {
888
- this.getOrCreateBarTouchListener().setPinch(true);
889
- }
890
- else if (!this.mScaleXEnabled && this.chartTouchListener) {
891
- this.chartTouchListener.setPinch(false);
892
- }
893
- }
894
- get scaleYEnabled() {
895
- return this.mScaleYEnabled;
896
- }
897
- /**
898
- * Set this to true to enable zooming in by double-tap on the chart.
899
- * Default: enabled
900
- *
901
- * @param enabled
902
- */
903
- set doubleTapToZoomEnabled(enabled) {
904
- this.mDoubleTapToZoomEnabled = enabled;
905
- if (enabled) {
906
- this.getOrCreateBarTouchListener().setDoubleTap(true);
907
- }
908
- else if (this.chartTouchListener) {
909
- this.chartTouchListener.setDoubleTap(false);
910
- }
911
- }
912
- /**
913
- * Returns true if zooming via double-tap is enabled false if not.
914
- */
915
- get doubleTapToZoomEnabled() {
916
- return this.mDoubleTapToZoomEnabled;
917
- }
918
- set highlightPerTapEnabled(enabled) {
919
- this.mHighlightPerTapEnabled = enabled;
920
- if (enabled) {
921
- this.getOrCreateBarTouchListener().setTap(true);
922
- }
923
- else if (this.chartTouchListener) {
924
- this.chartTouchListener.setTap(false);
925
- }
926
- }
927
- get highlightPerTapEnabled() {
928
- return this.mHighlightPerTapEnabled;
929
- }
930
- /**
931
- * Sets the width of the border lines in dp.
932
- *
933
- * @param width
934
- */
935
- setBorderWidth(width) {
936
- this.borderPaint.setStrokeWidth(width);
937
- }
938
- /**
939
- * Sets the color of the chart border lines.
940
- *
941
- * @param color
942
- */
943
- setBorderColor(color) {
944
- this.borderPaint.setColor(color);
945
- }
946
- /**
947
- * Returns a recyclable MPPointD instance
948
- * Returns the x and y values in the chart at the given touch point
949
- * (encapsulated in a MPPointD). This method transforms pixel coordinates to
950
- * coordinates / values in the chart. This is the opposite method to
951
- * getPixelForValues(...).
952
- *
953
- * @param x
954
- * @param y
955
- * @return
956
- */
957
- // public getValuesByTouchPoint( x ,y, axis) {
958
- // const result = {x:0, y:0};
959
- // this.getValuesByTouchPoint(x, y, axis, result);
960
- // return result;
961
- // }
962
- getValuesByTouchPoint(x, y, axis) {
963
- return this.getTransformer(axis).getValuesByTouchPoint(x, y);
964
- }
965
- /**
966
- * Returns a recyclable MPPointD instance
967
- * Transforms the given chart values into pixels. This is the opposite
968
- * method to getValuesByTouchPoint(...).
969
- *
970
- * @param x
971
- * @param y
972
- * @return
973
- */
974
- getPixelForValues(x, y, axis) {
975
- return this.getTransformer(axis).getPixelForValues(x, y);
976
- }
977
- /**
978
- * Returns a recyclable MPPointD instance
979
- * Transforms the given chart values into pixels. This is the opposite
980
- * method to getValuesByTouchPoint(...).
981
- *
982
- * @param set
983
- * @param entry
984
- * @param entry
985
- * @return
986
- */
987
- getPixelForEntry(set, entry, index) {
988
- const xVal = set.getEntryXValue(entry, index);
989
- return this.getTransformer(set.axisDependency).getPixelForValues(xVal, set.getEntryYValue(entry));
990
- // return this.getTransformer(axis).getPixelForValues(x, y);
991
- }
992
- /**
993
- * returns the Entry object displayed at the touched position of the chart
994
- *
995
- * @param x
996
- * @param y
997
- * @return
998
- */
999
- getEntryByTouchPoint(x, y) {
1000
- const h = this.getHighlightByTouchPoint(x, y);
1001
- if (h) {
1002
- return this.mData.getEntryForHighlight(h);
1003
- }
1004
- return null;
1005
- }
1006
- /**
1007
- * returns the DataSet object displayed at the touched position of the chart
1008
- *
1009
- * @param x
1010
- * @param y
1011
- * @return
1012
- */
1013
- getDataSetByTouchPoint(x, y) {
1014
- const h = this.getHighlightByTouchPoint(x, y);
1015
- if (h) {
1016
- return this.mData.getDataSetByIndex(h.dataSetIndex);
1017
- }
1018
- return null;
1019
- }
1020
- /**
1021
- * Returns the lowest x-index (value on the x-axis) that is still visible on
1022
- * the chart.
1023
- */
1024
- get lowestVisibleX() {
1025
- this.transformer.getValuesByTouchPoint(this.viewPortHandler.contentLeft, this.viewPortHandler.contentBottom, this.posForGetLowestVisibleX);
1026
- const result = Math.max(this.xAxis.axisMinimum, this.posForGetLowestVisibleX.x);
1027
- return result;
1028
- }
1029
- /**
1030
- * Returns the highest x-index (value on the x-axis) that is still visible
1031
- * on the chart.
1032
- */
1033
- get highestVisibleX() {
1034
- this.transformer.getValuesByTouchPoint(this.viewPortHandler.contentRight, this.viewPortHandler.contentBottom, this.posForGetHighestVisibleX);
1035
- const result = Math.min(this.xAxis.axisMaximum, this.posForGetHighestVisibleX.x);
1036
- return result;
1037
- }
1038
- /**
1039
- * Returns the range visible on the x-axis.
1040
- */
1041
- getVisibleXRange() {
1042
- return Math.abs(this.highestVisibleX - this.lowestVisibleX);
1043
- }
1044
- /**
1045
- * returns the current x-scale factor
1046
- */
1047
- getScaleX() {
1048
- if (this.viewPortHandler == null)
1049
- return 1;
1050
- else
1051
- return this.viewPortHandler.getScaleX();
1052
- }
1053
- /**
1054
- * returns the current y-scale factor
1055
- */
1056
- getScaleY() {
1057
- if (this.viewPortHandler == null)
1058
- return 1;
1059
- else
1060
- return this.viewPortHandler.getScaleY();
1061
- }
1062
- /**
1063
- * if the chart is fully zoomed out, return true
1064
- */
1065
- isFullyZoomedOut() {
1066
- return this.viewPortHandler.isFullyZoomedOut();
1067
- }
1068
- /**
1069
- * Returns the left y-axis object. In the horizontal bar-chart, this is the
1070
- * top axis.
1071
- */
1072
- get leftAxis() {
1073
- return this.mAxisLeft;
1074
- }
1075
- /**
1076
- * @deprecated use leftAxis
1077
- */
1078
- get axisLeft() {
1079
- return this.mAxisLeft;
1080
- }
1081
- /**
1082
- * Returns the right y-axis object. In the horizontal bar-chart, this is the
1083
- * bottom axis.
1084
- */
1085
- get rightAxis() {
1086
- if (!this.mAxisRight) {
1087
- this.mAxisRight = new YAxis(AxisDependency.RIGHT, new WeakRef(this));
1088
- this.rightAxisTransformer = new Transformer(this.viewPortHandler);
1089
- this.rendererRightYAxis = new YAxisRenderer(this.viewPortHandler, this.mAxisRight, this.rightAxisTransformer);
1090
- }
1091
- return this.mAxisRight;
1092
- }
1093
- /**
1094
- * @deprecated use rightAxis
1095
- */
1096
- get axisRight() {
1097
- return this.rightAxis;
1098
- }
1099
- /**
1100
- * Returns the y-axis object to the corresponding AxisDependency. In the
1101
- * horizontal bar-chart, LEFT == top, RIGHT == BOTTOM
1102
- *
1103
- * @param axis
1104
- * @return
1105
- */
1106
- getAxis(axis) {
1107
- if (axis === AxisDependency.LEFT)
1108
- return this.mAxisLeft;
1109
- else
1110
- return this.mAxisRight;
1111
- }
1112
- isInverted(axis) {
1113
- return this.getAxis(axis).inverted;
1114
- }
1115
- /**
1116
- * Set an offset in dp that allows the user to drag the chart over it's
1117
- * bounds on the x-axis.
1118
- *
1119
- * @param offset
1120
- */
1121
- setDragOffsetX(offset) {
1122
- this.viewPortHandler.setDragOffsetX(offset);
1123
- }
1124
- /**
1125
- * Set an offset in dp that allows the user to drag the chart over it's
1126
- * bounds on the y-axis.
1127
- *
1128
- * @param offset
1129
- */
1130
- setDragOffsetY(offset) {
1131
- this.viewPortHandler.setDragOffsetY(offset);
1132
- }
1133
- /**
1134
- * Returns true if both drag offsets (x and y) are zero or smaller.
1135
- */
1136
- hasNoDragOffset() {
1137
- return this.viewPortHandler.hasNoDragOffset();
1138
- }
1139
- get yChartMax() {
1140
- let max = -Infinity;
1141
- if (this.mAxisLeft.enabled) {
1142
- max = Math.max(this.mAxisLeft.axisMaximum, max);
1143
- }
1144
- if (this.mAxisRight?.enabled) {
1145
- max = Math.max(this.mAxisRight.axisMaximum, max);
1146
- }
1147
- return max;
1148
- }
1149
- get yChartMin() {
1150
- let min = Infinity;
1151
- if (this.mAxisLeft.enabled) {
1152
- min = Math.min(this.mAxisLeft.axisMinimum, min);
1153
- }
1154
- if (this.mAxisRight?.enabled) {
1155
- min = Math.min(this.mAxisRight.axisMinimum, min);
1156
- }
1157
- return min;
1158
- }
1159
- /**
1160
- * Returns true if either the left or the right or both axes are inverted.
1161
- */
1162
- get anyAxisInverted() {
1163
- if (this.mAxisLeft.enabled && this.mAxisLeft.inverted)
1164
- return true;
1165
- if (this.mAxisRight?.enabled && this.mAxisRight.inverted)
1166
- return true;
1167
- return false;
1168
- }
1169
- onSizeChanged(w, h, oldw, oldh) {
1170
- // Saving current position of chart.
1171
- this.mOnSizeChangedBuffer[0] = this.mOnSizeChangedBuffer[1] = 0;
1172
- if (this.keepPositionOnRotation) {
1173
- this.mOnSizeChangedBuffer[0] = this.viewPortHandler.contentLeft;
1174
- this.mOnSizeChangedBuffer[1] = this.viewPortHandler.contentTop;
1175
- this.transformer.pixelsToValue(this.mOnSizeChangedBuffer);
1176
- }
1177
- //Superclass transforms chart.
1178
- super.onSizeChanged(w, h, oldw, oldh);
1179
- if (this.keepPositionOnRotation) {
1180
- //Restoring old position of chart.
1181
- this.transformer.pointValuesToPixel(this.mOnSizeChangedBuffer);
1182
- this.viewPortHandler.centerViewPort(this.mOnSizeChangedBuffer, this);
1183
- }
1184
- else {
1185
- // a resize of the view will redraw the view anyway?
1186
- this.viewPortHandler.refresh(this.viewPortHandler.getMatrixTouch(), this, false);
1187
- }
1188
- }
1189
- addEventListener(arg, callback, thisArg) {
1190
- if (typeof arg === 'number') {
1191
- arg = GestureTypes[arg];
1192
- }
1193
- if (typeof arg === 'string') {
1194
- arg = getEventOrGestureName(arg);
1195
- const events = arg.split(',');
1196
- if (events.length > 0) {
1197
- for (let i = 0; i < events.length; i++) {
1198
- const evt = events[i].trim();
1199
- if (arg === 'tap') {
1200
- this.getOrCreateBarTouchListener().setTap(true);
1201
- }
1202
- else if (arg === 'doubleTap') {
1203
- this.getOrCreateBarTouchListener().setDoubleTap(true);
1204
- }
1205
- else if (arg === 'pan') {
1206
- this.getOrCreateBarTouchListener().setPan(true);
1207
- }
1208
- else if (arg === 'pinch') {
1209
- this.getOrCreateBarTouchListener().setPinch(true);
1210
- }
1211
- Observable.prototype.addEventListener.call(this, evt, callback, thisArg);
1212
- }
1213
- }
1214
- else {
1215
- Observable.prototype.addEventListener.call(this, arg, callback, thisArg);
1216
- }
1217
- }
1218
- }
1219
- removeEventListener(arg, callback, thisArg) {
1220
- if (typeof arg === 'number') {
1221
- arg = GestureTypes[arg];
1222
- }
1223
- if (typeof arg === 'string') {
1224
- arg = getEventOrGestureName(arg);
1225
- const events = arg.split(',');
1226
- if (events.length > 0) {
1227
- for (let i = 0; i < events.length; i++) {
1228
- const evt = events[i].trim();
1229
- if (arg === 'tap' && !this.highlightPerTapEnabled) {
1230
- this.chartTouchListener && this.chartTouchListener.setTap(false);
1231
- }
1232
- else if (arg === 'doubleTap' && !this.doubleTapToZoomEnabled) {
1233
- this.chartTouchListener && this.chartTouchListener.setDoubleTap(false);
1234
- }
1235
- else if (arg === 'pan' && !this.highlightPerDragEnabled && !this.dragEnabled) {
1236
- this.chartTouchListener && this.chartTouchListener.setPan(false);
1237
- }
1238
- else if (arg === 'pinch' && !this.pinchZoomEnabled) {
1239
- this.chartTouchListener && this.chartTouchListener.setPinch(false);
1240
- }
1241
- Observable.prototype.removeEventListener.call(this, evt, callback, thisArg);
1242
- }
1243
- }
1244
- else {
1245
- Observable.prototype.removeEventListener.call(this, arg, callback, thisArg);
1246
- }
1247
- }
1248
- }
1249
- }
1250
- __decorate([
1251
- profile
1252
- ], BarLineChartBase.prototype, "onDraw", null);
1253
- //# sourceMappingURL=BarLineChartBase.js.map