Skip to content

Commit ef0ba31

Browse files
author
Hank Chu
committed
update highcarts code to support highmaps and update jQuery to 1.9.1 for all modules
1 parent 7530560 commit ef0ba31

File tree

5 files changed

+61
-5
lines changed

5 files changed

+61
-5
lines changed

highcharts/highcharts/common.py

+8
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,14 @@ class Breaks(ArrayObject):
695695
"to": [int, float],
696696
}
697697

698+
class DataClasses(ArrayObject):
699+
ALLOWED_OPTIONS = {
700+
"color": (ColorObject, basestring, dict),
701+
"from": [int, float],
702+
"name": basestring,
703+
"to": [int, float],
704+
}
705+
698706
class Zones(ArrayObject):
699707
ALLOWED_OPTIONS = {
700708
"color": (ColorObject, basestring, dict),

highcharts/highcharts/highcharts.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import datetime
1313
import html
1414
from collections import Iterable
15-
from .options import BaseOptions, ChartOptions, \
15+
from .options import BaseOptions, ChartOptions, ColorAxisOptions, \
1616
ColorsOptions, CreditsOptions, DrilldownOptions, ExportingOptions, \
1717
GlobalOptions, LabelsOptions, LangOptions, \
1818
LegendOptions, LoadingOptions, NavigationOptions, PaneOptions, \
@@ -62,9 +62,10 @@ def __init__(self, **kwargs):
6262

6363
# set Javascript src, Highcharts lib needs to make sure it's up to date
6464
self.JSsource = [
65-
'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
65+
'https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js',
6666
'https://code.highcharts.com/highcharts.js',
6767
'https://code.highcharts.com/highcharts-more.js',
68+
'https://code.highcharts.com/modules/heatmap.js',
6869
'https://code.highcharts.com/modules/exporting.js'
6970
]
7071

@@ -109,6 +110,7 @@ def __init__(self, **kwargs):
109110
# Bind Base Classes to self
110111
self.options = {
111112
"chart": ChartOptions(),
113+
"colorAxis" : ColorAxisOptions(),
112114
"colors": ColorsOptions(),
113115
"credits": CreditsOptions(),
114116
#"data": #NotImplemented

highcharts/highcharts/options.py

+47-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .highchart_types import OptionTypeError, Series, SeriesOptions
55
from .common import Formatter, Events, Position, ContextButton, Options3d, ResetZoomButton, \
66
DrillUpButton, Labels, PlotBands, PlotLines, Title, Items, Navigation, Background, Breaks, \
7-
DateTimeLabelFormats, Zones, Levels, \
7+
DataClasses, DateTimeLabelFormats, Zones, Levels, Marker, \
88
JSfunction, ColorObject, CSSObject, SVGObject, CommonObject, ArrayObject
99

1010
import json, datetime
@@ -153,6 +153,52 @@ class ChartOptions(BaseOptions):
153153
}
154154

155155

156+
class ColorAxisOptions(BaseOptions):
157+
ALLOWED_OPTIONS = {
158+
"dataClassColor": basestring,
159+
"dataClasses": (DataClasses, dict),
160+
"endOnTick": bool,
161+
"events": (Events, dict),
162+
"gridLineColor": (ColorObject, basestring, dict),
163+
"gridLineDashStyle": basestring,
164+
"gridLineWidth": [float, int],
165+
"id": basestring,
166+
"labels": (Labels, dict),
167+
"lineColor": (ColorObject, basestring, dict),
168+
"lineWidth": [float, int],
169+
"marker": (Marker, dict),
170+
"max": [float, int],
171+
"maxColor": (ColorObject, basestring, dict),
172+
"maxPadding": [float, int],
173+
"min": [float, int],
174+
"minColor": (ColorObject, basestring, dict),
175+
"minPadding": [float, int],
176+
"minorGridLineColor": (ColorObject, basestring, dict),
177+
"minorGridLineDashStyle": basestring,
178+
"minorGridLineWidth": int,
179+
"minorTickColor": (ColorObject, basestring, dict),
180+
"minorTickInterval": int,
181+
"minorTickLength": int,
182+
"minorTickPosition": basestring,
183+
"minorTickWidth": int,
184+
"reversed": bool,
185+
"showFirstLabel": bool,
186+
"showLastLabel": bool,
187+
"startOfWeek": int,
188+
"startOnTick": bool,
189+
"stops": list,
190+
"tickColor": (ColorObject, basestring, dict),
191+
"tickInterval": int,
192+
"tickLength": int,
193+
"tickPixelInterval": int,
194+
"tickPosition": basestring,
195+
"tickPositioner": JSfunction,
196+
"tickPositions": list,
197+
"tickWidth": int,
198+
"type": basestring,
199+
}
200+
201+
156202
class ColorsOptions(BaseOptions):
157203
""" Special Case, this is simply just an array of colours """
158204
def __init__(self):

highcharts/highmaps/highmaps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def __init__(self, **kwargs):
6565

6666
# Set Javascript src
6767
self.JSsource = [
68-
'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
68+
'https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js',
6969
'https://code.highcharts.com/maps/highmaps.js',
7070
'https://code.highcharts.com/highcharts.js',
7171
'https://code.highcharts.com/maps/modules/map.js',

highcharts/highstock/highstock.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __init__(self, **kwargs):
6161

6262
# set Javascript src, Highcharts lib needs to make sure it's up to date
6363
self.JSsource = [
64-
'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
64+
'https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js',
6565
'https://code.highcharts.com/stock/highstock.js',
6666
'https://code.highcharts.com/stock/modules/exporting.js',
6767
'https://code.highcharts.com/highcharts-more.js',

0 commit comments

Comments
 (0)