Skip to content

Commit 0d56089

Browse files
committed
Fixed DumbbellSeries.data incorrect type. Closes #176.
1 parent 9348529 commit 0d56089

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

highcharts_core/options/series/data/range.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from highcharts_core import constants, errors
99
from highcharts_core.decorators import class_sensitive
1010
from highcharts_core.options.series.data.base import DataBase
11-
from highcharts_core.options.series.data.cartesian import CartesianData, CartesianDataCollection
11+
from highcharts_core.options.series.data.collections import DataPointCollection
1212
from highcharts_core.options.plot_options.drag_drop import DragDropOptions
1313
from highcharts_core.utility_classes.data_labels import DataLabel
1414
from highcharts_core.utility_classes.markers import Marker
@@ -362,7 +362,7 @@ def _to_untrimmed_dict(self, in_cls = None) -> dict:
362362
return untrimmed
363363

364364

365-
class RangeDataCollection(CartesianDataCollection):
365+
class RangeDataCollection(DataPointCollection):
366366
"""A collection of :class:`RangeData` objects.
367367
368368
.. note::
@@ -384,8 +384,8 @@ def _get_data_point_class(cls):
384384
return RangeData
385385

386386

387-
class ConnectedRangeData(CartesianData):
388-
"""Variant of :class:`CartesianData` which extends the class with connector
387+
class ConnectedRangeData(RangeData):
388+
"""Variant of :class:`RangeData` which extends the class with connector
389389
attributes."""
390390

391391
def __init__(self, **kwargs):
@@ -481,9 +481,10 @@ class from a Highcharts Javascript-compatible :class:`dict <python:dict>` object
481481
'data_labels': as_dict.get('dataLabels', None),
482482
'drag_drop': as_dict.get('dragDrop', None),
483483
'drilldown': as_dict.get('drilldown', None),
484+
'high': as_dict.get('high', None),
485+
'low': as_dict.get('low', None),
484486
'marker': as_dict.get('marker', None),
485487
'x': as_dict.get('x', None),
486-
'y': as_dict.get('y', None),
487488

488489
'connector_color': as_dict.get('connectorColor', None),
489490
'connector_width': as_dict.get('connectorWidth', None),
@@ -506,7 +507,7 @@ def _to_untrimmed_dict(self, in_cls = None) -> dict:
506507
return untrimmed
507508

508509

509-
class ConnectedRangeDataCollection(CartesianDataCollection):
510+
class ConnectedRangeDataCollection(RangeDataCollection):
510511
"""A collection of :class:`ConnectedRangeData` objects.
511512
512513
.. note::

tests/input_files/series/data/range/04.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
liveRedraw: true
8686
},
8787
drilldown: 'some-id-goes-here',
88+
low: 123,
8889
marker: {
8990
enabled: true,
9091
fillColor: '#cccccc',
@@ -100,7 +101,6 @@
100101
width: 48
101102
},
102103
x: 'some category',
103-
y: 123,
104104

105105
accessibility: {
106106
description: 'Some description goes here',

tests/input_files/series/dumbbell/01.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
liveRedraw: true
8888
},
8989
drilldown: 'some-id-goes-here',
90+
low: 123,
9091
marker: {
9192
enabled: true,
9293
fillColor: '#cccccc',
@@ -101,7 +102,6 @@
101102
symbol: 'circle',
102103
width: 48
103104
},
104-
y: 123,
105105

106106
accessibility: {
107107
description: 'Some description goes here',

tests/options/series/data/test_range.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def test_RangeData_to_array(input_array, set_props, expected_type, expected):
432432
'symbol': 'circle',
433433
'width': 48
434434
},
435-
'y': 123,
435+
'low': 123,
436436
'name': 'some category'
437437
}, None),
438438
# + DataBase Options
@@ -538,7 +538,7 @@ def test_RangeData_to_array(input_array, set_props, expected_type, expected):
538538
'width': 48
539539
},
540540
'x': 'some category',
541-
'y': 123,
541+
'low': 123,
542542

543543
'accessibility': {
544544
'description': 'Some description goes here',

tests/options/series/test_dumbbell.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
'symbol': 'circle',
117117
'width': 48
118118
},
119-
'y': 123,
119+
'high': 123,
120120
'name': 'some category'
121121
}
122122
]
@@ -225,7 +225,7 @@
225225
'symbol': 'circle',
226226
'width': 48
227227
},
228-
'y': 123,
228+
'high': 123,
229229
'name': 'some category'
230230
}
231231
],
@@ -431,7 +431,7 @@
431431
'symbol': 'circle',
432432
'width': 48
433433
},
434-
'y': 123,
434+
'low': 123,
435435
'name': 'some category'
436436
}
437437
],

0 commit comments

Comments
 (0)