@nativescript-community/ui-chart 1.2.35 → 2.0.0
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.
- package/README.md +6 -0
- package/animation/ChartAnimator.d.ts +47 -4
- package/animation/ChartAnimator.js +49 -11
- package/animation/ChartAnimator.js.map +1 -1
- package/animation/Tween.d.ts +1 -1
- package/animation/Tween.js +4 -2
- package/animation/Tween.js.map +1 -1
- package/buffer/AbstractBuffer.d.ts +28 -3
- package/buffer/AbstractBuffer.js +22 -3
- package/buffer/AbstractBuffer.js.map +1 -1
- package/buffer/BarBuffer.d.ts +8 -12
- package/buffer/BarBuffer.js +33 -36
- package/buffer/BarBuffer.js.map +1 -1
- package/buffer/HorizontalBarBuffer.js +13 -10
- package/buffer/HorizontalBarBuffer.js.map +1 -1
- package/charts/BarChart.d.ts +70 -15
- package/charts/BarChart.js +92 -63
- package/charts/BarChart.js.map +1 -1
- package/charts/BarLineChartBase.d.ts +494 -73
- package/charts/BarLineChartBase.js +788 -407
- package/charts/BarLineChartBase.js.map +1 -1
- package/charts/BubbleChart.d.ts +11 -5
- package/charts/BubbleChart.js +10 -8
- package/charts/BubbleChart.js.map +1 -1
- package/charts/CandleStickChart.d.ts +8 -5
- package/charts/CandleStickChart.js +9 -10
- package/charts/CandleStickChart.js.map +1 -1
- package/charts/Chart.d.ts +424 -92
- package/charts/Chart.js +590 -290
- package/charts/Chart.js.map +1 -1
- package/charts/CombinedChart.d.ts +59 -29
- package/charts/CombinedChart.js +74 -67
- package/charts/CombinedChart.js.map +1 -1
- package/charts/HorizontalBarChart.d.ts +37 -7
- package/charts/HorizontalBarChart.js +97 -59
- package/charts/HorizontalBarChart.js.map +1 -1
- package/charts/LineChart.d.ts +3 -5
- package/charts/LineChart.js +6 -10
- package/charts/LineChart.js.map +1 -1
- package/charts/PieChart.d.ts +218 -64
- package/charts/PieChart.js +278 -168
- package/charts/PieChart.js.map +1 -1
- package/charts/PieRadarChartBase.d.ts +107 -18
- package/charts/PieRadarChartBase.js +156 -73
- package/charts/PieRadarChartBase.js.map +1 -1
- package/charts/RadarChart.d.ts +75 -35
- package/charts/RadarChart.js +114 -103
- package/charts/RadarChart.js.map +1 -1
- package/charts/ScatterChart.d.ts +10 -5
- package/charts/ScatterChart.js +11 -10
- package/charts/ScatterChart.js.map +1 -1
- package/components/AxisBase.d.ts +271 -101
- package/components/AxisBase.js +264 -254
- package/components/AxisBase.js.map +1 -1
- package/components/ComponentBase.d.ts +54 -19
- package/components/ComponentBase.js +60 -48
- package/components/ComponentBase.js.map +1 -1
- package/components/Description.d.ts +18 -9
- package/components/Description.js +12 -26
- package/components/Description.js.map +1 -1
- package/components/IMarker.d.ts +30 -1
- package/components/IMarker.js.map +1 -1
- package/components/Legend.d.ts +155 -58
- package/components/Legend.js +208 -172
- package/components/Legend.js.map +1 -1
- package/components/LegendEntry.d.ts +38 -0
- package/components/LegendEntry.js +34 -0
- package/components/LegendEntry.js.map +1 -1
- package/components/LimitLine.d.ts +40 -22
- package/components/LimitLine.js +44 -56
- package/components/LimitLine.js.map +1 -1
- package/components/MarkerImage.d.ts +1 -0
- package/components/MarkerImage.js +97 -0
- package/components/MarkerImage.js.map +1 -0
- package/components/XAxis.d.ts +41 -10
- package/components/XAxis.js +42 -24
- package/components/XAxis.js.map +1 -1
- package/components/YAxis.d.ts +114 -37
- package/components/YAxis.js +138 -106
- package/components/YAxis.js.map +1 -1
- package/data/BarData.d.ts +32 -4
- package/data/BarData.js +92 -24
- package/data/BarData.js.map +1 -1
- package/data/BarDataSet.d.ts +35 -18
- package/data/BarDataSet.js +42 -47
- package/data/BarDataSet.js.map +1 -1
- package/data/BarEntry.d.ts +3 -0
- package/data/BarEntry.js.map +1 -1
- package/data/BarLineScatterCandleBubbleData.d.ts +5 -0
- package/data/BarLineScatterCandleBubbleData.js +5 -0
- package/data/BarLineScatterCandleBubbleData.js.map +1 -1
- package/data/BarLineScatterCandleBubbleDataSet.d.ts +11 -3
- package/data/BarLineScatterCandleBubbleDataSet.js +11 -7
- package/data/BarLineScatterCandleBubbleDataSet.js.map +1 -1
- package/data/BaseDataSet.d.ts +129 -71
- package/data/BaseDataSet.js +146 -169
- package/data/BaseDataSet.js.map +1 -1
- package/data/BaseEntry.d.ts +3 -0
- package/data/BaseEntry.js.map +1 -1
- package/data/BubbleData.d.ts +7 -1
- package/data/BubbleData.js +8 -2
- package/data/BubbleData.js.map +1 -1
- package/data/BubbleDataSet.d.ts +7 -7
- package/data/BubbleDataSet.js +8 -15
- package/data/BubbleDataSet.js.map +1 -1
- package/data/BubbleEntry.d.ts +1 -0
- package/data/BubbleEntry.js.map +1 -1
- package/data/CandleData.js.map +1 -1
- package/data/CandleDataSet.d.ts +64 -30
- package/data/CandleDataSet.js +67 -74
- package/data/CandleDataSet.js.map +1 -1
- package/data/CandleEntry.d.ts +4 -0
- package/data/CandleEntry.js.map +1 -1
- package/data/ChartData.d.ts +273 -18
- package/data/ChartData.js +398 -93
- package/data/ChartData.js.map +1 -1
- package/data/CombinedData.d.ts +39 -12
- package/data/CombinedData.js +87 -71
- package/data/CombinedData.js.map +1 -1
- package/data/DataSet.d.ts +59 -8
- package/data/DataSet.js +114 -26
- package/data/DataSet.js.map +1 -1
- package/data/Entry.js.map +1 -1
- package/data/LineData.d.ts +5 -0
- package/data/LineData.js +5 -0
- package/data/LineData.js.map +1 -1
- package/data/LineDataSet.d.ts +80 -49
- package/data/LineDataSet.js +90 -135
- package/data/LineDataSet.js.map +1 -1
- package/data/LineRadarDataSet.d.ts +27 -17
- package/data/LineRadarDataSet.js +22 -35
- package/data/LineRadarDataSet.js.map +1 -1
- package/data/LineScatterCandleRadarDataSet.d.ts +30 -15
- package/data/LineScatterCandleRadarDataSet.js +36 -39
- package/data/LineScatterCandleRadarDataSet.js.map +1 -1
- package/data/PieData.d.ts +26 -0
- package/data/PieData.js +28 -2
- package/data/PieData.js.map +1 -1
- package/data/PieDataSet.d.ts +40 -36
- package/data/PieDataSet.js +36 -88
- package/data/PieDataSet.js.map +1 -1
- package/data/PieEntry.d.ts +3 -0
- package/data/PieEntry.js.map +1 -1
- package/data/RadarData.d.ts +10 -4
- package/data/RadarData.js +5 -6
- package/data/RadarData.js.map +1 -1
- package/data/RadarDataSet.d.ts +7 -21
- package/data/RadarDataSet.js +10 -49
- package/data/RadarDataSet.js.map +1 -1
- package/data/RadarEntry.js.map +1 -1
- package/data/ScatterData.d.ts +4 -1
- package/data/ScatterData.js +5 -2
- package/data/ScatterData.js.map +1 -1
- package/data/ScatterDataSet.d.ts +24 -14
- package/data/ScatterDataSet.js +26 -31
- package/data/ScatterDataSet.js.map +1 -1
- package/formatter/DefaultAxisValueFormatter.d.ts +17 -3
- package/formatter/DefaultAxisValueFormatter.js +12 -5
- package/formatter/DefaultAxisValueFormatter.js.map +1 -1
- package/formatter/DefaultFillFormatter.js +7 -7
- package/formatter/DefaultFillFormatter.js.map +1 -1
- package/formatter/DefaultValueFormatter.js.map +1 -1
- package/formatter/IAxisValueFormatter.d.ts +20 -2
- package/formatter/IAxisValueFormatter.js.map +1 -1
- package/formatter/IFillFormatter.d.ts +25 -0
- package/formatter/IFillFormatter.js.map +1 -1
- package/formatter/IValueFormatter.d.ts +21 -0
- package/formatter/IValueFormatter.js.map +1 -1
- package/formatter/ValueFormatter.d.ts +60 -0
- package/formatter/ValueFormatter.js +60 -0
- package/formatter/ValueFormatter.js.map +1 -1
- package/highlight/BarHighlighter.d.ts +22 -2
- package/highlight/BarHighlighter.js +43 -17
- package/highlight/BarHighlighter.js.map +1 -1
- package/highlight/ChartHighlighter.d.ts +87 -5
- package/highlight/ChartHighlighter.js +126 -23
- package/highlight/ChartHighlighter.js.map +1 -1
- package/highlight/CombinedHighlighter.d.ts +6 -0
- package/highlight/CombinedHighlighter.js +31 -16
- package/highlight/CombinedHighlighter.js.map +1 -1
- package/highlight/Highlight.d.ts +54 -1
- package/highlight/Highlight.js +5 -0
- package/highlight/Highlight.js.map +1 -1
- package/highlight/HorizontalBarHighlighter.d.ts +1 -1
- package/highlight/HorizontalBarHighlighter.js +14 -13
- package/highlight/HorizontalBarHighlighter.js.map +1 -1
- package/highlight/IHighlighter.d.ts +11 -1
- package/highlight/IHighlighter.js.map +1 -1
- package/highlight/PieHighlighter.js +2 -2
- package/highlight/PieHighlighter.js.map +1 -1
- package/highlight/PieRadarHighlighter.d.ts +12 -1
- package/highlight/PieRadarHighlighter.js +12 -4
- package/highlight/PieRadarHighlighter.js.map +1 -1
- package/highlight/RadarHighlighter.d.ts +12 -0
- package/highlight/RadarHighlighter.js +24 -10
- package/highlight/RadarHighlighter.js.map +1 -1
- package/index.d.ts +11 -0
- package/index.js +15 -0
- package/index.js.map +1 -0
- package/interfaces/dataprovider/BarDataProvider.d.ts +4 -4
- package/interfaces/dataprovider/BarLineScatterCandleBubbleDataProvider.d.ts +8 -3
- package/interfaces/dataprovider/BubbleDataProvider.d.ts +1 -1
- package/interfaces/dataprovider/CandleDataProvider.d.ts +1 -1
- package/interfaces/dataprovider/ChartInterface.d.ts +17 -22
- package/interfaces/dataprovider/CombinedDataProvider.d.ts +1 -1
- package/interfaces/dataprovider/LineDataProvider.d.ts +1 -1
- package/interfaces/dataprovider/ScatterDataProvider.d.ts +1 -1
- package/interfaces/datasets/IBarDataSet.d.ts +8 -22
- package/interfaces/datasets/IBarLineScatterCandleBubbleDataSet.d.ts +1 -3
- package/interfaces/datasets/IBubbleDataSet.d.ts +3 -9
- package/interfaces/datasets/ICandleDataSet.d.ts +44 -41
- package/interfaces/datasets/IDataSet.d.ts +35 -151
- package/interfaces/datasets/ILineDataSet.d.ts +15 -54
- package/interfaces/datasets/ILineRadarDataSet.d.ts +7 -28
- package/interfaces/datasets/ILineScatterCandleRadarDataSet.d.ts +5 -4
- package/interfaces/datasets/IPieDataSet.d.ts +22 -40
- package/interfaces/datasets/IRadarDataSet.d.ts +7 -13
- package/interfaces/datasets/IScatterDataSet.d.ts +17 -16
- package/jobs/AnimatedMoveViewJob.d.ts +3 -0
- package/jobs/AnimatedMoveViewJob.js +12 -8
- package/jobs/AnimatedMoveViewJob.js.map +1 -1
- package/jobs/AnimatedViewPortJob.d.ts +7 -8
- package/jobs/AnimatedViewPortJob.js +16 -23
- package/jobs/AnimatedViewPortJob.js.map +1 -1
- package/jobs/AnimatedZoomJob.d.ts +8 -5
- package/jobs/AnimatedZoomJob.js +30 -26
- package/jobs/AnimatedZoomJob.js.map +1 -1
- package/jobs/MoveViewJob.d.ts +3 -0
- package/jobs/MoveViewJob.js +10 -7
- package/jobs/MoveViewJob.js.map +1 -1
- package/jobs/ViewPortJob.d.ts +3 -5
- package/jobs/ViewPortJob.js +5 -11
- package/jobs/ViewPortJob.js.map +1 -1
- package/jobs/ZoomJob.js +14 -14
- package/jobs/ZoomJob.js.map +1 -1
- package/listener/BarLineChartTouchListener.d.ts +83 -1
- package/listener/BarLineChartTouchListener.js +169 -67
- package/listener/BarLineChartTouchListener.js.map +1 -1
- package/listener/ChartTouchListener.d.ts +39 -5
- package/listener/ChartTouchListener.js +38 -11
- package/listener/ChartTouchListener.js.map +1 -1
- package/listener/PieRadarChartTouchListener.d.ts +81 -1
- package/listener/PieRadarChartTouchListener.js +212 -16
- package/listener/PieRadarChartTouchListener.js.map +1 -1
- package/model/GradientColor.js.map +1 -1
- package/package.json +23 -15
- package/renderer/AxisRenderer.d.ts +66 -7
- package/renderer/AxisRenderer.js +69 -21
- package/renderer/AxisRenderer.js.map +1 -1
- package/renderer/BarChartRenderer.d.ts +11 -0
- package/renderer/BarChartRenderer.js +99 -71
- package/renderer/BarChartRenderer.js.map +1 -1
- package/renderer/BarLineScatterCandleBubbleRenderer.d.ts +37 -0
- package/renderer/BarLineScatterCandleBubbleRenderer.js +36 -8
- package/renderer/BarLineScatterCandleBubbleRenderer.js.map +1 -1
- package/renderer/BubbleChartRenderer.d.ts +6 -2
- package/renderer/BubbleChartRenderer.js +51 -40
- package/renderer/BubbleChartRenderer.js.map +1 -1
- package/renderer/CandleStickChartRenderer.d.ts +1 -1
- package/renderer/CandleStickChartRenderer.js +64 -50
- package/renderer/CandleStickChartRenderer.js.map +1 -1
- package/renderer/CombinedChartRenderer.d.ts +20 -1
- package/renderer/CombinedChartRenderer.js +72 -42
- package/renderer/CombinedChartRenderer.js.map +1 -1
- package/renderer/DataRenderer.d.ts +78 -4
- package/renderer/DataRenderer.js +65 -6
- package/renderer/DataRenderer.js.map +1 -1
- package/renderer/HorizontalBarChartRenderer.d.ts +5 -2
- package/renderer/HorizontalBarChartRenderer.js +87 -66
- package/renderer/HorizontalBarChartRenderer.js.map +1 -1
- package/renderer/LegendRenderer.d.ts +32 -0
- package/renderer/LegendRenderer.js +98 -59
- package/renderer/LegendRenderer.js.map +1 -1
- package/renderer/LineChartRenderer.d.ts +38 -1
- package/renderer/LineChartRenderer.js +185 -110
- package/renderer/LineChartRenderer.js.map +1 -1
- package/renderer/LineRadarRenderer.d.ts +19 -0
- package/renderer/LineRadarRenderer.js +25 -1
- package/renderer/LineRadarRenderer.js.map +1 -1
- package/renderer/LineScatterCandleRadarRenderer.d.ts +11 -0
- package/renderer/LineScatterCandleRadarRenderer.js +26 -9
- package/renderer/LineScatterCandleRadarRenderer.js.map +1 -1
- package/renderer/PieChartRenderer.d.ts +45 -1
- package/renderer/PieChartRenderer.js +195 -122
- package/renderer/PieChartRenderer.js.map +1 -1
- package/renderer/RadarChartRenderer.d.ts +10 -0
- package/renderer/RadarChartRenderer.js +119 -77
- package/renderer/RadarChartRenderer.js.map +1 -1
- package/renderer/Renderer.d.ts +8 -0
- package/renderer/Renderer.js +5 -0
- package/renderer/Renderer.js.map +1 -1
- package/renderer/ScatterChartRenderer.d.ts +5 -5
- package/renderer/ScatterChartRenderer.js +51 -37
- package/renderer/ScatterChartRenderer.js.map +1 -1
- package/renderer/XAxisRenderer.d.ts +29 -4
- package/renderer/XAxisRenderer.js +128 -95
- package/renderer/XAxisRenderer.js.map +1 -1
- package/renderer/XAxisRendererHorizontalBarChart.d.ts +11 -0
- package/renderer/XAxisRendererHorizontalBarChart.js +75 -57
- package/renderer/XAxisRendererHorizontalBarChart.js.map +1 -1
- package/renderer/XAxisRendererRadarChart.d.ts +5 -0
- package/renderer/XAxisRendererRadarChart.js +26 -13
- package/renderer/XAxisRendererRadarChart.js.map +1 -1
- package/renderer/YAxisRenderer.d.ts +42 -5
- package/renderer/YAxisRenderer.js +126 -69
- package/renderer/YAxisRenderer.js.map +1 -1
- package/renderer/YAxisRendererHorizontalBarChart.d.ts +22 -1
- package/renderer/YAxisRendererHorizontalBarChart.js +80 -58
- package/renderer/YAxisRendererHorizontalBarChart.js.map +1 -1
- package/renderer/YAxisRendererRadarChart.js +62 -32
- package/renderer/YAxisRendererRadarChart.js.map +1 -1
- package/renderer/scatter/ChevronDownShapeRenderer.d.ts +4 -0
- package/renderer/scatter/ChevronDownShapeRenderer.js +5 -1
- package/renderer/scatter/ChevronDownShapeRenderer.js.map +1 -1
- package/renderer/scatter/ChevronUpShapeRenderer.d.ts +4 -0
- package/renderer/scatter/ChevronUpShapeRenderer.js +5 -1
- package/renderer/scatter/ChevronUpShapeRenderer.js.map +1 -1
- package/renderer/scatter/CircleShapeRenderer.d.ts +4 -0
- package/renderer/scatter/CircleShapeRenderer.js +8 -5
- package/renderer/scatter/CircleShapeRenderer.js.map +1 -1
- package/renderer/scatter/CrossShapeRenderer.d.ts +4 -0
- package/renderer/scatter/CrossShapeRenderer.js +5 -1
- package/renderer/scatter/CrossShapeRenderer.js.map +1 -1
- package/renderer/scatter/IShapeRenderer.d.ts +14 -0
- package/renderer/scatter/IShapeRenderer.js.map +1 -1
- package/renderer/scatter/SquareShapeRenderer.d.ts +4 -0
- package/renderer/scatter/SquareShapeRenderer.js +8 -5
- package/renderer/scatter/SquareShapeRenderer.js.map +1 -1
- package/renderer/scatter/TriangleShapeRenderer.d.ts +4 -0
- package/renderer/scatter/TriangleShapeRenderer.js +9 -5
- package/renderer/scatter/TriangleShapeRenderer.js.map +1 -1
- package/renderer/scatter/XShapeRenderer.d.ts +4 -0
- package/renderer/scatter/XShapeRenderer.js +5 -1
- package/renderer/scatter/XShapeRenderer.js.map +1 -1
- package/utils/ColorTemplate.d.ts +21 -1
- package/utils/ColorTemplate.js +21 -3
- package/utils/ColorTemplate.js.map +1 -1
- package/utils/HorizontalViewPortHandler.d.ts +3 -0
- package/utils/HorizontalViewPortHandler.js +3 -0
- package/utils/HorizontalViewPortHandler.js.map +1 -1
- package/utils/MPSize.d.ts +7 -0
- package/utils/ObjectPool.d.ts +56 -0
- package/utils/ObjectPool.js +66 -8
- package/utils/ObjectPool.js.map +1 -1
- package/utils/Transformer.d.ts +118 -0
- package/utils/Transformer.js +141 -7
- package/utils/Transformer.js.map +1 -1
- package/utils/TransformerHorizontalBarChart.d.ts +10 -0
- package/utils/TransformerHorizontalBarChart.js +18 -2
- package/utils/TransformerHorizontalBarChart.js.map +1 -1
- package/utils/Utils.d.ts +139 -17
- package/utils/Utils.js +185 -60
- package/utils/Utils.js.map +1 -1
- package/utils/ViewPortHandler.d.ts +234 -19
- package/utils/ViewPortHandler.js +306 -63
- package/utils/ViewPortHandler.js.map +1 -1
- package/utils/colors/colorful.js.map +1 -1
- package/utils/colors/joyful.js.map +1 -1
- package/utils/colors/liberty.js.map +1 -1
- package/utils/colors/material.js.map +1 -1
- package/utils/colors/pastel.js.map +1 -1
- package/utils/colors/vordiplom.js.map +1 -1
- package/animation/ChartAnimator2.d.ts +0 -18
- package/animation/ChartAnimator2.js +0 -69
- package/animation/ChartAnimator2.js.map +0 -1
- package/charts/index.d.ts +0 -11
- package/charts/index.js +0 -15
- package/charts/index.js.map +0 -1
- package/utils/Curve.d.ts +0 -12
- package/utils/Curve.js +0 -156
- package/utils/Curve.js.map +0 -1
- package/utils/MPPointD.js +0 -1
- package/utils/MPPointD.js.map +0 -1
- package/utils/MPPointF.js +0 -1
- package/utils/MPPointF.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentBase } from './ComponentBase';
|
|
2
2
|
import { DashPathEffect } from '@nativescript-community/ui-canvas';
|
|
3
3
|
import { Color } from '@nativescript/core';
|
|
4
|
+
/** enum that indicates the position of the LimitLine label */
|
|
4
5
|
export declare enum LimitLabelPosition {
|
|
5
6
|
LEFT_TOP = 0,
|
|
6
7
|
LEFT_BOTTOM = 1,
|
|
@@ -9,29 +10,46 @@ export declare enum LimitLabelPosition {
|
|
|
9
10
|
RIGHT_TOP = 4,
|
|
10
11
|
RIGHT_BOTTOM = 5
|
|
11
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* The limit line is an additional feature for all Line-, Bar- and
|
|
15
|
+
* ScatterCharts. It allows the displaying of an additional line in the chart
|
|
16
|
+
* that marks a certain maximum / limit on the specified axis (x- or y-axis).
|
|
17
|
+
*
|
|
18
|
+
|
|
19
|
+
*/
|
|
12
20
|
export declare class LimitLine extends ComponentBase {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
/** limit / maximum (the y-value or xIndex) */
|
|
22
|
+
limit: number;
|
|
23
|
+
/** the width of the limit line
|
|
24
|
+
* thinner line === better performance, thicker line === worse performance
|
|
25
|
+
*/
|
|
26
|
+
lineWidth: number;
|
|
27
|
+
/** the color of the limit line */
|
|
28
|
+
lineColor: Color | string;
|
|
29
|
+
/** the style of the label text */
|
|
30
|
+
textStyle: globalAndroid.graphics.Paint.Style;
|
|
31
|
+
/** label string that is drawn next to the limit line */
|
|
32
|
+
label: string;
|
|
33
|
+
/** the path effect of this LimitLine that makes dashed lines possible */
|
|
34
|
+
dashPathEffect: DashPathEffect;
|
|
35
|
+
/** position of the LimitLine value label (either on the right or on
|
|
36
|
+
* the left edge of the chart). Not supported for RadarChart.
|
|
37
|
+
*/
|
|
38
|
+
labelPosition: LimitLabelPosition;
|
|
39
|
+
/**
|
|
40
|
+
* Constructor with limit and label.
|
|
41
|
+
*
|
|
42
|
+
* @param limit - the position (the value) on the y-axis (y-value) or x-axis
|
|
43
|
+
* (xIndex) where this line should appear
|
|
44
|
+
* @param label - provide "" if no label is required
|
|
45
|
+
*/
|
|
20
46
|
constructor(limit: any, label?: any);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Enables the line to be drawn in dashed mode, e.g. like this "- - - - - -"
|
|
49
|
+
*
|
|
50
|
+
* @param lineLength the length of the line pieces
|
|
51
|
+
* @param spaceLength the length of space inbetween the pieces
|
|
52
|
+
* @param phase offset, in degrees (normally, use 0)
|
|
53
|
+
*/
|
|
27
54
|
enableDashedLine(lineLength: any, spaceLength: any, phase: any): void;
|
|
28
|
-
disableDashedLine(): void;
|
|
29
|
-
isDashedLineEnabled(): boolean;
|
|
30
|
-
getDashPathEffect(): DashPathEffect;
|
|
31
|
-
setTextStyle(style: any): void;
|
|
32
|
-
getTextStyle(): globalAndroid.graphics.Paint.Style;
|
|
33
|
-
setLabelPosition(pos: any): void;
|
|
34
|
-
getLabelPosition(): LimitLabelPosition;
|
|
35
|
-
setLabel(label: any): void;
|
|
36
|
-
getLabel(): string;
|
|
37
55
|
}
|
package/components/LimitLine.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentBase } from './ComponentBase';
|
|
2
2
|
import { DashPathEffect, Style } from '@nativescript-community/ui-canvas';
|
|
3
|
+
/** enum that indicates the position of the LimitLine label */
|
|
3
4
|
export var LimitLabelPosition;
|
|
4
5
|
(function (LimitLabelPosition) {
|
|
5
6
|
LimitLabelPosition[LimitLabelPosition["LEFT_TOP"] = 0] = "LEFT_TOP";
|
|
@@ -9,66 +10,53 @@ export var LimitLabelPosition;
|
|
|
9
10
|
LimitLabelPosition[LimitLabelPosition["RIGHT_TOP"] = 4] = "RIGHT_TOP";
|
|
10
11
|
LimitLabelPosition[LimitLabelPosition["RIGHT_BOTTOM"] = 5] = "RIGHT_BOTTOM";
|
|
11
12
|
})(LimitLabelPosition || (LimitLabelPosition = {}));
|
|
13
|
+
/**
|
|
14
|
+
* The limit line is an additional feature for all Line-, Bar- and
|
|
15
|
+
* ScatterCharts. It allows the displaying of an additional line in the chart
|
|
16
|
+
* that marks a certain maximum / limit on the specified axis (x- or y-axis).
|
|
17
|
+
*
|
|
18
|
+
|
|
19
|
+
*/
|
|
12
20
|
export class LimitLine extends ComponentBase {
|
|
21
|
+
/**
|
|
22
|
+
* Constructor with limit and label.
|
|
23
|
+
*
|
|
24
|
+
* @param limit - the position (the value) on the y-axis (y-value) or x-axis
|
|
25
|
+
* (xIndex) where this line should appear
|
|
26
|
+
* @param label - provide "" if no label is required
|
|
27
|
+
*/
|
|
13
28
|
constructor(limit, label) {
|
|
14
29
|
super();
|
|
15
|
-
|
|
16
|
-
this.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.
|
|
21
|
-
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
/** limit / maximum (the y-value or xIndex) */
|
|
31
|
+
this.limit = 0;
|
|
32
|
+
/** the width of the limit line
|
|
33
|
+
* thinner line === better performance, thicker line === worse performance
|
|
34
|
+
*/
|
|
35
|
+
this.lineWidth = 2;
|
|
36
|
+
/** the color of the limit line */
|
|
37
|
+
this.lineColor = '#ED5B5B';
|
|
38
|
+
/** the style of the label text */
|
|
39
|
+
this.textStyle = Style.FILL;
|
|
40
|
+
/** label string that is drawn next to the limit line */
|
|
41
|
+
this.label = '';
|
|
42
|
+
/** the path effect of this LimitLine that makes dashed lines possible */
|
|
43
|
+
this.dashPathEffect = null;
|
|
44
|
+
/** position of the LimitLine value label (either on the right or on
|
|
45
|
+
* the left edge of the chart). Not supported for RadarChart.
|
|
46
|
+
*/
|
|
47
|
+
this.labelPosition = LimitLabelPosition.RIGHT_TOP;
|
|
48
|
+
this.limit = limit;
|
|
49
|
+
this.label = label;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Enables the line to be drawn in dashed mode, e.g. like this "- - - - - -"
|
|
53
|
+
*
|
|
54
|
+
* @param lineLength the length of the line pieces
|
|
55
|
+
* @param spaceLength the length of space inbetween the pieces
|
|
56
|
+
* @param phase offset, in degrees (normally, use 0)
|
|
57
|
+
*/
|
|
43
58
|
enableDashedLine(lineLength, spaceLength, phase) {
|
|
44
|
-
this.
|
|
45
|
-
}
|
|
46
|
-
disableDashedLine() {
|
|
47
|
-
this.mDashPathEffect = null;
|
|
48
|
-
}
|
|
49
|
-
isDashedLineEnabled() {
|
|
50
|
-
return this.mDashPathEffect == null ? false : true;
|
|
51
|
-
}
|
|
52
|
-
getDashPathEffect() {
|
|
53
|
-
return this.mDashPathEffect;
|
|
54
|
-
}
|
|
55
|
-
setTextStyle(style) {
|
|
56
|
-
this.mTextStyle = style;
|
|
57
|
-
}
|
|
58
|
-
getTextStyle() {
|
|
59
|
-
return this.mTextStyle;
|
|
60
|
-
}
|
|
61
|
-
setLabelPosition(pos) {
|
|
62
|
-
this.mLabelPosition = pos;
|
|
63
|
-
}
|
|
64
|
-
getLabelPosition() {
|
|
65
|
-
return this.mLabelPosition;
|
|
66
|
-
}
|
|
67
|
-
setLabel(label) {
|
|
68
|
-
this.mLabel = label;
|
|
69
|
-
}
|
|
70
|
-
getLabel() {
|
|
71
|
-
return this.mLabel;
|
|
59
|
+
this.dashPathEffect = new DashPathEffect([lineLength, spaceLength], phase);
|
|
72
60
|
}
|
|
73
61
|
}
|
|
74
62
|
//# sourceMappingURL=LimitLine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LimitLine.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file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97 @@
|
|
|
1
|
+
import { Rect } from '@nativescript-community/ui-canvas';
|
|
2
|
+
/**
|
|
3
|
+
* View that can be displayed when selecting values in the chart. Extend this class to provide custom layouts for your
|
|
4
|
+
* markers.
|
|
5
|
+
*
|
|
6
|
+
|
|
7
|
+
*/
|
|
8
|
+
class MarkerImage {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.mOffset = { x: 0, y: 0 };
|
|
11
|
+
this.mOffset2 = { x: 0, y: 0 };
|
|
12
|
+
this.mSize = { width: 0, height: 0 };
|
|
13
|
+
this.mDrawableBoundsCache = new Rect(0, 0, 0, 0);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Constructor. Sets up the MarkerView with a custom layout resource.
|
|
17
|
+
*
|
|
18
|
+
* @param context
|
|
19
|
+
* @param drawableResourceId the drawable resource to render
|
|
20
|
+
*/
|
|
21
|
+
MarkerImage(imageSource) {
|
|
22
|
+
this.imageSource = imageSource;
|
|
23
|
+
this.mDrawableBoundsCache.set(0, 0, imageSource.width, imageSource.height);
|
|
24
|
+
}
|
|
25
|
+
set offset(offset) {
|
|
26
|
+
this.mOffset = offset || { x: 0, y: 0 };
|
|
27
|
+
}
|
|
28
|
+
get offset() {
|
|
29
|
+
return this.mOffset;
|
|
30
|
+
}
|
|
31
|
+
set size(size) {
|
|
32
|
+
this.mSize = size || { width: 0, height: 0 };
|
|
33
|
+
}
|
|
34
|
+
get size() {
|
|
35
|
+
return this.mSize;
|
|
36
|
+
}
|
|
37
|
+
set chartView(chart) {
|
|
38
|
+
this.mWeakChart = new WeakRef(chart);
|
|
39
|
+
}
|
|
40
|
+
get chartView() {
|
|
41
|
+
return this.mWeakChart?.get();
|
|
42
|
+
}
|
|
43
|
+
getOffsetForDrawingAtPoint(posX, posY) {
|
|
44
|
+
const offset = this.offset;
|
|
45
|
+
this.mOffset2.x = offset.x;
|
|
46
|
+
this.mOffset2.y = offset.y;
|
|
47
|
+
const chart = this.chartView;
|
|
48
|
+
let width = this.mSize.width;
|
|
49
|
+
let height = this.mSize.height;
|
|
50
|
+
if (width === 0 && this.imageSource) {
|
|
51
|
+
width = this.imageSource.width;
|
|
52
|
+
}
|
|
53
|
+
if (height === 0 && this.imageSource) {
|
|
54
|
+
height = this.imageSource.height;
|
|
55
|
+
}
|
|
56
|
+
if (posX + this.mOffset2.x < 0) {
|
|
57
|
+
this.mOffset2.x = -posX;
|
|
58
|
+
}
|
|
59
|
+
else if (chart && posX + width + this.mOffset2.x > chart.getMeasuredWidth()) {
|
|
60
|
+
this.mOffset2.x = chart.getMeasuredWidth() - posX - width;
|
|
61
|
+
}
|
|
62
|
+
if (posY + this.mOffset2.y < 0) {
|
|
63
|
+
this.mOffset2.y = -posY;
|
|
64
|
+
}
|
|
65
|
+
else if (chart && posY + height + this.mOffset2.y > chart.getMeasuredHeight()) {
|
|
66
|
+
this.mOffset2.y = chart.getMeasuredHeight() - posY - height;
|
|
67
|
+
}
|
|
68
|
+
return this.mOffset2;
|
|
69
|
+
}
|
|
70
|
+
refreshContent(e, highlight) { }
|
|
71
|
+
draw(c, posX, posY) {
|
|
72
|
+
if (!this.imageSource)
|
|
73
|
+
return;
|
|
74
|
+
const offset = this.getOffsetForDrawingAtPoint(posX, posY);
|
|
75
|
+
let width = this.mSize.width;
|
|
76
|
+
let height = this.mSize.height;
|
|
77
|
+
if (width === 0 && this.imageSource) {
|
|
78
|
+
width = this.imageSource.width;
|
|
79
|
+
}
|
|
80
|
+
if (height === 0 && this.imageSource) {
|
|
81
|
+
height = this.imageSource.height;
|
|
82
|
+
}
|
|
83
|
+
// this.mDrawable.copyBounds(mDrawableBoundsCache);
|
|
84
|
+
// this.mDrawable.setBounds(
|
|
85
|
+
// this.mDrawableBoundsCache.left,
|
|
86
|
+
// this.mDrawableBoundsCache.top,
|
|
87
|
+
// this.mDrawableBoundsCache.left + width,
|
|
88
|
+
// this.mDrawableBoundsCache.top + height);
|
|
89
|
+
// c.save();
|
|
90
|
+
// translate to the correct position and draw
|
|
91
|
+
// c.translate(posX + offset.x, posY + offset.y);
|
|
92
|
+
c.drawBitmap(this.imageSource, this.mDrawableBoundsCache, new Rect(posX + offset.x, posY + offset.y, posX + offset.x + width, posY + offset.y + height), null);
|
|
93
|
+
// c.restore();
|
|
94
|
+
// this.mDrawable.setBounds(mDrawableBoundsCache);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=MarkerImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkerImage.js","sourceRoot":"","sources":["../../../src/ui-chart/components/MarkerImage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,IAAI,EAAE,MAAM,mCAAmC,CAAC;AAQjE;;;;;GAKG;AACH,MAAM,WAAW;IAAjB;QACY,YAAO,GAAa,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QACnC,aAAQ,GAAa,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAGpC,UAAK,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAChC,yBAAoB,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAsGxD,CAAC;IAnGG;;;;;OAKG;IACI,WAAW,CAAC,WAAwB;QACvC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/E,CAAC;IAED,IAAW,MAAM,CAAC,MAAgB;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAC5C,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,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MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;QACrC,CAAC;QAED,mDAAmD;QACnD,4BAA4B;QAC5B,0CAA0C;QAC1C,yCAAyC;QACzC,kDAAkD;QAClD,mDAAmD;QAEnD,YAAY;QACZ,6CAA6C;QAC7C,iDAAiD;QACjD,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,oBAAoB,EAAE,IAAI,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,KAAK,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;QAC/J,eAAe;QAEf,kDAAkD;IACtD,CAAC;CACJ"}
|
package/components/XAxis.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { AxisBase } from './AxisBase';
|
|
2
|
+
import { Chart } from '../charts/Chart';
|
|
3
|
+
/**
|
|
4
|
+
* enum for the position of the x-labels relative to the chart
|
|
5
|
+
*/
|
|
2
6
|
export declare enum XAxisPosition {
|
|
3
7
|
TOP = 0,
|
|
4
8
|
BOTTOM = 1,
|
|
@@ -6,19 +10,46 @@ export declare enum XAxisPosition {
|
|
|
6
10
|
TOP_INSIDE = 3,
|
|
7
11
|
BOTTOM_INSIDE = 4
|
|
8
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Class representing the x-axis labels settings. Only use the setter methods to
|
|
15
|
+
* modify it. Do not access public variables directly. Be aware that not all
|
|
16
|
+
* features the XLabels class provides are suitable for the RadarChart.
|
|
17
|
+
*
|
|
18
|
+
|
|
19
|
+
*/
|
|
9
20
|
export declare class XAxis extends AxisBase {
|
|
21
|
+
/**
|
|
22
|
+
* width of the x-axis labels in pixels - this is automatically
|
|
23
|
+
* calculated by the computeSize() methods in the renderers
|
|
24
|
+
*/
|
|
10
25
|
mLabelWidth: number;
|
|
26
|
+
/**
|
|
27
|
+
* height of the x-axis labels in pixels - this is automatically
|
|
28
|
+
* calculated by the computeSize() methods in the renderers
|
|
29
|
+
*/
|
|
11
30
|
mLabelHeight: number;
|
|
31
|
+
/**
|
|
32
|
+
* width of the (rotated) x-axis labels in pixels - this is automatically
|
|
33
|
+
* calculated by the computeSize() methods in the renderers
|
|
34
|
+
*/
|
|
12
35
|
mLabelRotatedWidth: number;
|
|
36
|
+
/**
|
|
37
|
+
* height of the (rotated) x-axis labels in pixels - this is automatically
|
|
38
|
+
* calculated by the computeSize() methods in the renderers
|
|
39
|
+
*/
|
|
13
40
|
mLabelRotatedHeight: number;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
41
|
+
/**
|
|
42
|
+
* This is the angle for drawing the X axis labels (in degrees)
|
|
43
|
+
*/
|
|
44
|
+
labelRotationAngle: number;
|
|
45
|
+
/**
|
|
46
|
+
* if set to true, the chart will avoid that the first and last label entry
|
|
47
|
+
* in the chart "clip" off the edge of the chart
|
|
48
|
+
*/
|
|
49
|
+
avoidFirstLastClipping: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* the position of the x-labels relative to the chart
|
|
52
|
+
*/
|
|
53
|
+
position: XAxisPosition;
|
|
54
|
+
constructor(chart: WeakRef<Chart<any, any, any>>);
|
|
24
55
|
}
|
package/components/XAxis.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { AxisBase } from './AxisBase';
|
|
2
|
+
/**
|
|
3
|
+
* enum for the position of the x-labels relative to the chart
|
|
4
|
+
*/
|
|
2
5
|
export var XAxisPosition;
|
|
3
6
|
(function (XAxisPosition) {
|
|
4
7
|
XAxisPosition[XAxisPosition["TOP"] = 0] = "TOP";
|
|
@@ -7,35 +10,50 @@ export var XAxisPosition;
|
|
|
7
10
|
XAxisPosition[XAxisPosition["TOP_INSIDE"] = 3] = "TOP_INSIDE";
|
|
8
11
|
XAxisPosition[XAxisPosition["BOTTOM_INSIDE"] = 4] = "BOTTOM_INSIDE";
|
|
9
12
|
})(XAxisPosition || (XAxisPosition = {}));
|
|
13
|
+
/**
|
|
14
|
+
* Class representing the x-axis labels settings. Only use the setter methods to
|
|
15
|
+
* modify it. Do not access public variables directly. Be aware that not all
|
|
16
|
+
* features the XLabels class provides are suitable for the RadarChart.
|
|
17
|
+
*
|
|
18
|
+
|
|
19
|
+
*/
|
|
10
20
|
export class XAxis extends AxisBase {
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
21
|
+
constructor(chart) {
|
|
22
|
+
super(chart);
|
|
23
|
+
/**
|
|
24
|
+
* width of the x-axis labels in pixels - this is automatically
|
|
25
|
+
* calculated by the computeSize() methods in the renderers
|
|
26
|
+
*/
|
|
13
27
|
this.mLabelWidth = 1;
|
|
28
|
+
/**
|
|
29
|
+
* height of the x-axis labels in pixels - this is automatically
|
|
30
|
+
* calculated by the computeSize() methods in the renderers
|
|
31
|
+
*/
|
|
14
32
|
this.mLabelHeight = 1;
|
|
33
|
+
/**
|
|
34
|
+
* width of the (rotated) x-axis labels in pixels - this is automatically
|
|
35
|
+
* calculated by the computeSize() methods in the renderers
|
|
36
|
+
*/
|
|
15
37
|
this.mLabelRotatedWidth = 1;
|
|
38
|
+
/**
|
|
39
|
+
* height of the (rotated) x-axis labels in pixels - this is automatically
|
|
40
|
+
* calculated by the computeSize() methods in the renderers
|
|
41
|
+
*/
|
|
16
42
|
this.mLabelRotatedHeight = 1;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
setLabelRotationAngle(angle) {
|
|
32
|
-
this.mLabelRotationAngle = angle;
|
|
33
|
-
}
|
|
34
|
-
setAvoidFirstLastClipping(enabled) {
|
|
35
|
-
this.mAvoidFirstLastClipping = enabled;
|
|
36
|
-
}
|
|
37
|
-
isAvoidFirstLastClippingEnabled() {
|
|
38
|
-
return this.mAvoidFirstLastClipping;
|
|
43
|
+
/**
|
|
44
|
+
* This is the angle for drawing the X axis labels (in degrees)
|
|
45
|
+
*/
|
|
46
|
+
this.labelRotationAngle = 0;
|
|
47
|
+
/**
|
|
48
|
+
* if set to true, the chart will avoid that the first and last label entry
|
|
49
|
+
* in the chart "clip" off the edge of the chart
|
|
50
|
+
*/
|
|
51
|
+
this.avoidFirstLastClipping = true;
|
|
52
|
+
/**
|
|
53
|
+
* the position of the x-labels relative to the chart
|
|
54
|
+
*/
|
|
55
|
+
this.position = XAxisPosition.TOP;
|
|
56
|
+
this.yOffset = 4;
|
|
39
57
|
}
|
|
40
58
|
}
|
|
41
59
|
//# sourceMappingURL=XAxis.js.map
|
package/components/XAxis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XAxis.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"XAxis.js","sourceRoot":"","sources":["../../../src/ui-chart/components/XAxis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC;;GAEG;AACH,MAAM,CAAN,IAAY,aAMX;AAND,WAAY,aAAa;IACrB,+CAAG,CAAA;IACH,qDAAM,CAAA;IACN,6DAAU,CAAA;IACV,6DAAU,CAAA;IACV,mEAAa,CAAA;AACjB,CAAC,EANW,aAAa,KAAb,aAAa,QAMxB;AAED;;;;;;GAMG;AACH,MAAM,OAAO,KAAM,SAAQ,QAAQ;IAyC/B,YAAY,KAAoC;QAC5C,KAAK,CAAC,KAAK,CAAC,CAAC;QAzCjB;;;WAGG;QACI,gBAAW,GAAG,CAAC,CAAC;QAEvB;;;WAGG;QACI,iBAAY,GAAG,CAAC,CAAC;QAExB;;;WAGG;QACI,uBAAkB,GAAG,CAAC,CAAC;QAE9B;;;WAGG;QACI,wBAAmB,GAAG,CAAC,CAAC;QAE/B;;WAEG;QACH,uBAAkB,GAAG,CAAC,CAAC;QAEvB;;;WAGG;QACH,2BAAsB,GAAG,IAAI,CAAC;QAE9B;;WAEG;QACH,aAAQ,GAAG,aAAa,CAAC,GAAG,CAAC;QAIzB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACrB,CAAC;CACJ"}
|
package/components/YAxis.d.ts
CHANGED
|
@@ -1,58 +1,135 @@
|
|
|
1
|
-
import { AxisBase } from './AxisBase';
|
|
2
1
|
import { Paint } from '@nativescript-community/ui-canvas';
|
|
2
|
+
import { AxisBase } from './AxisBase';
|
|
3
|
+
import { Chart } from '../charts/Chart';
|
|
4
|
+
/**
|
|
5
|
+
* Enum that specifies the axis a DataSet should be plotted against, either LEFT or RIGHT.
|
|
6
|
+
*
|
|
7
|
+
|
|
8
|
+
*/
|
|
3
9
|
export declare enum AxisDependency {
|
|
4
10
|
LEFT = 0,
|
|
5
11
|
RIGHT = 1
|
|
6
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* enum for the position of the y-labels relative to the chart
|
|
15
|
+
*/
|
|
7
16
|
export declare enum YAxisLabelPosition {
|
|
8
17
|
OUTSIDE_CHART = 0,
|
|
9
18
|
INSIDE_CHART = 1
|
|
10
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Class representing the y-axis labels settings and its entries. Only use the setter methods to
|
|
22
|
+
* modify it. Do not
|
|
23
|
+
* access public variables directly. Be aware that not all features the YLabels class provides
|
|
24
|
+
* are suitable for the
|
|
25
|
+
* RadarChart. Customizations that affect the value range of the axis need to be applied before
|
|
26
|
+
* setting data for the
|
|
27
|
+
* chart.
|
|
28
|
+
*
|
|
29
|
+
|
|
30
|
+
*/
|
|
11
31
|
export declare class YAxis extends AxisBase {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
32
|
+
/**
|
|
33
|
+
* indicates if the bottom y-label entry is drawn or not
|
|
34
|
+
*/
|
|
35
|
+
drawBottomYLabelEntry: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* indicates if the top y-label entry is drawn or not
|
|
38
|
+
*/
|
|
39
|
+
drawTopYLabelEntry: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* flag that indicates if the axis is inverted or not
|
|
42
|
+
*/
|
|
43
|
+
inverted: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* flag that indicates if the zero-line should be drawn regardless of other grid lines
|
|
46
|
+
*/
|
|
47
|
+
drawZeroLine: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* flag indicating that auto scale min restriction should be used
|
|
50
|
+
*/
|
|
16
51
|
private mUseAutoScaleRestrictionMin;
|
|
52
|
+
/**
|
|
53
|
+
* flag indicating that auto scale max restriction should be used
|
|
54
|
+
*/
|
|
17
55
|
private mUseAutoScaleRestrictionMax;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Color of the zero line
|
|
58
|
+
*/
|
|
59
|
+
zeroLineColor: string;
|
|
60
|
+
/**
|
|
61
|
+
* Width of the zero line in pixels
|
|
62
|
+
*/
|
|
63
|
+
zeroLineWidth: number;
|
|
64
|
+
/**
|
|
65
|
+
* axis space from the largest value to the top in percent of the total axis range
|
|
66
|
+
*/
|
|
67
|
+
spaceTop: number;
|
|
68
|
+
/**
|
|
69
|
+
* axis space from the smallest value to the bottom in percent of the total axis range
|
|
70
|
+
*/
|
|
71
|
+
spaceBottom: number;
|
|
72
|
+
/**
|
|
73
|
+
* the position of the y-labels relative to the chart
|
|
74
|
+
*/
|
|
75
|
+
position: YAxisLabelPosition;
|
|
76
|
+
/**
|
|
77
|
+
* the side this axis object represents
|
|
78
|
+
*/
|
|
79
|
+
axisDependency: AxisDependency;
|
|
80
|
+
/**
|
|
81
|
+
* the minimum width that the axis should take (in dp).
|
|
82
|
+
* <p/>
|
|
83
|
+
* default: 0.0
|
|
84
|
+
*/
|
|
85
|
+
minWidth: number;
|
|
86
|
+
/**
|
|
87
|
+
* the maximum width that the axis can take (in dp).
|
|
88
|
+
* use Inifinity for disabling the maximum
|
|
89
|
+
* default: Number.POSITIVE_INFINITY (no maximum specified)
|
|
90
|
+
*/
|
|
91
|
+
maxWidth: number;
|
|
92
|
+
constructor(position: AxisDependency, chart: WeakRef<Chart<any, any, any>>);
|
|
93
|
+
/**
|
|
94
|
+
* This method is deprecated.
|
|
95
|
+
* Use setAxisMinimum(...) / setAxisMaximum(...) instead.
|
|
96
|
+
*
|
|
97
|
+
* @param startAtZero
|
|
98
|
+
*/
|
|
39
99
|
setStartAtZero(startAtZero: any): void;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
getZeroLineColor(): string;
|
|
47
|
-
setZeroLineColor(color: any): void;
|
|
48
|
-
getZeroLineWidth(): number;
|
|
49
|
-
setZeroLineWidth(width: any): void;
|
|
100
|
+
/**
|
|
101
|
+
* This is for normal (not horizontal) charts horizontal spacing.
|
|
102
|
+
*
|
|
103
|
+
* @param p
|
|
104
|
+
* @return
|
|
105
|
+
*/
|
|
50
106
|
getRequiredWidthSpace(p: Paint): number;
|
|
107
|
+
/**
|
|
108
|
+
* This is for HorizontalBarChart vertical spacing.
|
|
109
|
+
*
|
|
110
|
+
* @param p
|
|
111
|
+
* @return
|
|
112
|
+
*/
|
|
51
113
|
getRequiredHeightSpace(p: Paint): number;
|
|
52
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Returns true if this axis needs horizontal offset, false if no offset is needed.
|
|
116
|
+
*/
|
|
117
|
+
get needsOffset(): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Returns true if autoscale restriction for axis min value is enabled
|
|
120
|
+
*/
|
|
53
121
|
isUseAutoScaleMinRestriction(): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Sets autoscale restriction for axis min value as enabled/disabled
|
|
124
|
+
*/
|
|
54
125
|
setUseAutoScaleMinRestriction(isEnabled: any): void;
|
|
126
|
+
/**
|
|
127
|
+
* Returns true if autoscale restriction for axis max value is enabled
|
|
128
|
+
*/
|
|
55
129
|
isUseAutoScaleMaxRestriction(): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Sets autoscale restriction for axis max value as enabled/disabled
|
|
132
|
+
*/
|
|
56
133
|
setUseAutoScaleMaxRestriction(isEnabled: any): void;
|
|
57
134
|
calculate(dataMin: any, dataMax: any): void;
|
|
58
135
|
}
|