@nativescript-community/ui-chart 1.2.36 → 2.0.1

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 (365) hide show
  1. package/README.md +6 -0
  2. package/animation/ChartAnimator.d.ts +47 -4
  3. package/animation/ChartAnimator.js +49 -11
  4. package/animation/ChartAnimator.js.map +1 -1
  5. package/animation/Tween.d.ts +1 -1
  6. package/animation/Tween.js +4 -2
  7. package/animation/Tween.js.map +1 -1
  8. package/buffer/AbstractBuffer.d.ts +28 -3
  9. package/buffer/AbstractBuffer.js +22 -3
  10. package/buffer/AbstractBuffer.js.map +1 -1
  11. package/buffer/BarBuffer.d.ts +8 -12
  12. package/buffer/BarBuffer.js +33 -36
  13. package/buffer/BarBuffer.js.map +1 -1
  14. package/buffer/HorizontalBarBuffer.js +13 -10
  15. package/buffer/HorizontalBarBuffer.js.map +1 -1
  16. package/charts/BarChart.d.ts +70 -15
  17. package/charts/BarChart.js +92 -63
  18. package/charts/BarChart.js.map +1 -1
  19. package/charts/BarLineChartBase.d.ts +494 -73
  20. package/charts/BarLineChartBase.js +788 -407
  21. package/charts/BarLineChartBase.js.map +1 -1
  22. package/charts/BubbleChart.d.ts +11 -5
  23. package/charts/BubbleChart.js +10 -8
  24. package/charts/BubbleChart.js.map +1 -1
  25. package/charts/CandleStickChart.d.ts +8 -5
  26. package/charts/CandleStickChart.js +9 -10
  27. package/charts/CandleStickChart.js.map +1 -1
  28. package/charts/Chart.d.ts +420 -91
  29. package/charts/Chart.js +590 -290
  30. package/charts/Chart.js.map +1 -1
  31. package/charts/CombinedChart.d.ts +59 -29
  32. package/charts/CombinedChart.js +74 -67
  33. package/charts/CombinedChart.js.map +1 -1
  34. package/charts/HorizontalBarChart.d.ts +37 -7
  35. package/charts/HorizontalBarChart.js +97 -59
  36. package/charts/HorizontalBarChart.js.map +1 -1
  37. package/charts/LineChart.d.ts +3 -5
  38. package/charts/LineChart.js +6 -10
  39. package/charts/LineChart.js.map +1 -1
  40. package/charts/PieChart.d.ts +218 -64
  41. package/charts/PieChart.js +278 -168
  42. package/charts/PieChart.js.map +1 -1
  43. package/charts/PieRadarChartBase.d.ts +107 -18
  44. package/charts/PieRadarChartBase.js +156 -73
  45. package/charts/PieRadarChartBase.js.map +1 -1
  46. package/charts/RadarChart.d.ts +75 -35
  47. package/charts/RadarChart.js +114 -103
  48. package/charts/RadarChart.js.map +1 -1
  49. package/charts/ScatterChart.d.ts +10 -5
  50. package/charts/ScatterChart.js +11 -10
  51. package/charts/ScatterChart.js.map +1 -1
  52. package/components/AxisBase.d.ts +271 -101
  53. package/components/AxisBase.js +264 -254
  54. package/components/AxisBase.js.map +1 -1
  55. package/components/ComponentBase.d.ts +54 -19
  56. package/components/ComponentBase.js +60 -48
  57. package/components/ComponentBase.js.map +1 -1
  58. package/components/Description.d.ts +18 -9
  59. package/components/Description.js +12 -26
  60. package/components/Description.js.map +1 -1
  61. package/components/IMarker.d.ts +30 -1
  62. package/components/IMarker.js.map +1 -1
  63. package/components/Legend.d.ts +155 -58
  64. package/components/Legend.js +208 -172
  65. package/components/Legend.js.map +1 -1
  66. package/components/LegendEntry.d.ts +38 -0
  67. package/components/LegendEntry.js +34 -0
  68. package/components/LegendEntry.js.map +1 -1
  69. package/components/LimitLine.d.ts +40 -22
  70. package/components/LimitLine.js +44 -56
  71. package/components/LimitLine.js.map +1 -1
  72. package/components/MarkerImage.d.ts +1 -0
  73. package/components/MarkerImage.js +97 -0
  74. package/components/MarkerImage.js.map +1 -0
  75. package/components/XAxis.d.ts +41 -10
  76. package/components/XAxis.js +42 -24
  77. package/components/XAxis.js.map +1 -1
  78. package/components/YAxis.d.ts +114 -37
  79. package/components/YAxis.js +138 -106
  80. package/components/YAxis.js.map +1 -1
  81. package/data/BarData.d.ts +32 -4
  82. package/data/BarData.js +92 -24
  83. package/data/BarData.js.map +1 -1
  84. package/data/BarDataSet.d.ts +35 -18
  85. package/data/BarDataSet.js +42 -47
  86. package/data/BarDataSet.js.map +1 -1
  87. package/data/BarEntry.d.ts +3 -0
  88. package/data/BarEntry.js.map +1 -1
  89. package/data/BarLineScatterCandleBubbleData.d.ts +5 -0
  90. package/data/BarLineScatterCandleBubbleData.js +5 -0
  91. package/data/BarLineScatterCandleBubbleData.js.map +1 -1
  92. package/data/BarLineScatterCandleBubbleDataSet.d.ts +11 -3
  93. package/data/BarLineScatterCandleBubbleDataSet.js +11 -7
  94. package/data/BarLineScatterCandleBubbleDataSet.js.map +1 -1
  95. package/data/BaseDataSet.d.ts +129 -71
  96. package/data/BaseDataSet.js +146 -169
  97. package/data/BaseDataSet.js.map +1 -1
  98. package/data/BaseEntry.d.ts +3 -0
  99. package/data/BaseEntry.js.map +1 -1
  100. package/data/BubbleData.d.ts +7 -1
  101. package/data/BubbleData.js +8 -2
  102. package/data/BubbleData.js.map +1 -1
  103. package/data/BubbleDataSet.d.ts +7 -7
  104. package/data/BubbleDataSet.js +8 -15
  105. package/data/BubbleDataSet.js.map +1 -1
  106. package/data/BubbleEntry.d.ts +1 -0
  107. package/data/BubbleEntry.js.map +1 -1
  108. package/data/CandleData.js.map +1 -1
  109. package/data/CandleDataSet.d.ts +64 -30
  110. package/data/CandleDataSet.js +67 -74
  111. package/data/CandleDataSet.js.map +1 -1
  112. package/data/CandleEntry.d.ts +4 -0
  113. package/data/CandleEntry.js.map +1 -1
  114. package/data/ChartData.d.ts +275 -20
  115. package/data/ChartData.js +400 -95
  116. package/data/ChartData.js.map +1 -1
  117. package/data/CombinedData.d.ts +39 -12
  118. package/data/CombinedData.js +87 -71
  119. package/data/CombinedData.js.map +1 -1
  120. package/data/DataSet.d.ts +59 -8
  121. package/data/DataSet.js +114 -26
  122. package/data/DataSet.js.map +1 -1
  123. package/data/Entry.js.map +1 -1
  124. package/data/LineData.d.ts +5 -0
  125. package/data/LineData.js +5 -0
  126. package/data/LineData.js.map +1 -1
  127. package/data/LineDataSet.d.ts +84 -49
  128. package/data/LineDataSet.js +94 -135
  129. package/data/LineDataSet.js.map +1 -1
  130. package/data/LineRadarDataSet.d.ts +27 -17
  131. package/data/LineRadarDataSet.js +22 -35
  132. package/data/LineRadarDataSet.js.map +1 -1
  133. package/data/LineScatterCandleRadarDataSet.d.ts +30 -15
  134. package/data/LineScatterCandleRadarDataSet.js +36 -39
  135. package/data/LineScatterCandleRadarDataSet.js.map +1 -1
  136. package/data/PieData.d.ts +26 -0
  137. package/data/PieData.js +28 -2
  138. package/data/PieData.js.map +1 -1
  139. package/data/PieDataSet.d.ts +40 -36
  140. package/data/PieDataSet.js +36 -88
  141. package/data/PieDataSet.js.map +1 -1
  142. package/data/PieEntry.d.ts +3 -0
  143. package/data/PieEntry.js.map +1 -1
  144. package/data/RadarData.d.ts +10 -4
  145. package/data/RadarData.js +5 -6
  146. package/data/RadarData.js.map +1 -1
  147. package/data/RadarDataSet.d.ts +7 -21
  148. package/data/RadarDataSet.js +10 -49
  149. package/data/RadarDataSet.js.map +1 -1
  150. package/data/RadarEntry.js.map +1 -1
  151. package/data/ScatterData.d.ts +4 -1
  152. package/data/ScatterData.js +5 -2
  153. package/data/ScatterData.js.map +1 -1
  154. package/data/ScatterDataSet.d.ts +24 -14
  155. package/data/ScatterDataSet.js +26 -31
  156. package/data/ScatterDataSet.js.map +1 -1
  157. package/formatter/DefaultAxisValueFormatter.d.ts +17 -3
  158. package/formatter/DefaultAxisValueFormatter.js +12 -5
  159. package/formatter/DefaultAxisValueFormatter.js.map +1 -1
  160. package/formatter/DefaultFillFormatter.js +7 -7
  161. package/formatter/DefaultFillFormatter.js.map +1 -1
  162. package/formatter/DefaultValueFormatter.js.map +1 -1
  163. package/formatter/IAxisValueFormatter.d.ts +20 -2
  164. package/formatter/IAxisValueFormatter.js.map +1 -1
  165. package/formatter/IFillFormatter.d.ts +25 -0
  166. package/formatter/IFillFormatter.js.map +1 -1
  167. package/formatter/IValueFormatter.d.ts +21 -0
  168. package/formatter/IValueFormatter.js.map +1 -1
  169. package/formatter/ValueFormatter.d.ts +60 -0
  170. package/formatter/ValueFormatter.js +60 -0
  171. package/formatter/ValueFormatter.js.map +1 -1
  172. package/highlight/BarHighlighter.d.ts +22 -2
  173. package/highlight/BarHighlighter.js +43 -17
  174. package/highlight/BarHighlighter.js.map +1 -1
  175. package/highlight/ChartHighlighter.d.ts +87 -5
  176. package/highlight/ChartHighlighter.js +129 -25
  177. package/highlight/ChartHighlighter.js.map +1 -1
  178. package/highlight/CombinedHighlighter.d.ts +6 -0
  179. package/highlight/CombinedHighlighter.js +31 -16
  180. package/highlight/CombinedHighlighter.js.map +1 -1
  181. package/highlight/Highlight.d.ts +54 -1
  182. package/highlight/Highlight.js +5 -0
  183. package/highlight/Highlight.js.map +1 -1
  184. package/highlight/HorizontalBarHighlighter.d.ts +1 -1
  185. package/highlight/HorizontalBarHighlighter.js +14 -13
  186. package/highlight/HorizontalBarHighlighter.js.map +1 -1
  187. package/highlight/IHighlighter.d.ts +11 -1
  188. package/highlight/IHighlighter.js.map +1 -1
  189. package/highlight/PieHighlighter.js +2 -2
  190. package/highlight/PieHighlighter.js.map +1 -1
  191. package/highlight/PieRadarHighlighter.d.ts +12 -1
  192. package/highlight/PieRadarHighlighter.js +12 -4
  193. package/highlight/PieRadarHighlighter.js.map +1 -1
  194. package/highlight/RadarHighlighter.d.ts +12 -0
  195. package/highlight/RadarHighlighter.js +24 -10
  196. package/highlight/RadarHighlighter.js.map +1 -1
  197. package/index.d.ts +11 -0
  198. package/index.js +15 -0
  199. package/index.js.map +1 -0
  200. package/interfaces/dataprovider/BarDataProvider.d.ts +4 -4
  201. package/interfaces/dataprovider/BarLineScatterCandleBubbleDataProvider.d.ts +8 -3
  202. package/interfaces/dataprovider/BubbleDataProvider.d.ts +1 -1
  203. package/interfaces/dataprovider/CandleDataProvider.d.ts +1 -1
  204. package/interfaces/dataprovider/ChartInterface.d.ts +17 -22
  205. package/interfaces/dataprovider/CombinedDataProvider.d.ts +1 -1
  206. package/interfaces/dataprovider/LineDataProvider.d.ts +1 -1
  207. package/interfaces/dataprovider/ScatterDataProvider.d.ts +1 -1
  208. package/interfaces/datasets/IBarDataSet.d.ts +8 -22
  209. package/interfaces/datasets/IBarLineScatterCandleBubbleDataSet.d.ts +1 -3
  210. package/interfaces/datasets/IBubbleDataSet.d.ts +3 -9
  211. package/interfaces/datasets/ICandleDataSet.d.ts +44 -41
  212. package/interfaces/datasets/IDataSet.d.ts +35 -151
  213. package/interfaces/datasets/ILineDataSet.d.ts +15 -54
  214. package/interfaces/datasets/ILineRadarDataSet.d.ts +7 -28
  215. package/interfaces/datasets/ILineScatterCandleRadarDataSet.d.ts +5 -4
  216. package/interfaces/datasets/IPieDataSet.d.ts +22 -40
  217. package/interfaces/datasets/IRadarDataSet.d.ts +7 -13
  218. package/interfaces/datasets/IScatterDataSet.d.ts +17 -16
  219. package/jobs/AnimatedMoveViewJob.d.ts +3 -0
  220. package/jobs/AnimatedMoveViewJob.js +12 -8
  221. package/jobs/AnimatedMoveViewJob.js.map +1 -1
  222. package/jobs/AnimatedViewPortJob.d.ts +7 -8
  223. package/jobs/AnimatedViewPortJob.js +16 -23
  224. package/jobs/AnimatedViewPortJob.js.map +1 -1
  225. package/jobs/AnimatedZoomJob.d.ts +8 -5
  226. package/jobs/AnimatedZoomJob.js +30 -26
  227. package/jobs/AnimatedZoomJob.js.map +1 -1
  228. package/jobs/MoveViewJob.d.ts +3 -0
  229. package/jobs/MoveViewJob.js +10 -7
  230. package/jobs/MoveViewJob.js.map +1 -1
  231. package/jobs/ViewPortJob.d.ts +3 -5
  232. package/jobs/ViewPortJob.js +5 -11
  233. package/jobs/ViewPortJob.js.map +1 -1
  234. package/jobs/ZoomJob.js +14 -14
  235. package/jobs/ZoomJob.js.map +1 -1
  236. package/listener/BarLineChartTouchListener.d.ts +82 -1
  237. package/listener/BarLineChartTouchListener.js +169 -67
  238. package/listener/BarLineChartTouchListener.js.map +1 -1
  239. package/listener/ChartTouchListener.d.ts +39 -5
  240. package/listener/ChartTouchListener.js +38 -11
  241. package/listener/ChartTouchListener.js.map +1 -1
  242. package/listener/PieRadarChartTouchListener.d.ts +56 -1
  243. package/listener/PieRadarChartTouchListener.js +201 -17
  244. package/listener/PieRadarChartTouchListener.js.map +1 -1
  245. package/model/GradientColor.js.map +1 -1
  246. package/package.json +23 -15
  247. package/renderer/AxisRenderer.d.ts +66 -7
  248. package/renderer/AxisRenderer.js +69 -21
  249. package/renderer/AxisRenderer.js.map +1 -1
  250. package/renderer/BarChartRenderer.d.ts +11 -0
  251. package/renderer/BarChartRenderer.js +99 -71
  252. package/renderer/BarChartRenderer.js.map +1 -1
  253. package/renderer/BarLineScatterCandleBubbleRenderer.d.ts +37 -0
  254. package/renderer/BarLineScatterCandleBubbleRenderer.js +36 -8
  255. package/renderer/BarLineScatterCandleBubbleRenderer.js.map +1 -1
  256. package/renderer/BubbleChartRenderer.d.ts +6 -2
  257. package/renderer/BubbleChartRenderer.js +51 -40
  258. package/renderer/BubbleChartRenderer.js.map +1 -1
  259. package/renderer/CandleStickChartRenderer.d.ts +1 -1
  260. package/renderer/CandleStickChartRenderer.js +64 -50
  261. package/renderer/CandleStickChartRenderer.js.map +1 -1
  262. package/renderer/CombinedChartRenderer.d.ts +20 -1
  263. package/renderer/CombinedChartRenderer.js +72 -42
  264. package/renderer/CombinedChartRenderer.js.map +1 -1
  265. package/renderer/DataRenderer.d.ts +78 -4
  266. package/renderer/DataRenderer.js +65 -6
  267. package/renderer/DataRenderer.js.map +1 -1
  268. package/renderer/HorizontalBarChartRenderer.d.ts +5 -2
  269. package/renderer/HorizontalBarChartRenderer.js +87 -66
  270. package/renderer/HorizontalBarChartRenderer.js.map +1 -1
  271. package/renderer/LegendRenderer.d.ts +32 -0
  272. package/renderer/LegendRenderer.js +98 -59
  273. package/renderer/LegendRenderer.js.map +1 -1
  274. package/renderer/LineChartRenderer.d.ts +38 -1
  275. package/renderer/LineChartRenderer.js +198 -113
  276. package/renderer/LineChartRenderer.js.map +1 -1
  277. package/renderer/LineRadarRenderer.d.ts +19 -0
  278. package/renderer/LineRadarRenderer.js +25 -1
  279. package/renderer/LineRadarRenderer.js.map +1 -1
  280. package/renderer/LineScatterCandleRadarRenderer.d.ts +11 -0
  281. package/renderer/LineScatterCandleRadarRenderer.js +26 -9
  282. package/renderer/LineScatterCandleRadarRenderer.js.map +1 -1
  283. package/renderer/PieChartRenderer.d.ts +45 -1
  284. package/renderer/PieChartRenderer.js +195 -122
  285. package/renderer/PieChartRenderer.js.map +1 -1
  286. package/renderer/RadarChartRenderer.d.ts +10 -0
  287. package/renderer/RadarChartRenderer.js +119 -77
  288. package/renderer/RadarChartRenderer.js.map +1 -1
  289. package/renderer/Renderer.d.ts +8 -0
  290. package/renderer/Renderer.js +5 -0
  291. package/renderer/Renderer.js.map +1 -1
  292. package/renderer/ScatterChartRenderer.d.ts +5 -5
  293. package/renderer/ScatterChartRenderer.js +51 -37
  294. package/renderer/ScatterChartRenderer.js.map +1 -1
  295. package/renderer/XAxisRenderer.d.ts +29 -4
  296. package/renderer/XAxisRenderer.js +128 -95
  297. package/renderer/XAxisRenderer.js.map +1 -1
  298. package/renderer/XAxisRendererHorizontalBarChart.d.ts +11 -0
  299. package/renderer/XAxisRendererHorizontalBarChart.js +75 -57
  300. package/renderer/XAxisRendererHorizontalBarChart.js.map +1 -1
  301. package/renderer/XAxisRendererRadarChart.d.ts +5 -0
  302. package/renderer/XAxisRendererRadarChart.js +26 -13
  303. package/renderer/XAxisRendererRadarChart.js.map +1 -1
  304. package/renderer/YAxisRenderer.d.ts +42 -5
  305. package/renderer/YAxisRenderer.js +126 -69
  306. package/renderer/YAxisRenderer.js.map +1 -1
  307. package/renderer/YAxisRendererHorizontalBarChart.d.ts +22 -1
  308. package/renderer/YAxisRendererHorizontalBarChart.js +80 -58
  309. package/renderer/YAxisRendererHorizontalBarChart.js.map +1 -1
  310. package/renderer/YAxisRendererRadarChart.js +62 -32
  311. package/renderer/YAxisRendererRadarChart.js.map +1 -1
  312. package/renderer/scatter/ChevronDownShapeRenderer.d.ts +4 -0
  313. package/renderer/scatter/ChevronDownShapeRenderer.js +5 -1
  314. package/renderer/scatter/ChevronDownShapeRenderer.js.map +1 -1
  315. package/renderer/scatter/ChevronUpShapeRenderer.d.ts +4 -0
  316. package/renderer/scatter/ChevronUpShapeRenderer.js +5 -1
  317. package/renderer/scatter/ChevronUpShapeRenderer.js.map +1 -1
  318. package/renderer/scatter/CircleShapeRenderer.d.ts +4 -0
  319. package/renderer/scatter/CircleShapeRenderer.js +8 -5
  320. package/renderer/scatter/CircleShapeRenderer.js.map +1 -1
  321. package/renderer/scatter/CrossShapeRenderer.d.ts +4 -0
  322. package/renderer/scatter/CrossShapeRenderer.js +5 -1
  323. package/renderer/scatter/CrossShapeRenderer.js.map +1 -1
  324. package/renderer/scatter/IShapeRenderer.d.ts +14 -0
  325. package/renderer/scatter/IShapeRenderer.js.map +1 -1
  326. package/renderer/scatter/SquareShapeRenderer.d.ts +4 -0
  327. package/renderer/scatter/SquareShapeRenderer.js +8 -5
  328. package/renderer/scatter/SquareShapeRenderer.js.map +1 -1
  329. package/renderer/scatter/TriangleShapeRenderer.d.ts +4 -0
  330. package/renderer/scatter/TriangleShapeRenderer.js +9 -5
  331. package/renderer/scatter/TriangleShapeRenderer.js.map +1 -1
  332. package/renderer/scatter/XShapeRenderer.d.ts +4 -0
  333. package/renderer/scatter/XShapeRenderer.js +5 -1
  334. package/renderer/scatter/XShapeRenderer.js.map +1 -1
  335. package/utils/ColorTemplate.d.ts +21 -1
  336. package/utils/ColorTemplate.js +21 -3
  337. package/utils/ColorTemplate.js.map +1 -1
  338. package/utils/HorizontalViewPortHandler.d.ts +3 -0
  339. package/utils/HorizontalViewPortHandler.js +3 -0
  340. package/utils/HorizontalViewPortHandler.js.map +1 -1
  341. package/utils/MPSize.d.ts +7 -0
  342. package/utils/ObjectPool.d.ts +56 -0
  343. package/utils/ObjectPool.js +66 -8
  344. package/utils/ObjectPool.js.map +1 -1
  345. package/utils/Transformer.d.ts +118 -0
  346. package/utils/Transformer.js +141 -7
  347. package/utils/Transformer.js.map +1 -1
  348. package/utils/TransformerHorizontalBarChart.d.ts +10 -0
  349. package/utils/TransformerHorizontalBarChart.js +18 -2
  350. package/utils/TransformerHorizontalBarChart.js.map +1 -1
  351. package/utils/Utils.d.ts +139 -17
  352. package/utils/Utils.js +185 -60
  353. package/utils/Utils.js.map +1 -1
  354. package/utils/ViewPortHandler.d.ts +234 -19
  355. package/utils/ViewPortHandler.js +306 -63
  356. package/utils/ViewPortHandler.js.map +1 -1
  357. package/utils/colors/colorful.js.map +1 -1
  358. package/utils/colors/joyful.js.map +1 -1
  359. package/utils/colors/liberty.js.map +1 -1
  360. package/utils/colors/material.js.map +1 -1
  361. package/utils/colors/pastel.js.map +1 -1
  362. package/utils/colors/vordiplom.js.map +1 -1
  363. package/charts/index.d.ts +0 -11
  364. package/charts/index.js +0 -15
  365. package/charts/index.js.map +0 -1
package/charts/Chart.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { PanGestureHandlerOptions, PinchGestureHandlerOptions, RotationGestureHandlerOptions, TapGestureHandlerOptions } from '@nativescript-community/gesturehandler';
2
2
  import { Canvas, CanvasView, Paint } from '@nativescript-community/ui-canvas';
3
- import { EventData } from '@nativescript/core';
3
+ import { EventData, Font } from '@nativescript/core';
4
4
  import { ChartAnimator, EasingFunction } from '../animation/ChartAnimator';
5
5
  import { Description } from '../components/Description';
6
6
  import { IMarker } from '../components/IMarker';
@@ -22,40 +22,134 @@ export interface HighlightEventData extends EventData {
22
22
  entry?: Entry;
23
23
  highlight?: Highlight;
24
24
  }
25
+ /**
26
+ * Baseclass of all Chart-Views.
27
+ *
28
+
29
+ */
25
30
  export declare abstract class Chart<U extends Entry, D extends IDataSet<U>, T extends ChartData<U, D>> extends CanvasView implements ChartInterface {
26
- abstract getYChartMin(): any;
27
- abstract getYChartMax(): any;
28
- abstract getMaxVisibleCount(): any;
31
+ abstract yChartMin: number;
32
+ abstract yChartMax: number;
33
+ abstract maxVisibleValueCount: number;
34
+ /**
35
+ * object that holds all data that was originally set for the chart, before
36
+ * it was modified or any filtering algorithms had been applied
37
+ */
29
38
  protected mData: T;
30
- protected mHighLightPerTapEnabled: any;
31
- private mDragDecelerationEnabled;
32
- private mDragDecelerationFrictionCoef;
33
- protected mDefaultValueFormatter: DefaultValueFormatter;
34
- protected mDescPaint: Paint;
35
- protected mInfoPaint: Paint;
36
- protected mXAxis: XAxis;
37
- protected mTouchEnabled: boolean;
38
- protected mDescription: Description;
39
+ /**
40
+ * Flag that indicates if highlighting per tap (touch) is enabled
41
+ */
42
+ protected mHighlightPerTapEnabled: boolean;
43
+ /**
44
+ * If set to true, chart continues to scroll after touch up
45
+ */
46
+ dragDecelerationEnabled: boolean;
47
+ /**
48
+ * Deceleration friction coefficient in [0 ; 1] interval, higher values
49
+ * indicate that speed will decrease slowly, for example if it set to 0, it
50
+ * will stop immediately. value must be < 1.0
51
+ */
52
+ dragDecelerationFrictionCoef: number;
53
+ /**
54
+ * the default IValueFormatter that has been determined by the chart
55
+ * considering the provided minimum and maximum values, number of digits depends on provided chart-data
56
+ */
57
+ defaultValueFormatter: DefaultValueFormatter;
58
+ /**
59
+ * palet object used for drawing the description text in the bottom right
60
+ * corner of the chart
61
+ */
62
+ descPaint: Paint;
63
+ /**
64
+ * palet object for drawing the information text when there are no values in
65
+ * the chart
66
+ */
67
+ mInfoPaint: Paint;
68
+ /**
69
+ * the object representing the labels on the x-axis
70
+ */
71
+ xAxis: XAxis;
72
+ /**
73
+ * if true, touch gestures are enabled on the chart
74
+ */
75
+ touchEnabled: boolean;
76
+ /**
77
+ * the object responsible for representing the description text
78
+ */
79
+ mDescription: Description;
80
+ /**
81
+ * the legend object containing all data associated with the legend
82
+ */
39
83
  protected mLegend: Legend;
40
- protected mChartTouchListener: ChartTouchListener<any>;
41
- private mNoDataText;
42
- protected mLegendRenderer: LegendRenderer;
43
- protected mRenderer: DataRenderer;
44
- protected mHighlighter: IHighlighter;
45
- protected mViewPortHandler: ViewPortHandler;
46
- protected mAnimator: ChartAnimator;
47
- private mExtraTopOffset;
48
- private mExtraRightOffset;
49
- private mExtraBottomOffset;
50
- private mExtraLeftOffset;
51
- protected mOffsetsCalculated: any;
52
- protected noComputeOnNextDraw: any;
53
- protected mIndicesToHighlight: Highlight[];
54
- protected mMaxHighlightDistance: number;
55
- protected mJobs: any[];
84
+ chartTouchListener: ChartTouchListener<any>;
85
+ /**
86
+ * text that is displayed when the chart is empty
87
+ */
88
+ noDataText: any;
89
+ /**
90
+ * Gesture listener for custom callbacks when making gestures on the chart.
91
+ */
92
+ legendRenderer: LegendRenderer;
93
+ /**
94
+ * object responsible for rendering the data
95
+ */
96
+ renderer: DataRenderer;
97
+ highlighter: IHighlighter;
98
+ /**
99
+ * object that manages the bounds and drawing constraints of the chart
100
+ */
101
+ viewPortHandler: ViewPortHandler;
102
+ /**
103
+ * object responsible for animations
104
+ */
105
+ animator: ChartAnimator;
106
+ /**
107
+ * Extra offsets to be appended to the viewport
108
+ */
109
+ extraTopOffset: number;
110
+ extraRightOffset: number;
111
+ extraBottomOffset: number;
112
+ extraLeftOffset: number;
113
+ /**
114
+ * flag that indicates if offsets calculation has already been done or not
115
+ */
116
+ protected offsetsCalculated: any;
117
+ /**
118
+ * let the chart know it does not need to compute autoScale
119
+ * (it can used the cached ones)
120
+ */
121
+ noComputeAutoScaleOnNextDraw: boolean;
122
+ /**
123
+ * let the chart know it does not need to compute axis and legends
124
+ * (it can used the cached ones)
125
+ */
126
+ noComputeAxisOnNextDraw: boolean;
127
+ /**
128
+ * array of Highlight objects that reference the highlighted slices in the
129
+ * chart
130
+ */
131
+ indicesToHighlight: Highlight[];
132
+ /**
133
+ * The maximum distance in dp away from an entry causing it to highlight.
134
+ */
135
+ maxHighlightDistance: number;
136
+ /**
137
+ * Wether to filter highlights by axis. Default is true
138
+ */
139
+ highlightsFilterByAxis: boolean;
140
+ /**
141
+ * tasks to be done after the view is setup
142
+ */
143
+ protected jobs: any[];
144
+ /**
145
+ * default constructor for initialization in code
146
+ */
56
147
  constructor();
57
148
  initNativeView(): void;
58
149
  disposeNativeView(): void;
150
+ /**
151
+ * initialize all paints and stuff
152
+ */
59
153
  protected init(): void;
60
154
  get infoPaint(): Paint;
61
155
  panGestureOptions: PanGestureHandlerOptions & {
@@ -73,102 +167,337 @@ export declare abstract class Chart<U extends Entry, D extends IDataSet<U>, T ex
73
167
  rotationGestureOptions: RotationGestureHandlerOptions & {
74
168
  gestureTag?: number;
75
169
  };
76
- setData(data: T): void;
170
+ /**
171
+ * Sets a new data object for the chart. The data object contains all values
172
+ * and information needed for displaying.
173
+ *
174
+ * @param data
175
+ */
176
+ set data(data: T);
177
+ /**
178
+ * Returns the ChartData object that has been set for the chart.
179
+ */
180
+ get data(): T;
181
+ get viewPortScaleX(): number;
182
+ get viewPortScaleY(): number;
183
+ /**
184
+ * Clears the chart from all data (sets it to null) and refreshes it (by
185
+ * calling invalidate()).
186
+ */
77
187
  clear(): void;
188
+ /**
189
+ * Removes all DataSets (and thereby Entries) from the chart. Does not set the data object to null. Also refreshes the
190
+ * chart by calling invalidate().
191
+ */
78
192
  clearValues(): void;
79
- length(): boolean;
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(): boolean;
198
+ /**
199
+ * Lets the chart know its underlying data has changed and performs all
200
+ * necessary recalculations. It is crucial that this method is called
201
+ * everytime data is changed dynamically. Not calling this method can lead
202
+ * to crashes or unexpected behaviour.
203
+ */
80
204
  abstract notifyDataSetChanged(): any;
205
+ /**
206
+ * Calculates the offsets of the chart to the border depending on the
207
+ * position of an eventual legend or depending on the length of the y-axis
208
+ * and x-axis labels and their position
209
+ */
81
210
  protected abstract calculateOffsets(force?: boolean): any;
211
+ /**
212
+ * Calculates the y-min and y-max value and the y-delta and x-delta value
213
+ */
82
214
  protected abstract calcMinMax(): any;
215
+ /**
216
+ * Calculates the required number of digits for the values that might be
217
+ * drawn in the chart (if enabled), and creates the default-value-formatter
218
+ */
83
219
  protected setupDefaultFormatter(min: any, max: any): void;
84
220
  onDraw(canvas: Canvas): void;
221
+ /**
222
+ * Draws the description text in the bottom right corner of the chart (per default)
223
+ */
85
224
  protected drawDescription(c: Canvas): void;
86
- getMaxHighlightDistance(): number;
87
- setMaxHighlightDistance(distDp: any): void;
88
- getHighlighted(): Highlight<Entry>[];
89
- isHighlightPerTapEnabled(): any;
90
- setHighlightPerTapEnabled(enabled: any): void;
91
- valuesToHighlight(): boolean;
92
- protected setLastHighlighted(highs: any): void;
225
+ /**
226
+ * Returns the array of currently highlighted values. This might a null or
227
+ * empty array if nothing is highlighted.
228
+ */
229
+ get highlighted(): Highlight<Entry>[];
230
+ /**
231
+ * Returns true if there are values to highlight, false if there are no
232
+ * values to highlight. Checks if the highlight array is null, has a length
233
+ * of zero or if the first object is null.
234
+ *
235
+ */
236
+ get hasValuesToHighlight(): boolean;
237
+ /**
238
+ * Sets the last highlighted value for the touchlistener.
239
+ *
240
+ * @param highs
241
+ */
242
+ protected set lastHighlighted(highs: any);
243
+ /**
244
+ * Highlights the values at the given indices in the given DataSets. Provide
245
+ * null or an empty array to undo all highlighting. This should be used to
246
+ * programmatically highlight values.
247
+ * This method *will not* call the listener.
248
+ *
249
+ * @param highs
250
+ */
93
251
  highlightValues(highs: any): void;
252
+ /**
253
+ * Highlights any y-value at the given x-value in the given DataSet.
254
+ * Provide -1 as the dataSetIndex to undo all highlighting.
255
+ * @param x The x-value to highlight
256
+ * @param y The y-value to highlight. Supply `NaN` for "any"
257
+ * @param dataSetIndex The dataset index to search in
258
+ * @param callListener Should the listener be called for this change
259
+ */
94
260
  highlightValue(x: any, y: any, dataSetIndex: any, callListener?: boolean): void;
95
- highlight(high: Highlight, callListener?: boolean): void;
261
+ /**
262
+ * Highlights the value selected by touch gesture. Unlike
263
+ * highlightValues(...), this generates a callback to the
264
+ * OnChartValueSelectedListener.
265
+ *
266
+ * @param high - the highlight object
267
+ * @param callListener - call the listener
268
+ */
269
+ highlight(high: Highlight | Highlight[], callListener?: boolean): void;
270
+ /**
271
+ * Highlights the value selected by touch gesture. Unlike
272
+ * highlightValues(...), this generates a callback to the
273
+ * OnChartValueSelectedListener.
274
+ *
275
+ * @param high - the highlight object
276
+ * @param callListener - call the listener
277
+ */
278
+ highlights(highs: Highlight[], callListener?: boolean): void;
279
+ /**
280
+ * Returns the Highlights (contains x-index and DataSet index) of the
281
+ * selected value at the given touch polet inside the Line-, Scatter-, or
282
+ * CandleStick-Chart.
283
+ *
284
+ * @param x
285
+ * @param y
286
+ * @return
287
+ */
288
+ getHighlightsByTouchPoint(x: any, y: any): Highlight<Entry>[];
289
+ /**
290
+ * Returns the Highlight object (contains x-index and DataSet index) of the
291
+ * selected value at the given touch polet inside the Line-, Scatter-, or
292
+ * CandleStick-Chart.
293
+ *
294
+ * @param x
295
+ * @param y
296
+ * @return
297
+ */
96
298
  getHighlightByTouchPoint(x: any, y: any): Highlight<Entry>;
299
+ /**
300
+ * Returns the Highlight object (contains x-index and DataSet index) of the
301
+ * selected value at the given touch polet inside the Line-, Scatter-, or
302
+ * CandleStick-Chart.
303
+ *
304
+ * @param x
305
+ * @param y
306
+ * @return
307
+ */
97
308
  getHighlightByXValue(xValue: any): Highlight<Entry>[];
98
- protected mDrawMarkers: boolean;
99
- protected mMarker: IMarker;
309
+ /**
310
+ * ################ ################ ################ ################
311
+ */
312
+ /** BELOW CODE IS FOR THE MARKER VIEW */
313
+ /**
314
+ * if set to true, the marker view is drawn when a value is clicked
315
+ */
316
+ drawMarkersEnabled: boolean;
317
+ /**
318
+ * the view that represents the marker
319
+ */
320
+ marker: IMarker;
321
+ /**
322
+ * draws all MarkerViews on the highlighted positions
323
+ */
100
324
  protected drawMarkers(canvas: Canvas): void;
325
+ /**
326
+ * Returns the actual position in pixels of the MarkerView for the given
327
+ * Highlight object.
328
+ *
329
+ * @param high
330
+ * @return
331
+ */
101
332
  protected getMarkerPosition(high: Highlight): number[];
102
- getAnimator(): ChartAnimator;
103
- isDragDecelerationEnabled(): boolean;
104
- setDragDecelerationEnabled(enabled: any): void;
105
- getDragDecelerationFrictionCoef(): number;
106
- setDragDecelerationFrictionCoef(newValue: any): void;
333
+ /**
334
+ * ################ ################ ################ ################
335
+ * ANIMATIONS ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
336
+ */
337
+ /** CODE BELOW THIS RELATED TO ANIMATION */
338
+ /**
339
+ * Returns the animator responsible for animating chart values.
340
+ */
341
+ get description(): Description;
342
+ /**
343
+ * ################ ################ ################ ################
344
+ * ANIMATIONS ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
345
+ */
346
+ /** CODE BELOW FOR PROVIDING EASING FUNCTIONS */
347
+ /**
348
+ * Animates the drawing / rendering of the chart on both x- and y-axis with
349
+ * the specified animation time. If animate(...) is called, no further
350
+ * calling of invalidate() is necessary to refresh the chart. ANIMATIONS
351
+ * ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
352
+ *
353
+ * @param durationMillisX
354
+ * @param durationMillisY
355
+ * @param easingX a custom easing function to be used on the animation phase
356
+ * @param easingY a custom easing function to be used on the animation phase
357
+ */
107
358
  animateXY(durationMillisX: any, durationMillisY: any, easingX?: EasingFunction, easingY?: EasingFunction): void;
359
+ /**
360
+ * Animates the rendering of the chart on the x-axis with the specified
361
+ * animation time. If animate(...) is called, no further calling of
362
+ * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
363
+ * API LEVEL 11 (Android 3.0.x) AND HIGHER.
364
+ *
365
+ * @param durationMillis
366
+ * @param easing a custom easing function to be used on the animation phase
367
+ */
108
368
  animateX(durationMillis: any, easing?: EasingFunction): void;
369
+ /**
370
+ * Animates the rendering of the chart on the y-axis with the specified
371
+ * animation time. If animate(...) is called, no further calling of
372
+ * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
373
+ * API LEVEL 11 (Android 3.0.x) AND HIGHER.
374
+ *
375
+ * @param durationMillis
376
+ * @param easing a custom easing function to be used on the animation phase
377
+ */
109
378
  animateY(durationMillis: any, easing?: EasingFunction): void;
110
- getXAxis(): XAxis;
111
- getDefaultValueFormatter(): DefaultValueFormatter;
112
- getYMax(): number;
113
- getYMin(): number;
114
- getXChartMax(): number;
115
- getXChartMin(): number;
116
- getXRange(): number;
117
- getCenter(): {
379
+ /**
380
+ * ################ ################ ################ ################
381
+ */
382
+ /** BELOW THIS ONLY GETTERS AND SETTERS */
383
+ /**
384
+ * returns the current y-max value across all DataSets
385
+ */
386
+ get yMax(): number;
387
+ /**
388
+ * returns the current y-min value across all DataSets
389
+ */
390
+ get yMin(): number;
391
+ get xChartMax(): number;
392
+ get xChartMin(): number;
393
+ get xRange(): number;
394
+ /**
395
+ * Returns a recyclable MPPointF instance.
396
+ * Returns the center polet of the chart (the whole View) in pixels.
397
+ */
398
+ get center(): {
118
399
  x: number;
119
400
  y: number;
120
401
  };
121
- getCenterOffsets(): {
402
+ /**
403
+ * Returns a recyclable MPPointF instance.
404
+ * Returns the center of the chart taking offsets under consideration.
405
+ * (returns the center of the content rectangle)
406
+ */
407
+ get centerOffsets(): {
122
408
  x: number;
123
409
  y: number;
124
410
  };
411
+ /**
412
+ * Sets extra offsets (around the chart view) to be appended to the
413
+ * auto-calculated offsets.
414
+ *
415
+ * @param left
416
+ * @param top
417
+ * @param right
418
+ * @param bottom
419
+ */
125
420
  setExtraOffsets(left: any, top: any, right: any, bottom: any): void;
126
- setExtraTopOffset(offset: any): void;
127
- getExtraTopOffset(): number;
128
- setExtraRightOffset(offset: any): void;
129
- getExtraRightOffset(): number;
130
- setExtraBottomOffset(offset: any): void;
131
- getExtraBottomOffset(): number;
132
- setExtraLeftOffset(offset: any): void;
133
- getExtraLeftOffset(): number;
134
- setNoDataText(text: any): void;
135
- setNoDataTextColor(color: any): void;
136
- setNoDataTextTypeface(tf: any): void;
137
- setTouchEnabled(enabled: any): void;
138
- setMarker(marker: IMarker): void;
139
- getMarker(): IMarker;
140
- setMarkerView(v: IMarker): void;
141
- getMarkerView(): IMarker;
142
- setDescription(desc: Description): void;
143
- getDescription(): Description;
144
- getLegend(): Legend;
145
- getLegendRenderer(): LegendRenderer;
146
- getContentRect(): import("@nativescript-community/ui-canvas").RectF;
147
- isDrawMarkerViewsEnabled(): boolean;
148
- setDrawMarkerViews(enabled: any): void;
149
- isDrawMarkersEnabled(): boolean;
150
- setDrawMarkers(enabled: any): void;
151
- getData(): T;
152
- getViewPortHandler(): ViewPortHandler;
153
- getRenderer(): DataRenderer;
154
- setRenderer(renderer: any): void;
155
- getHighlighter(): IHighlighter;
156
- setHighlighter(highlighter: IHighlighter): void;
157
- getCenterOfView(): {
421
+ /**
422
+ * Sets extra offsets (around the chart view) to be appended to the
423
+ * auto-calculated offsets.
424
+ *
425
+ * @param left
426
+ * @param top
427
+ * @param right
428
+ * @param bottom
429
+ */
430
+ set extraOffsets(value: [number, number, number, number]);
431
+ /**
432
+ * Sets the color of the no data text.
433
+ *
434
+ * @param color
435
+ */
436
+ set noDataTextColor(color: any);
437
+ /**
438
+ * Sets the typeface to be used for the no data text.
439
+ */
440
+ set noDataTextTypeface(tf: Font);
441
+ /**
442
+ * Returns the Legend object of the chart. This method can be used to get an
443
+ * instance of the legend in order to customize the automatically generated
444
+ * Legend.
445
+ */
446
+ get legend(): Legend;
447
+ /**
448
+ * Returns the rectangle that defines the borders of the chart-value surface
449
+ * (into which the actual values are drawn).
450
+ */
451
+ get contentRect(): import("@nativescript-community/ui-canvas").RectF;
452
+ /**
453
+ * Returns a recyclable MPPointF instance.
454
+ */
455
+ get centerOfView(): {
158
456
  x: number;
159
457
  y: number;
160
458
  };
161
- getChartBitmap(): void;
162
- saveToPath(title: any, pathOnSD: any): boolean;
163
- saveToGallery(fileName: any, subFolderPath: any, fileDescription: any, format: any, quality: any): void;
459
+ /**
460
+ * Flag that indicates if highlighting per tap (touch) is enabled
461
+ */
462
+ get highlightPerTapEnabled(): boolean;
463
+ /**
464
+ * Flag that indicates if highlighting per tap (touch) is enabled
465
+ */
466
+ set highlightPerTapEnabled(value: boolean);
467
+ /**
468
+ * Returns the bitmap that represents the chart.
469
+ */
470
+ get chartBitmap(): any;
164
471
  removeViewportJob(job: any): void;
165
472
  clearAllViewportJobs(): void;
473
+ /**
474
+ * Either posts a job immediately if the chart has already setup it's
475
+ * dimensions or adds the job to the execution queue.
476
+ *
477
+ * @param job
478
+ */
166
479
  addViewportJob(job: ViewPortJob): void;
480
+ /**
481
+ * Returns all jobs that are scheduled to be executed after
482
+ * onSizeChanged(...).
483
+ */
167
484
  getJobs(): any[];
168
485
  onSetWidthHeight(w: number, h: number): void;
169
486
  onLayout(left: number, top: number, right: number, bottom: number): void;
170
487
  onSizeChanged(w: number, h: number, oldw: number, oldh: number): void;
171
- setHardwareAccelerationEnabled(enabled: any): void;
488
+ /**
489
+ * Setting this to true will set the layer-type HARDWARE for the view, false
490
+ * will set layer-type SOFTWARE.
491
+ *
492
+ * @param enabled
493
+ */
494
+ set hardwareAccelerationEnabled(enabled: any);
495
+ /**
496
+ * disables intercept touchevents
497
+ */
172
498
  disableScroll(): void;
499
+ /**
500
+ * enables intercept touchevents
501
+ */
173
502
  enableScroll(): void;
174
503
  }