@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultAxisValueFormatter.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"DefaultAxisValueFormatter.js","sourceRoot":"","sources":["../../../src/ui-chart/formatter/DefaultAxisValueFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAWzD;;;;;OAKG;IACH,YAAY,MAAM;QACd,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,MAAM;QACR,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAE5B,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,CAAC,IAAI,GAAG,CAAC;QACb,CAAC;QACD,kEAAkE;QAClE,IAAI,CAAC,OAAO,GAAG,kBAAkB,GAAG,CAAC,CAAC;IAC1C,CAAC;IAEM,iBAAiB,CAAC,KAAK;QAC1B,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;CACJ"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
export class DefaultFillFormatter {
|
|
2
2
|
getFillLinePosition(dataSet, dataProvider) {
|
|
3
3
|
let fillMin = 0;
|
|
4
|
-
const chartMaxY = dataProvider.
|
|
5
|
-
const chartMinY = dataProvider.
|
|
6
|
-
const data = dataProvider.
|
|
7
|
-
if (dataSet.
|
|
4
|
+
const chartMaxY = dataProvider.yChartMax;
|
|
5
|
+
const chartMinY = dataProvider.yChartMin;
|
|
6
|
+
const data = dataProvider.lineData;
|
|
7
|
+
if (dataSet.yMax > 0 && dataSet.yMin < 0) {
|
|
8
8
|
fillMin = 0;
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
11
11
|
let max, min;
|
|
12
|
-
if (data.
|
|
12
|
+
if (data.yMax > 0) {
|
|
13
13
|
max = 0;
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
16
|
max = chartMaxY;
|
|
17
17
|
}
|
|
18
|
-
if (data.
|
|
18
|
+
if (data.yMin < 0) {
|
|
19
19
|
min = 0;
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
22
|
min = chartMinY;
|
|
23
23
|
}
|
|
24
|
-
fillMin = dataSet.
|
|
24
|
+
fillMin = dataSet.yMin >= 0 ? min : max;
|
|
25
25
|
}
|
|
26
26
|
return fillMin;
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultFillFormatter.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"DefaultFillFormatter.js","sourceRoot":"","sources":["../../../src/ui-chart/formatter/DefaultFillFormatter.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,oBAAoB;IACtB,mBAAmB,CAAC,OAAqB,EAAE,YAA8B;QAC5E,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC;QACzC,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC;QAEzC,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC;QAEnC,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACvC,OAAO,GAAG,CAAC,CAAC;QAChB,CAAC;aAAM,CAAC;YACJ,IAAI,GAAG,EAAE,GAAG,CAAC;YAEb,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBAChB,GAAG,GAAG,CAAC,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACJ,GAAG,GAAG,SAAS,CAAC;YACpB,CAAC;YACD,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBAChB,GAAG,GAAG,CAAC,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACJ,GAAG,GAAG,SAAS,CAAC;YACpB,CAAC;YAED,OAAO,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QAC5C,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultValueFormatter.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"DefaultValueFormatter.js","sourceRoot":"","sources":["../../../src/ui-chart/formatter/DefaultValueFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,MAAM,OAAO,qBAAsB,SAAQ,yBAAyB;CAAG"}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { AxisBase } from '../components/AxisBase';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Created by Philipp Jahoda on 20/09/15.
|
|
4
|
+
* Custom formatter interface that allows formatting of
|
|
5
|
+
* axis labels before they are being drawn.
|
|
6
|
+
*
|
|
7
|
+
* Extend {@link ValueFormatter} instead
|
|
8
|
+
*/
|
|
3
9
|
export interface IAxisValueFormatter {
|
|
4
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Called when a value from an axis is to be formatted
|
|
12
|
+
* before being drawn. For performance reasons, avoid excessive calculations
|
|
13
|
+
* and memory allocations inside this method.
|
|
14
|
+
*
|
|
15
|
+
* @param value the value to be formatted
|
|
16
|
+
* @param axis the axis the value belongs to
|
|
17
|
+
* @param viewPortHandler the viewPortHandler
|
|
18
|
+
* @return
|
|
19
|
+
*
|
|
20
|
+
* Extend {@link ValueFormatter} and use {@link ValueFormatter#getAxisLabel(float, AxisBase)}
|
|
21
|
+
*/
|
|
22
|
+
getAxisLabel(value: any, axis: AxisBase): string;
|
|
5
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAxisValueFormatter.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"IAxisValueFormatter.js","sourceRoot":"","sources":["../../../src/ui-chart/formatter/IAxisValueFormatter.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import { ILineDataSet } from '../interfaces/datasets/ILineDataSet';
|
|
2
2
|
import { LineDataProvider } from '../interfaces/dataprovider/LineDataProvider';
|
|
3
|
+
import { Path } from '@nativescript-community/ui-canvas';
|
|
4
|
+
/**
|
|
5
|
+
* Interface for providing a custom logic to where the filling line of a LineDataSet
|
|
6
|
+
* should end. This of course only works if setFillEnabled(...) is set to true.
|
|
7
|
+
*
|
|
8
|
+
|
|
9
|
+
*/
|
|
3
10
|
export interface IFillFormatter {
|
|
11
|
+
/**
|
|
12
|
+
* Returns the vertical (y-axis) position where the filled-line of the
|
|
13
|
+
* LineDataSet should end.
|
|
14
|
+
*
|
|
15
|
+
* @param dataSet the ILineDataSet that is currently drawn
|
|
16
|
+
* @param dataProvider
|
|
17
|
+
* @return
|
|
18
|
+
*/
|
|
4
19
|
getFillLinePosition(dataSet: ILineDataSet, dataProvider: LineDataProvider): any;
|
|
20
|
+
/**
|
|
21
|
+
* update the fill line Path for the dataset
|
|
22
|
+
*
|
|
23
|
+
* @param dataSet the ILineDataSet that is currently drawn
|
|
24
|
+
* @param dataProvider
|
|
25
|
+
* @param linePath
|
|
26
|
+
* @param lastLinePath
|
|
27
|
+
* @return
|
|
28
|
+
*/
|
|
29
|
+
getFillLinePath?(dataSet: ILineDataSet, dataProvider: LineDataProvider, linePath: Path, lastLinePath: Path): any;
|
|
5
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IFillFormatter.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"IFillFormatter.js","sourceRoot":"","sources":["../../../src/ui-chart/formatter/IFillFormatter.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import { Entry } from '../data/Entry';
|
|
2
|
+
/**
|
|
3
|
+
* Interface to format all values before they are drawn as labels.
|
|
4
|
+
*
|
|
5
|
+
|
|
6
|
+
* Extend {@link ValueFormatter} instead
|
|
7
|
+
*/
|
|
2
8
|
export interface IValueFormatter {
|
|
9
|
+
/**
|
|
10
|
+
* Called when a value (from labels inside the chart) is formatted
|
|
11
|
+
* before being drawn. For performance reasons, avoid excessive calculations
|
|
12
|
+
* and memory allocations inside this method.
|
|
13
|
+
*
|
|
14
|
+
* @param value the value to be formatted
|
|
15
|
+
* @param entry the entry the value belongs to - in e.g. BarChart, this is of class BarEntry
|
|
16
|
+
* @param index index of the drawn value
|
|
17
|
+
* @param count total number of values drawn (useful to draw first or last)
|
|
18
|
+
* @param dataSetIndex the index of the DataSet the entry in focus belongs to
|
|
19
|
+
* @param viewPortHandler provides information about the current chart state (scale, translation, ...)
|
|
20
|
+
* @return the formatted label ready for being drawn
|
|
21
|
+
*
|
|
22
|
+
* @deprecated Extend {@link ValueFormatter} and override an appropriate method
|
|
23
|
+
*/
|
|
3
24
|
getFormattedValue(value: number, entry: Entry, index: any, count: any, dataSetIndex: any, viewPortHandler: any): string;
|
|
4
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IValueFormatter.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"IValueFormatter.js","sourceRoot":"","sources":["../../../src/ui-chart/formatter/IValueFormatter.ts"],"names":[],"mappings":""}
|
|
@@ -8,14 +8,74 @@ import { RadarEntry } from '../data/RadarEntry';
|
|
|
8
8
|
import { BubbleEntry } from '../data/BubbleEntry';
|
|
9
9
|
import { CandleEntry } from '../data/CandleEntry';
|
|
10
10
|
import { BaseEntry } from '../data/BaseEntry';
|
|
11
|
+
/**
|
|
12
|
+
* Class to format all values before they are drawn as labels.
|
|
13
|
+
*/
|
|
11
14
|
export declare abstract class ValueFormatter implements IAxisValueFormatter, IValueFormatter {
|
|
15
|
+
/**
|
|
16
|
+
* Called when drawing any label, used to change numbers into formatted strings.
|
|
17
|
+
*
|
|
18
|
+
* @param value float to be formatted
|
|
19
|
+
* @return formatted string label
|
|
20
|
+
*/
|
|
12
21
|
getFormattedValue(value: number, entry?: BaseEntry): string;
|
|
22
|
+
/**
|
|
23
|
+
* Used to draw axis labels, calls {@link #getFormattedValue} by default.
|
|
24
|
+
*
|
|
25
|
+
* @param value float to be formatted
|
|
26
|
+
* @param axis axis being labeled
|
|
27
|
+
* @return formatted string label
|
|
28
|
+
*/
|
|
13
29
|
getAxisLabel(value: number, axis: AxisBase): string;
|
|
30
|
+
/**
|
|
31
|
+
* Used to draw bar labels, calls {@link #getFormattedValue} by default.
|
|
32
|
+
*
|
|
33
|
+
* @param value current value to be formatted
|
|
34
|
+
* @return formatted string label
|
|
35
|
+
*/
|
|
14
36
|
getBarLabel(value: any, entry: BarEntry): string;
|
|
37
|
+
/**
|
|
38
|
+
* Used to draw stacked bar labels, calls {@link #getFormattedValue} by default.
|
|
39
|
+
*
|
|
40
|
+
* @param value current value to be formatted
|
|
41
|
+
* @param entry stacked entry being labeled, contains all Y values
|
|
42
|
+
* @return formatted string label
|
|
43
|
+
*/
|
|
15
44
|
getBarStackedLabel(value: any, entry: BarEntry): string;
|
|
45
|
+
/**
|
|
46
|
+
* Used to draw line and scatter labels, calls {@link #getFormattedValue} by default.
|
|
47
|
+
*
|
|
48
|
+
* @param entry point being labeled, contains X value
|
|
49
|
+
* @return formatted string label
|
|
50
|
+
*/
|
|
16
51
|
getPointLabel(value: any, entry: Entry): string;
|
|
52
|
+
/**
|
|
53
|
+
* Used to draw pie value labels, calls {@link #getFormattedValue} by default.
|
|
54
|
+
*
|
|
55
|
+
* @param value float to be formatted, may have been converted to percentage
|
|
56
|
+
* @param entry slice being labeled, contains original, non-percentage Y value
|
|
57
|
+
* @return formatted string label
|
|
58
|
+
*/
|
|
17
59
|
getPieLabel(value: any, entry: PieEntry): string;
|
|
60
|
+
/**
|
|
61
|
+
* Used to draw radar value labels, calls {@link #getFormattedValue} by default.
|
|
62
|
+
*
|
|
63
|
+
* @param entry entry being labeled
|
|
64
|
+
* @return formatted string label
|
|
65
|
+
*/
|
|
18
66
|
getRadarLabel(value: any, entry: RadarEntry): string;
|
|
67
|
+
/**
|
|
68
|
+
* Used to draw bubble size labels, calls {@link #getFormattedValue} by default.
|
|
69
|
+
*
|
|
70
|
+
* @param entry bubble being labeled, also contains X and Y values
|
|
71
|
+
* @return formatted string label
|
|
72
|
+
*/
|
|
19
73
|
getBubbleLabel(value: any, entry: BubbleEntry): string;
|
|
74
|
+
/**
|
|
75
|
+
* Used to draw high labels, calls {@link #getFormattedValue} by default.
|
|
76
|
+
*
|
|
77
|
+
* @param entry candlestick being labeled
|
|
78
|
+
* @return formatted string label
|
|
79
|
+
*/
|
|
20
80
|
getCandleLabel(value: any, entry: CandleEntry): string;
|
|
21
81
|
}
|
|
@@ -1,28 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Class to format all values before they are drawn as labels.
|
|
3
|
+
*/
|
|
1
4
|
export class ValueFormatter {
|
|
5
|
+
/**
|
|
6
|
+
* Called when drawing any label, used to change numbers into formatted strings.
|
|
7
|
+
*
|
|
8
|
+
* @param value float to be formatted
|
|
9
|
+
* @return formatted string label
|
|
10
|
+
*/
|
|
2
11
|
getFormattedValue(value, entry) {
|
|
3
12
|
return value + '';
|
|
4
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Used to draw axis labels, calls {@link #getFormattedValue} by default.
|
|
16
|
+
*
|
|
17
|
+
* @param value float to be formatted
|
|
18
|
+
* @param axis axis being labeled
|
|
19
|
+
* @return formatted string label
|
|
20
|
+
*/
|
|
5
21
|
getAxisLabel(value, axis) {
|
|
6
22
|
return this.getFormattedValue(value);
|
|
7
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Used to draw bar labels, calls {@link #getFormattedValue} by default.
|
|
26
|
+
*
|
|
27
|
+
* @param value current value to be formatted
|
|
28
|
+
* @return formatted string label
|
|
29
|
+
*/
|
|
8
30
|
getBarLabel(value, entry) {
|
|
9
31
|
return this.getFormattedValue(value, entry);
|
|
10
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Used to draw stacked bar labels, calls {@link #getFormattedValue} by default.
|
|
35
|
+
*
|
|
36
|
+
* @param value current value to be formatted
|
|
37
|
+
* @param entry stacked entry being labeled, contains all Y values
|
|
38
|
+
* @return formatted string label
|
|
39
|
+
*/
|
|
11
40
|
getBarStackedLabel(value, entry) {
|
|
12
41
|
return this.getFormattedValue(value, entry);
|
|
13
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Used to draw line and scatter labels, calls {@link #getFormattedValue} by default.
|
|
45
|
+
*
|
|
46
|
+
* @param entry point being labeled, contains X value
|
|
47
|
+
* @return formatted string label
|
|
48
|
+
*/
|
|
14
49
|
getPointLabel(value, entry) {
|
|
15
50
|
return this.getFormattedValue(value, entry);
|
|
16
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Used to draw pie value labels, calls {@link #getFormattedValue} by default.
|
|
54
|
+
*
|
|
55
|
+
* @param value float to be formatted, may have been converted to percentage
|
|
56
|
+
* @param entry slice being labeled, contains original, non-percentage Y value
|
|
57
|
+
* @return formatted string label
|
|
58
|
+
*/
|
|
17
59
|
getPieLabel(value, entry) {
|
|
18
60
|
return this.getFormattedValue(value, entry);
|
|
19
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Used to draw radar value labels, calls {@link #getFormattedValue} by default.
|
|
64
|
+
*
|
|
65
|
+
* @param entry entry being labeled
|
|
66
|
+
* @return formatted string label
|
|
67
|
+
*/
|
|
20
68
|
getRadarLabel(value, entry) {
|
|
21
69
|
return this.getFormattedValue(value, entry);
|
|
22
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Used to draw bubble size labels, calls {@link #getFormattedValue} by default.
|
|
73
|
+
*
|
|
74
|
+
* @param entry bubble being labeled, also contains X and Y values
|
|
75
|
+
* @return formatted string label
|
|
76
|
+
*/
|
|
23
77
|
getBubbleLabel(value, entry) {
|
|
24
78
|
return this.getFormattedValue(value, entry);
|
|
25
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Used to draw high labels, calls {@link #getFormattedValue} by default.
|
|
82
|
+
*
|
|
83
|
+
* @param entry candlestick being labeled
|
|
84
|
+
* @return formatted string label
|
|
85
|
+
*/
|
|
26
86
|
getCandleLabel(value, entry) {
|
|
27
87
|
return this.getFormattedValue(value, entry);
|
|
28
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValueFormatter.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"ValueFormatter.js","sourceRoot":"","sources":["../../../src/ui-chart/formatter/ValueFormatter.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,OAAgB,cAAc;IAChC;;;;;OAKG;IACI,iBAAiB,CAAC,KAAa,EAAE,KAAiB;QACrD,OAAO,KAAK,GAAG,EAAE,CAAC;IACtB,CAAC;IAED;;;;;;OAMG;IACI,YAAY,CAAC,KAAa,EAAE,IAAc;QAC7C,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACI,WAAW,CAAC,KAAK,EAAE,KAAe;QACrC,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;OAMG;IACI,kBAAkB,CAAC,KAAK,EAAE,KAAe;QAC5C,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,KAAK,EAAE,KAAY;QACpC,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;OAMG;IACI,WAAW,CAAC,KAAK,EAAE,KAAe;QACrC,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,KAAK,EAAE,KAAiB;QACzC,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACI,cAAc,CAAC,KAAK,EAAE,KAAkB;QAC3C,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACI,cAAc,CAAC,KAAK,EAAE,KAAkB;QAC3C,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;CACJ"}
|
|
@@ -5,8 +5,28 @@ import { BarDataProvider } from '../interfaces/dataprovider/BarDataProvider';
|
|
|
5
5
|
import { IBarDataSet } from '../interfaces/datasets/IBarDataSet';
|
|
6
6
|
export declare class BarHighlighter extends ChartHighlighter<BarDataProvider> {
|
|
7
7
|
constructor(chart: BarDataProvider);
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
protected getChartData(): BarData;
|
|
9
|
+
getHighlight(x: number, y: number): Highlight<import("../data/Entry").Entry>[];
|
|
10
|
+
/**
|
|
11
|
+
* This method creates the Highlight object that also indicates which value of a stacked BarEntry has been
|
|
12
|
+
* selected.
|
|
13
|
+
*
|
|
14
|
+
* @param high the Highlight to work with looking for stacked values
|
|
15
|
+
* @param set
|
|
16
|
+
* @param xVal
|
|
17
|
+
* @param yVal
|
|
18
|
+
* @return
|
|
19
|
+
*/
|
|
20
|
+
getStackedHighlight(high: Highlight, set: IBarDataSet, touchX: any, touchY: any, xVal: any, yVal: any): Highlight;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the index of the closest value inside the values array / ranges (stacked barchart) to the value
|
|
23
|
+
* given as
|
|
24
|
+
* a parameter.
|
|
25
|
+
*
|
|
26
|
+
* @param ranges
|
|
27
|
+
* @param value
|
|
28
|
+
* @return
|
|
29
|
+
*/
|
|
10
30
|
protected getClosestStackIndex(ranges: any[], value: any): number;
|
|
11
31
|
protected getDistance(x1: any, y1: any, x2: any, y2: any): number;
|
|
12
32
|
protected getData(): BarData;
|
|
@@ -3,46 +3,72 @@ export class BarHighlighter extends ChartHighlighter {
|
|
|
3
3
|
constructor(chart) {
|
|
4
4
|
super(chart);
|
|
5
5
|
}
|
|
6
|
+
getChartData() {
|
|
7
|
+
return this.mChart.barData;
|
|
8
|
+
}
|
|
6
9
|
getHighlight(x, y) {
|
|
7
|
-
const high = super.getHighlight(x, y);
|
|
8
|
-
if (high === null) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
10
|
const pos = this.getValsForTouch(x, y);
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const xVal = pos.x;
|
|
12
|
+
return this.getHighlightForX(xVal, x, y).map((high) => {
|
|
13
|
+
const barData = this.getChartData();
|
|
14
|
+
const set = barData.getDataSetByIndex(high.dataSetIndex);
|
|
15
|
+
if (set.stacked) {
|
|
16
|
+
return this.getStackedHighlight(high, set, x, y, xVal, pos.y);
|
|
17
|
+
}
|
|
18
|
+
// MPPointD.recycleInstance(pos);
|
|
19
|
+
return high;
|
|
20
|
+
});
|
|
18
21
|
}
|
|
19
|
-
|
|
22
|
+
/**
|
|
23
|
+
* This method creates the Highlight object that also indicates which value of a stacked BarEntry has been
|
|
24
|
+
* selected.
|
|
25
|
+
*
|
|
26
|
+
* @param high the Highlight to work with looking for stacked values
|
|
27
|
+
* @param set
|
|
28
|
+
* @param xVal
|
|
29
|
+
* @param yVal
|
|
30
|
+
* @return
|
|
31
|
+
*/
|
|
32
|
+
getStackedHighlight(high, set, touchX, touchY, xVal, yVal) {
|
|
20
33
|
const { entry, index } = set.getEntryAndIndexForXValue(xVal, yVal);
|
|
21
|
-
if (entry
|
|
34
|
+
if (!entry) {
|
|
22
35
|
return null;
|
|
23
36
|
}
|
|
24
|
-
|
|
37
|
+
// not stacked
|
|
38
|
+
if (!entry.yVals) {
|
|
25
39
|
return high;
|
|
26
40
|
}
|
|
27
41
|
const ranges = entry.ranges;
|
|
28
42
|
if (ranges.length > 0) {
|
|
29
43
|
const yKey = set.yProperty;
|
|
30
44
|
const stackIndex = this.getClosestStackIndex(ranges, yVal);
|
|
31
|
-
const pixels = this.mChart.getTransformer(set.
|
|
45
|
+
const pixels = this.mChart.getTransformer(set.axisDependency).getPixelForValues(high.x, ranges[stackIndex][1]);
|
|
46
|
+
//MPPointD.recycleInstance(pixels);
|
|
32
47
|
return {
|
|
33
48
|
x: set.getEntryXValue(entry, index),
|
|
34
49
|
y: entry[yKey],
|
|
50
|
+
xTouchPx: touchX,
|
|
51
|
+
yTouchPx: touchY,
|
|
35
52
|
xPx: pixels.x,
|
|
36
53
|
yPx: pixels.y,
|
|
37
54
|
dataSetIndex: high.dataSetIndex,
|
|
38
55
|
stackIndex,
|
|
39
|
-
axis: high.axis
|
|
56
|
+
axis: high.axis
|
|
40
57
|
};
|
|
41
58
|
}
|
|
42
59
|
return null;
|
|
43
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns the index of the closest value inside the values array / ranges (stacked barchart) to the value
|
|
63
|
+
* given as
|
|
64
|
+
* a parameter.
|
|
65
|
+
*
|
|
66
|
+
* @param ranges
|
|
67
|
+
* @param value
|
|
68
|
+
* @return
|
|
69
|
+
*/
|
|
44
70
|
getClosestStackIndex(ranges, value) {
|
|
45
|
-
if (ranges
|
|
71
|
+
if (!ranges || ranges.length === 0) {
|
|
46
72
|
return 0;
|
|
47
73
|
}
|
|
48
74
|
for (let i = 0; i < ranges.length; i++) {
|
|
@@ -57,7 +83,7 @@ export class BarHighlighter extends ChartHighlighter {
|
|
|
57
83
|
return Math.abs(x1 - x2);
|
|
58
84
|
}
|
|
59
85
|
getData() {
|
|
60
|
-
return this.mChart.
|
|
86
|
+
return this.mChart.barData;
|
|
61
87
|
}
|
|
62
88
|
}
|
|
63
89
|
//# sourceMappingURL=BarHighlighter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarHighlighter.js","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"BarHighlighter.js","sourceRoot":"","sources":["../../../src/ui-chart/highlight/BarHighlighter.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,20 +1,102 @@
|
|
|
1
1
|
import { BarLineScatterCandleBubbleDataProvider } from '../interfaces/dataprovider/BarLineScatterCandleBubbleDataProvider';
|
|
2
2
|
import { IHighlighter } from './IHighlighter';
|
|
3
3
|
import { Highlight } from './Highlight';
|
|
4
|
+
import { AxisDependency } from '../components/YAxis';
|
|
4
5
|
import { IDataSet } from '../interfaces/datasets/IDataSet';
|
|
5
6
|
import { Entry } from '../data/Entry';
|
|
6
7
|
export declare class ChartHighlighter<T extends BarLineScatterCandleBubbleDataProvider> implements IHighlighter {
|
|
8
|
+
/**
|
|
9
|
+
* instance of the data-provider
|
|
10
|
+
*/
|
|
7
11
|
protected mChart: T;
|
|
12
|
+
/**
|
|
13
|
+
* buffer for storing previously highlighted values
|
|
14
|
+
*/
|
|
8
15
|
protected mHighlightBuffer: Highlight[];
|
|
9
16
|
constructor(chart: T);
|
|
10
|
-
getHighlight(x: any, y: any):
|
|
17
|
+
getHighlight(x: any, y: any): Highlight<Entry>[];
|
|
18
|
+
/**
|
|
19
|
+
* Returns a recyclable MPPointD instance.
|
|
20
|
+
* Returns the corresponding xPos for a given touch-position in pixels.
|
|
21
|
+
*
|
|
22
|
+
* @param x
|
|
23
|
+
* @param y
|
|
24
|
+
* @return
|
|
25
|
+
*/
|
|
11
26
|
protected getValsForTouch(x: any, y: any): any;
|
|
12
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Returns the corresponding Highlight for a given xVal and x- and y-touch position in pixels.
|
|
29
|
+
*
|
|
30
|
+
* @param xVal
|
|
31
|
+
* @param x
|
|
32
|
+
* @param y
|
|
33
|
+
* @return
|
|
34
|
+
*/
|
|
35
|
+
protected getHighlightForX(xVal: any, x: any, y: any): Highlight<Entry>[];
|
|
36
|
+
/**
|
|
37
|
+
* Returns the minimum distance from a touch value (in pixels) to the
|
|
38
|
+
* closest value (in pixels) that is displayed in the chart.
|
|
39
|
+
*
|
|
40
|
+
* @param closestValues
|
|
41
|
+
* @param pos
|
|
42
|
+
* @param axis
|
|
43
|
+
* @return
|
|
44
|
+
*/
|
|
13
45
|
protected getMinimumDistance(closestValues: Highlight[], pos: any, axis: any): number;
|
|
14
46
|
protected getHighlightPos(h: Highlight): number;
|
|
47
|
+
protected getChartData(): import("../data/BarLineScatterCandleBubbleData").BarLineScatterCandleBubbleData<any, any>;
|
|
48
|
+
/**
|
|
49
|
+
* Returns a list of Highlight objects representing the entries closest to the given xVal.
|
|
50
|
+
* The returned list contains two objects per DataSet (closest rounding up, closest rounding down).
|
|
51
|
+
*
|
|
52
|
+
* @param xVal the transformed x-value of the x-touch position
|
|
53
|
+
* @return
|
|
54
|
+
*/
|
|
15
55
|
getHighlightsAtXValue(xVal: any, x?: any, y?: any): Highlight<Entry>[];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
56
|
+
/**
|
|
57
|
+
* An array of `Highlight` objects corresponding to the selected xValue and dataSetIndex.
|
|
58
|
+
*
|
|
59
|
+
* @param set
|
|
60
|
+
* @param dataSetIndex
|
|
61
|
+
* @param xVal
|
|
62
|
+
* @param rounding
|
|
63
|
+
* @return
|
|
64
|
+
*/
|
|
65
|
+
protected buildHighlights(set: IDataSet<Entry>, dataSetIndex: any, touchX: any, touchY: any, xVal: any, rounding: any): Highlight<Entry>[];
|
|
66
|
+
/**
|
|
67
|
+
* Returns the Highlight of the DataSet that contains the closest value on the
|
|
68
|
+
* y-axis.
|
|
69
|
+
*
|
|
70
|
+
* @param closestValues contains two Highlight objects per DataSet closest to the selected x-position (determined by
|
|
71
|
+
* rounding up an down)
|
|
72
|
+
* @param x
|
|
73
|
+
* @param y
|
|
74
|
+
* @param minSelectionDistance
|
|
75
|
+
* @param axis the closest axis
|
|
76
|
+
* @return
|
|
77
|
+
*/
|
|
78
|
+
getClosestHighlightByPixel(closestValues: Highlight[], x: number, y: number, minSelectionDistance: number, axis?: AxisDependency): Highlight<Entry>;
|
|
79
|
+
/**
|
|
80
|
+
* Returns sorted highlights based on distance to touch x,y
|
|
81
|
+
*
|
|
82
|
+
* @param closestValues contains two Highlight objects per DataSet closest to the selected x-position (determined by
|
|
83
|
+
* rounding up an down)
|
|
84
|
+
* @param x
|
|
85
|
+
* @param y
|
|
86
|
+
* @param minSelectionDistance
|
|
87
|
+
* @param axis the closest axis
|
|
88
|
+
* @return
|
|
89
|
+
*/
|
|
90
|
+
sortedHighlights(closestValues: Highlight[], x: number, y: number, minSelectionDistance: number, axis?: AxisDependency): Highlight<Entry>[];
|
|
91
|
+
/**
|
|
92
|
+
* Calculates the distance between the two given points.
|
|
93
|
+
*
|
|
94
|
+
* @param x1
|
|
95
|
+
* @param y1
|
|
96
|
+
* @param x2
|
|
97
|
+
* @param y2
|
|
98
|
+
* @return
|
|
99
|
+
*/
|
|
100
|
+
protected getDistance(x1: number, y1: number, x2: number, y2: number): number;
|
|
19
101
|
protected getData(): import("../data/BarLineScatterCandleBubbleData").BarLineScatterCandleBubbleData<any, any>;
|
|
20
102
|
}
|