1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 try:
16 from collections import OrderedDict
17 except ImportError:
18 from ordereddict import OrderedDict
19
20 from muntjac.addon.invient.paint \
21 import IPaint
22
23 from muntjac.util \
24 import OrderedSet
28 """This class encapsulates a number of configuration options for the
29 InvientChars. These configuration options are L{Title}, L{SubTitle}
30 , L{GeneralChartConfig}, L{Credit}, L{Legend}, L{Tooltip}
31 , L{ChartLabel}, L{SeriesConfig}, L{XAxis} and L{YAxis}
32
33 All configuration properties which are of object type are initialized
34 with an object instance.
35
36 These configuration options are static and generally set once. After a
37 chart (L{InvientCharts}) created, any changes made to the configuration
38 options will not reflect in the chart. You would have to create a new
39 chart L{InvientCharts}
40
41 For some APIs, the description has been taken from
42 U{http://www.highcharts.com/ref/}
43
44 @author: Invient
45 @author: Richard Lincoln
46 """
47
60
61
63 return self._invientCharts
64
65
67 self._invientCharts = invientCharts
68
69
71 """@return: The L{ChartLabel} object representing labels at arbitrary
72 position in the chart.
73 """
74 return self._chartLabel
75
76
78 """Sets the argument L{ChartLabel} object only if it is non-null
79
80 @param chartLabel:
81 """
82 if chartLabel is not None:
83 self._chartLabel = chartLabel
84
85
87 """@return: Returns a collection of x-axis."""
88 return self._xAxes
89
90
92 """Sets a collection of x-axis for the chart. The collection of x-axis
93 is set only if argument xAxes is non-null.
94
95 @param xAxes:
96 """
97 if xAxes is not None:
98 self._xAxes = xAxes
99
100
102 """Adds specified x-axis to the collection of x-axis.
103
104 @param xAxis:
105 @return: Returns true if the x-axis is added successfully otherwise
106 false
107 """
108 return self._xAxes.add(xAxis)
109
110
112 """@return: Returns a collection of y-axis."""
113 return self._yAxes
114
115
117 """Sets a collection of y-axis for the chart. The collection of y-axis
118 is set only if argument yAxes is non-null
119
120 @param yAxes:
121 """
122 if yAxes is not None:
123 self._yAxes = yAxes
124
125
127 """Adds specified y-axis to the collection of y-axis.
128
129 @param yAxis:
130 @return: Returns true if the y-axis is added successfully otherwise
131 false
132 """
133 return self._yAxes.add(yAxis)
134
135
137 """@return: Returns L{Title} object"""
138 return self._title
139
140
142 """Sets the argument title only if the argument title is non-null
143
144 @param title:
145 """
146 if title is not None:
147 self._title = title
148
149
151 """@return: Returns subtitle"""
152 return self._subtitle
153
154
156 """Sets the argument subtitle only if the argument is non-null
157
158 @param subtitle:
159 """
160 if subtitle is not None:
161 self._subtitle = subtitle
162
163
167
168
176
177
179 """@return: Returns legend object of the chart"""
180 return self._legend
181
182
184 """Sets L{Legend} object only if the argument legend is non-null
185
186 @param legend:
187 """
188 if legend is not None:
189 self._legend = legend
190
191
193 """@return: Returns credit object of the chart"""
194 return self._credit
195
196
198 """Sets the L{Credit} object only if the argument credit is non-null
199
200 @param credit:
201 """
202 if credit is not None:
203 self._credit = credit
204
205
207 """@return: Returns L{GeneralChartConfig} object"""
208 return self._generalChartConfig
209
210
212 """Sets L{GeneralChartConfig} object only if the argument is non-null
213
214 @param generalChartConfig:
215 """
216 if generalChartConfig is not None:
217 self._generalChartConfig = generalChartConfig
218
219
221 return self._seriesTypeConfig
222
223
225 """Sets a set of {@link SeriesConfig} objects only if the argument is
226 non-null.
227
228 @param seriesConfigs:
229 """
230 if self._seriesTypeConfig is not None:
231 self._seriesTypeConfig.clear()
232 for config in seriesConfigs:
233 self.addSeriesConfig(config)
234
235
237 """Adds the specified argument only if it is non-null.
238
239 @param seriesConfig:
240 @raise ValueError:
241 if the argument is null
242 """
243 if seriesConfig is None:
244 raise ValueError, 'Argument SeriesConfig cannot be null.'
245 self._seriesTypeConfig[self.getSeriesType(seriesConfig)] = seriesConfig
246
247
248 @classmethod
273
276 """The L{ChartLabel} class represents a set of labels which an be
277 placed at arbitrary position in the chart.
278
279 @author: Invient
280 @author: Richard Lincoln
281 """
282
284 self._style = None
285 self._labels = list()
286
287
289 """@return: Returns css style."""
290 return self._style
291
292
294 """Sets css style for all labels in this class
295
296 @param style:
297 css style string
298 """
299 self._style = style
300
301
303 """@return: Returns a list of L{ChartLabelItem} objects"""
304 return self._labels
305
306
308 """Sets a list of L{ChartLabelItem} objects
309
310 @param labels:
311 """
312 if labels is not None:
313 self._labels = labels
314
315
317 """Appends the specified element at the end of L{ChartLabelItem}
318 list.
319
320 @param label:
321 element to be appended
322 """
323 self._labels.append(label)
324
325
327 """Removes the specified element from the list of L{ChartLabelItem}
328
329 @param label:
330 """
331 self._labels.remove(label)
332
335 """This class represents a label placed at arbitrary location in the
336 chart. The label can have html text and it can be styled using
337 css-style.
338
339 @author: Invient
340 @author: Richard Lincoln
341 """
342
344 """Creates a new instance with specified html and style arguments.
345
346 @param html:
347 @param style:
348 """
349 super(ChartLabelItem, self).__init__()
350 self._html = html
351 self._style = style
352
353
355 """@return Returns html of this label"""
356 return self._html
357
358
360 """Sets html for this label
361
362 @param html:
363 It can be plain or html string.
364 """
365 self._html = html
366
367
369 """@return: Returns css-style of this label"""
370 return self._style
371
372
374 """Sets css style for this label
375
376 @param style:
377 """
378 self._style = style
379
382 """This class contains configuration properties at a chart level.
383
384 @author: Invient
385 @author: Richard Lincoln
386 """
387
389 from muntjac.addon.invient.invient_charts import SeriesType
390
391 self._backgroundColor = None
392 self._borderColor = None
393 self._borderRadius = None
394 self._borderWidth = None
395 self._height = None
396 self._width = None
397 self._ignoreHiddenSeries = None
398 self._inverted = None
399 self._margin = None
400 self._spacing = None
401 self._showAxes = None
402 self._type = SeriesType.LINE
403 self._zoomType = ZoomType.NONE
404 self._clientZoom = True
405 self._alignTicks = None
406 self._animation = None
407 self._className = None
408 self._reflow = None
409 self._shadow = None
410 self._plot = None
411 self._style = None
412
413
415 """@return: align ticks"""
416 return self._alignTicks
417
418
420 """When using multiple axis, the ticks of two or more opposite axes
421 will automatically be aligned by adding ticks to the axis or axes with
422 the least ticks. This can be prevented by setting alignTicks to false.
423
424 @param alignTicks:
425 """
426 self._alignTicks = alignTicks
427
428
430 """@return: animation"""
431 return self._animation
432
433
435 """Set the overall animation for all chart updating.
436
437 @param animation:
438 """
439 self._animation = animation
440
441
443 """@return"""
444 return self._className
445
446
448 """A CSS class name to apply to the charts container
449
450 @param className:
451 """
452 self._className = className
453
455 """@return: Returns plot object representing chart's drawing area"""
456 return self._plot
457
458
460 """Sets plot object
461
462 @param plot:
463 """
464 self._plot = plot
465
466
468 """@return:"""
469 return self._reflow
470
471
473 """A value of true indicates that the chart will fit the width of the
474 charts container otherwise not.
475
476 @param reflow:
477 """
478 self._reflow = reflow
479
480
482 """@return:"""
483 return self._shadow
484
485
487 """A value of true indicates that the drop shadow will apply to the
488 outer chart area otherwise not.
489
490 @param shadow:
491 """
492 self._shadow = shadow
493
494
496 """@return:"""
497 return self._style
498
499
501 """A CSS string to apply to the charts container
502
503 @param style:
504 """
505 self._style = style
506
507
509 """@return:"""
510 return self._backgroundColor
511
512
514 """Sets the background color for the outer chart area
515
516 @param backgroundColor
517 """
518 self._backgroundColor = backgroundColor
519
520
522 """@return"""
523 return self._borderColor
524
525
527 """Sets the border color for the outer chart border
528
529 @param borderColor
530 """
531 self._borderColor = borderColor
532
533
535 """@return"""
536 return self._borderRadius
537
538
540 """Sets radius for the outer chart border
541
542 @param borderRadius
543 """
544 self._borderRadius = borderRadius
545
546
548 """@return"""
549 return self._borderWidth
550
551
553 """Sets pixel width of the outer chart border
554
555 @param borderWidth
556 """
557 self._borderWidth = borderWidth
558
559
561 """@return"""
562 return self._height
563
564
566 """Sets height for the chart
567
568 @param height
569 """
570 self._height = height
571
572
574 """@return"""
575 return self._width
576
577
579 """Sets width for the chart
580
581 @param width
582 """
583 self._width = width
584
585
587 """@return"""
588 return self._ignoreHiddenSeries
589
590
592 """If the argument is true, the axes will scale to the remaining
593 visible series once one series is hidden. If the argument is false,
594 hiding and showing a series will not affect the axes or the other
595 series.
596
597 @param ignoreHiddenSeries
598 """
599 self._ignoreHiddenSeries = ignoreHiddenSeries
600
601
603 """@return"""
604 return self._inverted
605
606
608 """If the argument is true then the x-axis is reversed. If a bar
609 plot is present, it will be inverted automatically.
610
611 @param inverted
612 """
613 self._inverted = inverted
614
615
617 """@return"""
618 return self._margin
619
620
622 """@param margin"""
623 self._margin = margin
624
625
627 """@return"""
628 return self._showAxes
629
630
632 """If the argument is true then the axes will be shown initially.
633 This is useful when the chart is empty and axes must be shown.
634
635 @param showAxes
636 """
637 self._showAxes = showAxes
638
639
641 """@return"""
642 return self._spacing
643
644
646 """@param spacing"""
647 self._spacing = spacing
648
649
651 """@return"""
652 return self._type
653
654
656 """Sets series type to one of line, spline, scatter, area,
657 areaspline, pie, bar and column.
658
659 @param typ
660 """
661 self._type = typ
662
663
665 """@return"""
666 return self._zoomType
667
668
670 """Sets zoom type. It decides how a chart can be zoomed by
671 dragging the mouse.
672
673 @param zoomType
674 """
675 self._zoomType = zoomType
676
677
679 """@return"""
680 return self._clientZoom
681
682
684 """If the argument is true then the scaling will happen on client. If
685 the argument is false then the chart will not scale. In any case, the
686 server will receive event notification if registered.
687
688 @param clientZoom
689 """
690 self._clientZoom = clientZoom
691
692
694 return ('Chart [backgroundColor=' + str(self._backgroundColor)
695 + ', borderColor=' + str(self._borderColor)
696 + ', borderRadius=' + str(self._borderRadius)
697 + ', borderWidth=' + str(self._borderWidth)
698 + ', height=' + str(self._height)
699 + ', width=' + str(self._width)
700 + ', ignoreHiddenSeries=' + str(self._ignoreHiddenSeries)
701 + ', inverted=' + str(self._inverted)
702 + ', margin=' + str(self._margin)
703 + ', spacing=' + str(self._spacing)
704 + ', showAxes=' + str(self._showAxes)
705 + ', type=' + str(self._type)
706 + ', zoomType=' + str(self._zoomType)
707 + ', alignTicks=' + str(self._alignTicks)
708 + ', animation=' + str(self._animation)
709 + ', className=' + str(self._className)
710 + ', reflow=' + str(self._reflow)
711 + ', shadow=' + str(self._shadow)
712 + ', plot=' + str(self._plot)
713 + ', style=' + str(self._style) + ']')
714
715
716 -class Plot(object):
717 """This class represents drawing area of the chart and contains methods
718 specific to it.
719
720 @author chirag:
721 """
722
724 self._backgroundColor = None
725 self._backgroundImage = None
726 self._borderColor = None
727 self._borderWidth = None
728 self._shadow = None
729
731 return self._backgroundColor
732
734 self._backgroundColor = backgroundColor
735
737 return self._backgroundImage
738
740 self._backgroundImage = backgroundImage
741
743 return self._borderColor
744
746 self._borderColor = borderColor
747
749 return self._borderWidth
750
752 self._borderWidth = borderWidth
753
756
758 self._shadow = shadow
759
761 return ('Plot [backgroundColor=' + str(self._backgroundColor)
762 + ', backgroundImage=' + str(self._backgroundImage)
763 + ', borderColor=' + str(self._borderColor)
764 + ', borderWidth=' + str(self._borderWidth)
765 + ', shadow=' + str(self._shadow) + ']')
766
769 """This class represents space around the chart. The boundary of the
770 chart includes axis, axis labels, legend, chart title and subtitle.
771
772 @author: Invient
773 @author: Richard Lincoln
774 """
776 self._left = None
777 self._top = None
778 self._right = None
779 self._bottom = None
780
783
786
789
792
795
798
801
804
806 return ('Spacing [left=' + str(self._left)
807 + ', top=' + str(self._top)
808 + ', right=' + str(self._right)
809 + ', bottom=' + str(self._bottom)
810 + ']')
811
814 """This class represents margin between the outer edge of the chart
815 and the plot area.
816
817 @author: Invient
818 @author: Richard Lincoln
819 """
820
821 - def __init__(self, top=None, right=None, bottom=None, left=None):
822 self._top = top
823 self._right = right
824 self._bottom = bottom
825 self._left = left
826
829
832
835
838
841
844
847
850
852 return ('Margin [left=' + str(self._left)
853 + ', top=' + str(self._top)
854 + ', right=' + str(self._right)
855 + ', bottom=' + str(self._bottom)
856 + ']')
857
860 """The value L{ZoomType.X} represents horizontal zoom. The value
861 L{ZoomType.Y} represents vertical zoom. The value
862 L{ZoomType.XY} represents horizontal as well as vertical zoom.
863
864 @author: Invient
865 @author: Richard Lincoln
866 """
867 X = None
868 Y = None
869 XY = None
870 NONE = None
871
874
877
878 @classmethod
880 return [cls.X, cls.Y, cls.XY, cls.NONE]
881
882
883 ZoomType.X = ZoomType('x')
884 ZoomType.Y = ZoomType('y')
885 ZoomType.XY = ZoomType('xy')
886 ZoomType.NONE = ZoomType('')
890 """This class contains general configuration options for all series
891 types such as line, area and pie.
892
893 @author: Invient
894 @author: Richard Lincoln
895 """
896
898 self._allowPointSelect = None
899 self._animation = None
900 self._enableMouseTracking = None
901 self._showInLegend = None
902 self._cursor = None
903
904 self._stacking = None
905 self._showCheckbox = None
906
907 self._visible = None
908
909 self._shadow = None
910
911 self._hoverState = None
912 self._dataLabel = None
913 self._color = None
914
915
917 """@return"""
918 return self._allowPointSelect
919
920
922 """If the argument is true then the points of a can be selected
923 otherwise not. Defaults to false, The point on a chart will toggle.
924 Also, whenever a point is selected or deselected, the registered
925 event listeners will be triggered.
926
927 @param allowPointSelect
928 """
929 self._allowPointSelect = allowPointSelect
930
931
933 return self._animation
934
935
937 """If the argument is true then animation will be enabled when a
938 series will be displayed otherwise not. Defaults to false.
939
940 @param animation
941 """
942 self._animation = animation
943
944
946 """@return"""
947 return self._enableMouseTracking
948
949
951 """If the argument is true then the mouse tracking will be enabled
952 for a series otherwise not. Defaults to true.
953
954 @param enableMouseTracking
955 """
956 self._enableMouseTracking = enableMouseTracking
957
958
960 """@return"""
961 return self._showInLegend
962
963
965 """If the argument is true then a series will be displayed in the
966 legend otherwise not. Defaults to true.
967
968 @param showInLegend
969 """
970 self._showInLegend = showInLegend
971
972
974 """@return"""
975 return self._cursor
976
977
979 """Sets the cursor style. E.g. cursor can be set to css cursor style
980 'pointer', 'hand' or any other. Defaults to null.
981
982 @param cursor
983 """
984 self._cursor = cursor
985
986
988 """@return"""
989 return self._stacking
990
991
993 """Specifies whether the values of each series should be stacked on
994 top of each other or not. Defaults to null. If the argument is null
995 then the values of each series are not stacked.
996
997 @param stacking
998 """
999 self._stacking = stacking
1000
1001
1003 """@return"""
1004 return self._showCheckbox
1005
1006
1008 """If the argument is true then a checkbox is displayed next to the
1009 legend item in the legend area. Defaults to false
1010
1011 @param showCheckbox
1012 """
1013 self._showCheckbox = showCheckbox
1014
1015
1017 """@return"""
1018 return self._visible
1019
1020
1022 """If the argument is true then the series is visible otherwise not
1023 when a chart is rendered initially. Defaults to true However, this
1024 is not applicable for series related to Pie chart.
1025
1026 @param visible
1027 @raise NotImplementedError:
1028 If this method is invoked on L{PieConfig}
1029 """
1030 self._visible = visible
1031
1032
1034 """@return"""
1035 return self._shadow
1036
1037
1039 """If the argument is true then a shadow will be shown to the graph
1040 line otherwise not. Defaults to true.
1041
1042 @param shadow:
1043 @raise NotImplementedError:
1044 If this method is invoked on L{PieConfig}
1045 """
1046 self._shadow = shadow
1047
1048
1050 """@return"""
1051 return self._hoverState
1052
1053
1055 """Sets attributes which should be applied to a series when series
1056 is hovered.
1057
1058 @param state
1059 """
1060 self._hoverState = state
1061
1062
1064 """@return"""
1065 return self._dataLabel
1066
1067
1069 """Sets how point value should be formatted and displayed for each
1070 point.
1071
1072 @param dataLabel
1073 """
1074 self._dataLabel = dataLabel
1075
1076
1078 """@return"""
1079 return self._color
1080
1081
1083 """Sets color for the series.
1084
1085 @param color
1086 """
1087 self._color = color
1088
1091 """This class contains various attributes to format data labels. The
1092 data labels are displayed along with points and axis.
1093
1094 @author: Invient
1095 @author: Richard Lincoln
1096 """
1097
1099 """If the argument is true then the datalabels will be displayed
1100 otherwise not.
1101
1102 @param enabled
1103 """
1104 self._align = None
1105
1106 self._enabled = True
1107 self._formatterJsFunc = None
1108 self._rotation = None
1109 self._style = None
1110 self._x = None
1111 self._y = None
1112 self._color = None
1113
1114
1116 """@return"""
1117 return self._align
1118
1119
1121 """@param align"""
1122 self._align = align
1123
1124
1126 """@return"""
1127 return self._enabled
1128
1129
1131 """If the argument is true then the datalabels will be displayed
1132 otherwise not.
1133
1134 @param enabled
1135 """
1136 self._enabled = enabled
1137
1138
1142
1143
1153
1154
1156 """@return"""
1157 return self._rotation
1158
1159
1161 """Sets text rotation in degrees
1162
1163 @param rotation
1164 """
1165 self._rotation = rotation
1166
1167
1169 """@return"""
1170 return self._style
1171
1172
1174 """Sets css style for the data label
1175
1176 @param style
1177 """
1178 self._style = style
1179
1180
1182 """@return"""
1183 return self._x
1184
1185
1186 - def setX(self, x):
1187 """Sets the x position offset of the label relative to the point.
1188 Defaults to 0.
1189
1190 @param x
1191 """
1192 self._x = x
1193
1194
1196 """@return"""
1197 return self._y
1198
1199
1200 - def setY(self, y):
1201 """Sets the y position offset of the label relative to the point.
1202 Defaults to -6.
1203
1204 @param y
1205 """
1206 self._y = y
1207
1208
1210 """@return"""
1211 return self._color
1212
1213
1215 """Sets color for the data labels. e.g. if the color is blue then in
1216 case of line series, for each point, the data label will be displayed
1217 in blue color.
1218
1219 @param color
1220 """
1221 self._color = color
1222
1223
1225 return ('DataLabel [align=' + str(self._align)
1226 + ', enabled=' + str(self._enabled)
1227 + ', formatter=' + str(self._formatterJsFunc)
1228 + ', rotation=' + str(self._rotation)
1229 + ', style=' + str(self._style)
1230 + ', x=' + str(self._x)
1231 + ', y=' + str(self._y) + ']')
1232
1235 """This class contains configuration attributes of data labels specific
1236 to Pie series.
1237
1238 @author: Invient
1239 @author: Richard Lincoln
1240 """
1241
1243 """If the argument is true then the datalabels will be displayed
1244 otherwise not.
1245
1246 @param enabled
1247 """
1248 self._connectorWidth = None
1249 self._connectorColor = None
1250 self._connectorPadding = None
1251 self._distance = None
1252
1253 super(PieDataLabel, self).__init__(enabled)
1254
1255
1257 """@return"""
1258 return self._connectorWidth
1259
1260
1262 """Sets width (in pixel) of the line connecting the data label to
1263 the pie slice. Defaults to 1.
1264
1265 @param connectorWidth
1266 """
1267 self._connectorWidth = connectorWidth
1268
1269
1271 """@return"""
1272 return self._connectorColor
1273
1274
1276 """Sets the color of the line connecting the data label to the pie
1277 slice.
1278
1279 @param connectorColor
1280 """
1281 self._connectorColor = connectorColor
1282
1283
1285 """@return"""
1286 return self._connectorPadding
1287
1288
1290 """Sets the distance (in pixel) from the data label to the connector.
1291 Defaults to 5.
1292
1293 @param connectorPadding
1294 """
1295 self._connectorPadding = connectorPadding
1296
1297
1299 """@return"""
1300 return self._distance
1301
1302
1304 """Sets the distance (in pixel) of the data label from the pie's edge.
1305
1306 @param distance
1307 """
1308 self._distance = distance
1309
1310
1312 return ('PieDataLabel [connectorWidth=' + str(self._connectorWidth)
1313 + ', connectorColor=' + str(self._connectorColor)
1314 + ', connectorPadding=' + str(self._connectorPadding)
1315 + ', distance=' + str(self._distance)
1316 + ', getAlign()=' + str(self.getAlign())
1317 + ', getEnabled()=' + str(self.getEnabled())
1318 + ', getFormatter()=' + str(self.getFormatterJsFunc())
1319 + ', getRotation()=' + str(self.getRotation())
1320 + ', getStyle()=' + str(self.getStyle())
1321 + ', getX()=' + str(self.getX())
1322 + ', getY()=' + str(self.getY())
1323 + ', __str__()=' + super(PieDataLabel, self).__str__()
1324 + ', __class__=' + self.__class__
1325 + ', __hash__()=' + self.__hash__() + ']')
1326
1329 """This class contains configuration properties for axis labels. The axis
1330 labels are the one which are displayed for each tick.
1331
1332 @author: Invient
1333 @author: Richard Lincoln
1334 """
1335
1337 """If the argument is true then the data labels will be displayed
1338 otherwise not.
1339
1340 @param enabled
1341 """
1342 self._step = None
1343
1344 super(AxisDataLabel, self).__init__(enabled)
1345
1346
1348 """@return"""
1349 return self._step
1350
1351
1353 """Sets at what interval the labels on the axis should be displayed.
1354 Setting the step to 2 shows every other label. Defaults to null
1355
1356 @param step
1357 """
1358 self._step = step
1359
1362 """This class contains configuration properties specifically for x-axis
1363 labels.
1364
1365 @author: Invient
1366 @author: Richard Lincoln
1367 """
1368
1370 """If the argument is true then the data labels will be displayed
1371 otherwise not.
1372
1373 @param enabled
1374 """
1375 self._staggerLines = None
1376
1377 super(XAxisDataLabel, self).__init__(enabled)
1378
1379
1381 """@return"""
1382 return self._staggerLines
1383
1384
1386 """Sets number of lines to spread the labels over to make room or
1387 tighter labels.
1388
1389 @param staggerLines
1390 """
1391 self._staggerLines = staggerLines
1392
1395 """This class contains configuration properties specifically for x-axis
1396 labels.
1397
1398 @author: Invient
1399 @author: Richard Lincoln
1400 """
1401
1403 """If the argument is true then the data labels will be displayed
1404 otherwise not.
1405
1406 @param enabled
1407 """
1408 super(YAxisDataLabel, self).__init__(enabled)
1409
1412 """This class contains configuration options for line series such as
1413 line and area but not column series.
1414
1415 @author: Invient
1416 @author: Richard Lincoln
1417 """
1418
1420 super(BaseLineConfig, self).__init__()
1421
1422 self._pointStart = None
1423 self._pointInterval = None
1424 self._stickyTracking = None
1425 self._marker = None
1426 self._dashStyle = None
1427 self._lineWidth = None
1428
1429
1431 """@return"""
1432 return self._pointStart
1433
1434
1436 """If no x values are given for the points in a series, the argument
1437 pointStart defines on what value to start. Defaults to 0. e.g. if a
1438 series contains values higher than 2 m $ then sets pointStart to
1439 2,000,000
1440
1441 @param pointStart
1442 """
1443 self._pointStart = pointStart
1444
1445
1447 """@return"""
1448 return self._pointInterval
1449
1450
1452 """If no x values are given for the points in a series, the argument
1453 pointInterval defines the interval of the x values. For example, if
1454 a series contains one value every day then set pointInterval to
1455 24 * 3600 * 1000
1456
1457 @param pointInterval
1458 """
1459 self._pointInterval = pointInterval
1460
1461
1463 """@return"""
1464 return self._stickyTracking
1465
1466
1468 """If the argument is true then the mouseout event on a series is not
1469 triggered until mouse moves over another series or comes out of the
1470 plot area. If the argument is true then the mouseout event occurs as
1471 soon as mouse leaves area near to the point or marker
1472
1473 @param stickyTracking
1474 """
1475 self._stickyTracking = stickyTracking
1476
1477
1479 """@return"""
1480 return self._marker
1481
1482
1484 """Sets marker for points of a series
1485
1486 @param marker
1487 """
1488 self._marker = marker
1489
1490
1492 """@return"""
1493 return self._dashStyle
1494
1495
1497 """Sets dash style to use when drawing a series.
1498
1499 @param dashStyle
1500 """
1501 self._dashStyle = dashStyle
1502
1503
1505 """@return"""
1506 return self._lineWidth
1507
1508
1510 """Sets width of a line
1511
1512 @param lineWidth
1513 """
1514 self._lineWidth = lineWidth
1515
1518
1519 SOLID = None
1520 SHORT_DASH = None
1521 SHORT_DOT = None
1522 SHORT_DASH_DOT = None
1523 SHORT_DASH_DOT_DOT = None
1524 DOT = None
1525 DASH = None
1526 LONG_DASH = None
1527 DASH_DOT = None
1528 LONG_DASH_DOT = None
1529 LONG_DASH_DOT_DOT = None
1530
1533
1536
1537 @classmethod
1539 return [cls.SOLID, cls.SHORT_DASH, cls.SHORT_DOT, cls.SHORT_DASH_DOT,
1540 cls.SHORT_DASH_DOT_DOT, cls.DOT, cls.DASH, cls.LONG_DASH,
1541 cls.DASH_DOT, cls.LONG_DASH_DOT, cls.LONG_DASH_DOT_DOT]
1542
1543 DashStyle.SOLID = DashStyle('Solid')
1544 DashStyle.SHORT_DASH = DashStyle('ShortDash')
1545 DashStyle.SHORT_DOT = DashStyle('ShortDot')
1546 DashStyle.SHORT_DASH_DOT = DashStyle('ShortDashDot')
1547 DashStyle.SHORT_DASH_DOT_DOT = DashStyle('ShortDashDotDot')
1548 DashStyle.DOT = DashStyle('Dot')
1549 DashStyle.DASH = DashStyle('Dash')
1550 DashStyle.LONG_DASH = DashStyle('LongDash')
1551 DashStyle.DASH_DOT = DashStyle('DashDot')
1552 DashStyle.LONG_DASH_DOT = DashStyle('LongDashDot')
1553 DashStyle.LONG_DASH_DOT_DOT = DashStyle('LongDashDotDot')
1557 """This class contains configuration options for area series, area and
1558 areaspline.
1559
1560 @author: Invient
1561 @author: Richard Lincoln
1562 """
1563
1565 super(AreaConfig, self).__init__()
1566
1567 self._fillColor = None
1568 self._lineColor = None
1569 self._fillOpacity = None
1570 self._threshold = None
1571
1572
1574 """@return Returns fill color of the area."""
1575 return self._fillColor
1576
1577
1579 """Sets fill gradient for the area
1580
1581 @param fillColor
1582 """
1583 self._fillColor = fillColor
1584
1585
1587 """@return: Returns color of a line drawing above the area"""
1588 return self._lineColor
1589
1590
1592 """Sets line color for the line of an area.
1593
1594 @param lineColor
1595 """
1596 self._lineColor = lineColor
1597
1598
1600 """@return: Returns opacity (transparency) which will be used when
1601 the area is filled with the fill color"""
1602 return self._fillOpacity
1603
1604
1606 """Sets opacity for the area
1607
1608 @param fillOpacity
1609 """
1610 self._fillOpacity = fillOpacity
1611
1612
1614 """@return: Returns threadshold of the area"""
1615 return self._threshold
1616
1617
1619 """Sets threshold value which servers as the base for the area, for
1620 distinguishing between values above and below a threshold. Defaults
1621 to 0.
1622
1623 @param threshold
1624 """
1625 self._threshold = threshold
1626
1629 """This class contains configuration options for areaspline series
1630
1631 @author: Invient
1632 @author: Richard Lincoln
1633 """
1634 pass
1635
1638 """This class contains configuration options for line series
1639
1640 @author: Invient
1641 @author: Richard Lincoln
1642 """
1646
1647
1649 """@return: Returns true if the line should be drawn using steps
1650 otherwise false."""
1651 return self._step
1652
1653
1655 """If the argument is true then line will be drawn using steps
1656 otherwise not. Defaults to false.
1657
1658 @param step
1659 """
1660 self._step = step
1661
1664 """This class contains configuration options for scatter series
1665
1666 @author: Invient
1667 @author: Richard Lincoln
1668 """
1669
1671 """@param shadow:
1672 @raise NotImplementedError:
1673 Scatter series does not support shadow so this method
1674 throws an exception if invoked.
1675 """
1676 raise NotImplementedError, 'Scatter chart does not support shadow.'
1677
1678
1680 """@return: Returns null as scatter series does not have shadow."""
1681 return None
1682
1685 """This class contains configuration options for spline series
1686
1687 @author: Invient
1688 @author: Richard Lincoln
1689 """
1690 pass
1691
1694 """This class contains configuration options for pie series.
1695
1696 @author: Invient
1697 @author: Richard Lincoln
1698 """
1699
1701 super(PieConfig, self).__init__()
1702
1703 self._centerX = None
1704 self._centerY = None
1705 self._borderColor = None
1706 self._borderWidth = None
1707 self._innerSize = None
1708 self._size = None
1709 self._slicedOffset = None
1710
1711
1713 """@return: Returns x position (in pixel) of the center of the pie
1714 chart relative to the plot area.
1715 """
1716 return self._centerX
1717
1718
1720 """Sets x position (in pixel) of the center of the pie chart relative
1721 to the plot area.
1722
1723 @param centerX
1724 """
1725 self._centerX = centerX
1726
1727
1729 """@return: Returns y position (in pixel) of the center of the pie
1730 chart relative to the plot area.
1731 """
1732 return self._centerY
1733
1734
1736 """Sets y position (in pixel) of the center of the pie chart relative
1737 to the plot area.
1738
1739 @param centerY
1740 """
1741 self._centerY = centerY
1742
1743
1745 """@return: Returns color of border surrounding each slice."""
1746 return self._borderColor
1747
1748
1750 """Sets color of border surrounding each slice.
1751
1752 @param borderColor
1753 """
1754 self._borderColor = borderColor
1755
1756
1758 """@return: Returns width of the border surrounding each slice."""
1759 return self._borderWidth
1760
1761
1763 """Sets width of border surrounding each slice.
1764
1765 @param borderWidth
1766 """
1767 self._borderWidth = borderWidth
1768
1769
1771 """@return: Returns size of the inner diameter of the pie."""
1772 return self._innerSize
1773
1774
1776 """Sets the size of the inner diameter for the pie. Any value greater
1777 than 0 renders a donut chart.
1778
1779 @param innerSize
1780 """
1781 self._innerSize = innerSize
1782
1783
1785 """@return: Returns size of diameter of the pie relative to the plot
1786 area."""
1787 return self._size
1788
1789
1791 """Sets size of diameter of the pie relative to the plot area.
1792
1793 @param size
1794 """
1795 self._size = size
1796
1797
1799 """@return: Returns offset in pixel by which a slice should be moved
1800 out from the center.
1801 """
1802 return self._slicedOffset
1803
1804
1806 """Sets offset in pixel by which a slice should be moved out from the
1807 center.
1808
1809 @param slicedOffset
1810 """
1811 self._slicedOffset = slicedOffset
1812
1813
1815 """@raise NotimplementedError:
1816 Pie chart does not support visible property so this
1817 method throws an exception if invoked.
1818 """
1819 raise NotImplementedError('Pie chart does not support visible property.')
1820
1821
1823 """@raise NotImplementedError:
1824 Pie chart does not support shadow property so this
1825 method throws an exception if invoked.
1826 """
1827 raise NotImplementedError('Pie chart does not support shadow.')
1828
1829
1831 """@return: Returns null as pie does not support toggle (show/hide
1832 pie) feature."""
1833 return None
1834
1835
1837 """@return: Returns null as pie series does not support shadow."""
1838 return None
1839
1840
1842 """Sets an object of L{PieDataLabel} which contains configuration
1843 for formatting data labels.
1844
1845 @param dataLabel
1846 """
1847 super(PieConfig, self).setDataLabel(dataLabel)
1848
1849
1852
1853
1855 """Sets state which should be applied to a slice when a mouse is
1856 over the slice
1857
1858 @param state
1859 """
1860 super(PieConfig, self).setHoverState(state)
1861
1862
1868
1871 """This class contains configuration options for bar and column series.
1872
1873 @author: Invient
1874 @author: Richard Lincoln
1875 """
1876
1878 super(BaseBarConfig, self).__init__()
1879
1880 self._borderColor = None
1881 self._borderRadius = None
1882 self._borderWidth = None
1883 self._colorByPoint = None
1884 self._groupPadding = None
1885 self._minPointLength = None
1886 self._pointPadding = None
1887 self._pointWidth = None
1888
1889
1891 """@return"""
1892 return self._borderColor
1893
1894
1896 """Sets the color of the border surronding each column or bar.
1897
1898 @param borderColor
1899 """
1900 self._borderColor = borderColor
1901
1902
1904 """@return"""
1905 return self._borderRadius
1906
1907
1909 """Sets corner radius of the border surronding each column or bar.
1910
1911 @param borderRadius
1912 """
1913 self._borderRadius = borderRadius
1914
1915
1917 """@return"""
1918 return self._borderWidth
1919
1920
1922 """Sets width of the border surronding each column or bar.
1923
1924 @param borderWidth
1925 """
1926 self._borderWidth = borderWidth
1927
1928
1930 """@return"""
1931 return self._colorByPoint
1932
1933
1935 """If the argument is true then each point (bar or column in a series
1936 will have a different color otherwise all points (bars/columns) of a
1937 series will have same color.
1938
1939 @param colorByPoint
1940 """
1941 self._colorByPoint = colorByPoint
1942
1943
1945 """@return"""
1946 return self._groupPadding
1947
1948
1950 """Sets padding between each value groups, in x axis units. Defaults
1951 to 0.2.
1952
1953 @param groupPadding
1954 """
1955 self._groupPadding = groupPadding
1956
1957
1959 """@return"""
1960 return self._minPointLength
1961
1962
1964 """Sets the minimal height for a column or width for a bar. By default,
1965 0 values are not shown. To visualize a 0 (or close to zero) point,
1966 set the minimal point length to a pixel value like 3. In stacked
1967 column charts, minPointLength might not be respected for tightly
1968 packed values. Defaults to 0. (For detail, refer to
1969 U{http://www.highcharts.com/ref/#plotOptions-bar});
1970
1971 @param minPointLength
1972 """
1973 self._minPointLength = minPointLength
1974
1975
1977 """@return"""
1978 return self._pointPadding
1979
1980
1982 """Sets padding between each column or bar, in x axis units.
1983
1984 @param pointPadding
1985 """
1986 self._pointPadding = pointPadding
1987
1988
1990 """@return"""
1991 return self._pointWidth
1992
1993
1995 """Sets width of each bar or column in pixel.
1996
1997 @param pointWidth
1998 """
1999 self._pointWidth = pointWidth
2000
2001
2003 """Sets state which should be applied to a bar or column when a
2004 mouse is over the bar or column
2005
2006 @param state
2007 """
2008 super(BaseBarConfig, self).setHoverState(state)
2009
2010
2016
2019 """This class contains configuration options for column series.
2020
2021 @author: Invient
2022 @author: Richard Lincoln
2023 """
2024 pass
2025
2028 """This class contains configuration options for bar series.
2029
2030 @author: Invient
2031 @author: Richard Lincoln
2032 """
2033 pass
2034
2037 """Defines ways in which series of a chart can be stacked.
2038
2039 Stacking.Normal - represents that the values of each series are stacked.
2040
2041 Stacking.Percent - represents that the the values of each series are
2042 stacked based on percentage of sum of total value, where total value is
2043 sum of values of all points on a particular tick of an axis.
2044
2045 @author Invient
2046 """
2047 NORMAL = None
2048 PERCENT = None
2049
2051 self._stacking = stacking
2052
2054 return self._stacking
2055
2056 @classmethod
2059
2060 Stacking.NORMAL = Stacking('normal')
2061 Stacking.PERCENT = Stacking('percent')
2065 """Defines configuration per point in a series. It is possible to assign
2066 each point a different color and marker.
2067
2068 @author: Invient
2069 @author: Richard Lincoln
2070 """
2071
2072 - def __init__(self, sliced_or_color_or_marker, selected=None, color=None,
2073 marker=None):
2074 """Creates an instance of this class with specified argument. The
2075 sliced attribute has meaning only for Pie chart/series.
2076
2077 @param sliced_or_color_or_marker:
2078 - If true then the slice of a pie will be at an offset
2079 from the center of the pie. Applicable only for Pie
2080 chart/series.
2081 @param selected:
2082 - If true then the point, to which this object is
2083 associated, will be shown as selected otherwise not.
2084 @param color:
2085 - Specifies individual color for a point, to which this
2086 object is associated.
2087 @param marker:
2088 - Specifies marker for a point, to which this object is
2089 associated.
2090 @see: L{Marker}
2091 @see: L{Color}
2092 """
2093 if selected is None:
2094 if isinstance(sliced_or_color_or_marker, Marker):
2095 marker = sliced_or_color_or_marker
2096 sliced = selected = color = None
2097 elif isinstance(sliced_or_color_or_marker, IPaint):
2098 color = sliced_or_color_or_marker
2099 sliced = selected = marker = None
2100 else:
2101 sliced = selected = sliced_or_color_or_marker
2102 marker = color = None
2103
2104 super(PointConfig, self).__init__()
2105 self._sliced = sliced
2106 self._selected = selected
2107 self._color = color
2108 self._marker = marker
2109
2110
2112 """@return"""
2113 return self._sliced
2114
2115
2117 """@param sliced"""
2118 self._sliced = sliced
2119
2120
2122 """@return"""
2123 return self._selected
2124
2125
2127 """@param selected"""
2128 self._selected = selected
2129
2130
2132 """@return"""
2133 return self._color
2134
2135
2137 """@param color"""
2138 self._color = color
2139
2140
2142 """@return"""
2143 return self._marker
2144
2145
2147 """@param marker"""
2148 self._marker = marker
2149
2150
2152 """@return: Returns string representation of this object."""
2153 return ('PointConfig [sliced=' + str(self._sliced)
2154 + ', selected=' + str(self._selected)
2155 + ', color=' + str(self._color)
2156 + ', marker=' + str(self._marker)
2157 + ']')
2158
2161 """A chart has a title and a subtitle. This class defines attributes
2162 which are common to both.
2163
2164 The text of a title can be plain text or html text containing html
2165 elements. It is also possible to apply css to the title. The css must
2166 be valid css string e.g. { color: 'red' }
2167
2168 @author: Invient
2169 @author: Richard Lincoln
2170
2171 @see: L{Title}
2172 @see: L{SubTitle}
2173 @see: L{HorzAlign}
2174 @see: L{VertAlign}
2175 """
2176
2178 self._align = None
2179 self._vertAlign = None
2180 self._floating = None
2181 self._text = None
2182 self._x = None
2183 self._y = None
2184 self._style = None
2185
2186
2189
2190
2192 """Sets horizontal alignment of the title. Defaults to HorzAlign.CENTER
2193 """
2194 self._align = align
2195
2196
2198 return self._vertAlign
2199
2200
2202 """Sets horizontal alignment of the title. Defaults to VertAlign.TOP
2203 """
2204 self._vertAlign = vertAlign
2205
2206
2208 return self._floating
2209
2210
2212 """If the argument is true then the plot area will not move to make
2213 space for the chart title. Defaults to false.
2214 """
2215 self._floating = floating
2216
2217
2218 - def getText(self):
2220
2221
2222 - def setText(self, text):
2223 """Sets text for the chart's title. The text can be plain or html
2224 string.
2225 """
2226 self._text = text
2227
2228
2231
2232
2233 - def setX(self, x):
2234 """Sets x position (in pixel) of the title relative to the alignment
2235 within Spacing.left and Spacing.right. Defaults to 0
2236 """
2237 self._x = x
2238
2239
2242
2243
2244 - def setY(self, y):
2245 """Sets y position (in pixel) of the title relative to the alignment
2246 within Spacing.top and Spacing.bottom. Defaults to 0
2247 """
2248 self._y = y
2249
2250
2253
2254
2256 """Sets css for the title. The css must be a valid css object. e.g. css
2257 string "{ color:'red' }" is valid but "{ color: 'red'" is invalid.
2258 """
2259 self._style = style
2260
2261
2262 -class Title(TitleBase):
2263 """Defines attributes of chart title.
2264
2265 @author: Invient
2266 @author: Richard Lincoln
2267 """
2268
2272
2273
2276
2277
2279 """Sets margin (in pixel) between the chart title and subtitle, if any.
2280 If chart subtitle doesn't exist then it indicates the margin between
2281 subtitle and plotarea. Defaults to 15
2282 """
2283 self._margin = margin
2284
2287 """Defines attributes of chart subtitle.
2288
2289 @author: Invient
2290 @author: Richard Lincoln
2291 """
2292 pass
2293
2296
2297 LEFT = None
2298 CENTER = None
2299 RIGHT = None
2300
2303
2306
2307 @classmethod
2310
2311 HorzAlign.LEFT = HorzAlign('left')
2312 HorzAlign.CENTER = HorzAlign('center')
2313 HorzAlign.RIGHT = HorzAlign('right')
2317
2318 TOP = None
2319 MIDDLE = None
2320 BOTTOM = None
2321
2324
2327
2328 @classmethod
2331
2332 VertAlign.TOP = VertAlign('top')
2333 VertAlign.MIDDLE = VertAlign('middle')
2334 VertAlign.BOTTOM = VertAlign('bottom')
2335
2336
2337 -class State(object):
2338 """Defines state for a series and point. A series can be in hover state.
2339 A point can be in hover and select state. In each state, a series and a
2340 point can have different visual clues. This is achived by setting some
2341 attributes of a seires and point.
2342
2343 @author: Invient
2344 @author: Richard Lincoln
2345
2346 @see: L{SeriesState}
2347 """
2348
2351
2354 """Defines a set of attributes which will be applied to a series upon
2355 hover. The attributes linWidth is not applicable for Pie, Scatter, Bar
2356 and Column series.
2357
2358 @author: Invient
2359 @author: Richard Lincoln
2360 """
2361
2363 self._enabled = None
2364 self._lineWidth = None
2365
2366
2368 return self._enabled
2369
2370
2372 """If the argument is true then the other properties of this class
2373 have impact on visual rendering of the series when a series is hovered
2374 or when a mouse is over the legend. Enabling this has a performance
2375 penalty.
2376
2377 Defaults to false.
2378 """
2379 self._enabled = enabled
2380
2381
2383 return self._lineWidth
2384
2385
2387 """Sets width of a line in pixel. Defaults to 2.
2388 """
2389 self._lineWidth = lineWidth
2390
2393 """Defines a set of attributes which are meaningful for bar and colum
2394 series.
2395
2396 @author: Invient
2397 @author: Richard Lincoln
2398 """
2400 self._brightness = None
2401
2402
2404 return self._brightness
2405
2406
2408 """Sets intensity of brightness for a point. This applies only to
2409 bar and column series/chart
2410
2411 Defaults to 0.1
2412 """
2413 self._brightness = brightness
2414
2417 """Defines a collection of attributes which makes a marker. Markers
2418 are generally used to annotate a graph points.
2419
2420 @author: Invient
2421 @author: Richard Lincoln
2422 """
2423
2425 self._enabled = None
2426 self._fillColor = None
2427 self._lineColor = None
2428 self._lineWidth = None
2429 self._radius = None
2430
2432 return self._enabled
2433
2435 self._enabled = enabled
2436
2438 return self._fillColor
2439
2441 self._fillColor = fillColor
2442
2444 return self._lineColor
2445
2447 self._lineColor = lineColor
2448
2450 return self._lineWidth
2451
2453 self._lineWidth = lineWidth
2454
2457
2459 self._radius = radius
2460
2462 return ('MarkerStateAttribute [enabled=' + str(self._enabled)
2463 + ', fillColor=' + str(self._fillColor)
2464 + ', lineColor=' + str(self._lineColor)
2465 + ', lineWidth=' + str(self._lineWidth)
2466 + ', radius=' + str(self._radius)
2467 + ']')
2468
2471 """Defines a set of attributes which gets applied to a point when a point
2472 is selected or hovered. By default, markers are enabled so when a mouse is
2473 over a point marker gets applied. To turn off marker, set flag enabled to
2474 false.
2475
2476 A point marker is useful only if the marker is not an image.
2477
2478 @author: Invient
2479 @author: Richard Lincoln
2480
2481 @see: L{ImageMarker}
2482 @see: L{SymbolMarker}
2483 """
2484
2486 """Creates this marker with specified argument. If enabled = false
2487 then the marker will not be applied to a point on hover or select
2488 state.
2489 """
2490 self._markerAttribute = MarkerAttribute()
2491
2492 self._markerAttribute.setEnabled(True)
2493
2494
2497
2498
2500 """If enabled = false then the marker will not be applied to a point
2501 on hover or select state. Defaults to true
2502 """
2503 self._markerAttribute.setEnabled(enabled)
2504
2505
2508
2509
2511 """Sets fill color for the marker. When not specified it takes color
2512 of a series or point.
2513 """
2514 self._markerAttribute.setFillColor(fillColor)
2515
2516
2519
2520
2522 """Sets color of the point marker's outline. When not specified it
2523 takes color of a series or point.
2524 """
2525 self._markerAttribute.setLineColor(lineColor)
2526
2527
2530
2531
2533 """Sets width of the point marker's outline. Defaults to 0.
2534 """
2535 self._markerAttribute.setLineWidth(lineWidth)
2536
2537
2539 return self._markerAttribute.getRadius()
2540
2541
2543 """Sets radius of the point marker. Defaults to 0.
2544 """
2545 self._markerAttribute.setRadius(radius)
2546
2547
2555
2558 """Defines a marker for a point. Markers are applied to a point of
2559 chart's series. The marker can be applied at the time of drawing the
2560 chart or when a point is selcted or hovered.
2561
2562 There are two types of marker.
2563 * L{SymbolMarker}
2564 * L{ImageMarker}
2565
2566 @author: Invient
2567 @author: Richard Lincoln
2568
2569 @see: L{SymbolMarker}
2570 @see: L{ImageMarker}
2571 """
2572
2574 raise NotImplementedError
2575
2577 raise NotImplementedError
2578
2581 """Defines attributes for a marker.
2582
2583 @author: Invient
2584 @author: Richard Lincoln
2585
2586 @see: L{SymbolMarker}
2587 @see: L{ImageMarker}
2588 """
2589
2593
2596
2599
2602
2605
2608
2611
2613 return self._markerAttribute.getRadius()
2614
2617
2620
2623
2626 """This marker can take url of an image which will be used as a marker
2627 for a point or all points of a series.
2628
2629 The url of an image must be with respect to root of the web application.
2630
2631 @author: Invient
2632 @author: Richard Lincoln
2633 """
2634
2635 - def __init__(self, imageURL, enabled=True):
2636 """Creates this marker with specified arguments.
2637
2638 @param imageURL:
2639 - URL of an image
2640 @param enabled:
2641 - If false then this marker will not be applied to a
2642 point. What this means is that the data points of a line
2643 chart will not stand out.
2644 """
2645 super(ImageMarker, self).__init__(enabled)
2646 self._imageURL = imageURL
2647
2648
2650 return self._imageURL
2651
2652
2654 self._imageURL = imageURL
2655
2656
2658 return ('ImageMarker [imageURL=' + str(self._imageURL)
2659 + ', enabled' + str(self.getEnabled())
2660 + ']')
2661
2664 """This marker has predefined shape which cannot be changed. However,
2665 marker attributes can be set.
2666
2667 @author: Invient
2668 @author: Richard Lincoln
2669 """
2670
2672 """Creates this marker with enabled = true
2673 ---
2674 Creates this marker with specified arguments.
2675
2676 @param enabled
2677 If false then this marker will not be applied to a point.
2678 What this means is that the data points of a line chart
2679 will not stand out.
2680 ---
2681 Creates this marker with specified arguments.
2682
2683 @param lineColor
2684 - Color of the point marker's outline
2685 ---
2686 Creates this marker with specified arguments.
2687
2688 @param radius
2689 Radius of the point marker.
2690 ---
2691 Creates this marker with specified arguments.
2692
2693 @param symbol
2694 It must be one of the predefine symbol such as
2695 Symbol.CIRCLE or Symbol.DIAMOND
2696 ---
2697 Creates this marker with specified arguments.
2698
2699 @param lineColor
2700 Color of the point marker's outline
2701 @param radius
2702 Radius of the point marker.
2703 ---
2704 Creates this marker with specified arguments.
2705
2706 @param lineColor
2707 - Color of the point marker's outline
2708 @param radius
2709 Radius of the point marker.
2710 @param symbol
2711 It must be one of the predefine symbol such as
2712 Symbol.CIRCLE or Symbol.DIAMOND
2713 """
2714 self._symbol = None
2715 self._hoverState = None
2716 self._selectState = None
2717
2718 nargs = len(args)
2719 if nargs == 0:
2720 super(SymbolMarker, self).__init__(True)
2721 elif nargs == 1:
2722 if isinstance(args[0], IPaint):
2723 lineColor, = args
2724 super(SymbolMarker, self).__init__(True)
2725 super(SymbolMarker, self).setLineColor(lineColor)
2726 elif isinstance(args[0], bool):
2727 enabled, = args
2728 super(SymbolMarker, self).__init__(enabled)
2729 elif isinstance(args[0], int):
2730 radius, = args
2731 super(SymbolMarker, self).__init__(True)
2732 self.setRadius(radius)
2733 else:
2734 symbol, = args
2735 super(SymbolMarker, self).__init__(True)
2736 self._symbol = symbol
2737 elif nargs == 2:
2738 lineColor, radius = args
2739 super(SymbolMarker, self).__init__(True)
2740 super(SymbolMarker, self).setLineColor(lineColor)
2741 super(SymbolMarker, self).setRadius(radius)
2742 elif nargs == 3:
2743 lineColor, radius, symbol = args
2744 super(SymbolMarker, self).__init__(True)
2745 super(SymbolMarker, self).setLineColor(lineColor)
2746 super(SymbolMarker, self).setRadius(radius)
2747 self._symbol = symbol
2748 else:
2749 raise ValueError
2750
2751
2754
2755
2760
2761
2764
2765
2770
2771
2774
2775
2780
2781
2784
2785
2790
2791
2794
2795
2797 """Sets symbol for the point marker. It must be one of the predefine
2798 symbol such as Symbol.CIRCLE or Symbol.DIAMOND
2799 """
2800 self._symbol = symbol
2801
2802
2804 return self._hoverState
2805
2806
2808 """Sets marker to be applied to a point when it is hovered.
2809 """
2810 self._hoverState = hoverState
2811
2812
2814 return self._selectState
2815
2816
2818 """Sets marker to be applied to a point when it is selected.
2819 """
2820 self._selectState = selectState
2821
2822
2824 return ('SymbolMarker [symbol=' + str(self._symbol)
2825 + ', hoverState=' + str(self._hoverState)
2826 + ', selectState=' + str(self._selectState)
2827 + ', getLineColor()=' + str(self.getLineColor())
2828 + ', getFillColor()=' + str(self.getFillColor())
2829 + ', getLineWidth()=' + str(self.getLineWidth())
2830 + ', getRadius()=' + str(self.getRadius())
2831 + ', getSymbol()=' + str(self.getSymbol())
2832 + ', getHoverState()=' + str(self.getHoverState())
2833 + ', getSelectState()=' + str(self.getSelectState())
2834 + ']')
2835
2838 """Defines predefined marker shapes to be used along with
2839 L{SymbolMarker}
2840
2841 @author: Invient
2842 @author: Richard Lincoln
2843
2844 @see: L{SymbolMarker}
2845 """
2846
2847 CIRCLE = None
2848 DIAMOND = None
2849 SQUARE = None
2850 TRIANGLE = None
2851 TRIANGLE_DOWN = None
2852
2854 self._symbol = symbol
2855
2858
2859 @classmethod
2863
2864 Symbol.CIRCLE = Symbol('circle')
2865 Symbol.DIAMOND = Symbol('diamond')
2866 Symbol.SQUARE = Symbol('square')
2867 Symbol.TRIANGLE = Symbol('triangle')
2868 Symbol.TRIANGLE_DOWN = Symbol('triangle-down')
2869
2870
2871 -class Axis(object):
2872
2875
2878
2881
2884
2887
2890
2893
2896
2899
2902
2905
2908
2911
2914
2917
2920
2923
2926
2929
2932
2935
2938
2941
2944
2947
2950
2953
2956
2959
2962
2965
2968
2971
2974
2977
2980
2983
2986
2989
2992
2995
2998
3001
3005
3009
3012 """This class defines attributes common to X axis and Y axis. A chart can
3013 have one or more axis of each type.
3014
3015 @author: chirag
3016 @author: Richard Lincoln
3017
3018 @see: L{XAxis}
3019 @see: L{YAxis}
3020 """
3021
3023 super(AxisBase, self).__init__()
3024
3025 self._id = None
3026 self._type = AxisType.LINEAR
3027 self._title = None
3028 self._label = None
3029 self._plotBands = OrderedSet()
3030 self._plotLines = OrderedSet()
3031 self._alternateGridColor = None
3032 self._endOnTick = None
3033 self._grid = None
3034 self._lineColor = None
3035 self._lineWidth = None
3036 self._linkedTo = None
3037 self._maxPadding = None
3038 self._maxZoom = None
3039
3040
3041 self._minPadding = None
3042 self._tick = None
3043 self._minorGrid = None
3044 self._minorTick = None
3045 self._offset = None
3046 self._opposite = None
3047 self._reversed = None
3048 self._showFirstLabel = None
3049 self._showLastLabel = None
3050 self._startOfWeek = None
3051 self._startOnTick = None
3052
3053
3055 return self._plotBands
3056
3057
3059 if plotBands is not None:
3060 self._plotBands = plotBands
3061
3062
3064 self._plotBands.add(plotBand)
3065
3066
3068 """Removes a plotband with given id.
3069 """
3070 if isinstance(plotBand_or_id, PlotBand):
3071 plotBand = plotBand_or_id
3072 self._plotBands.remove(plotBand)
3073 else:
3074 Id = plotBand_or_id
3075 for pb in set(self._plotBands):
3076 if pb.getId() == Id:
3077 self._plotBands.remove(pb)
3078 break
3079
3080
3082 return self._plotLines
3083
3084
3086 if plotLines is not None:
3087 self._plotLines = plotLines
3088
3089
3091 self._plotLines.add(plotLine)
3092
3093
3095 if isinstance(plotLine_or_id, PlotLine):
3096 plotLine = plotLine_or_id
3097 self._plotLines.remove(plotLine)
3098 else:
3099 Id = plotLine_or_id
3100 for i, pl in enumerate(self._plotLines[:]):
3101 if pl.getId() == Id:
3102 del self._plotLines[i]
3103 break
3104
3105
3108
3109
3111 """Sets an id for the axis"""
3112 self._id = Id
3113
3114
3117
3118
3120 """Sets tick for the axis"""
3121 self._tick = tick
3122
3123
3125 return self._maxZoom
3126
3127
3129 """Sets maximum amount of zoom for this axis. For datetime axis, the
3130 maxZoom must be specified in milliseconds. For example, for a
3131 datetime axis the main unit is milliseconds. If maxZoom is set to
3132 3600000, you can't zoom in more than to one hour. (Above example is
3133 taken from Highcharts documentation)
3134 """
3135 self._maxZoom = maxZoom
3136
3137
3139 return self._reversed
3140
3141
3143 """If the argument it true then this axis will be reversed. Defaults
3144 to false.
3145 """
3146 self._reversed = r
3147
3148
3150 return self._opposite
3151
3152
3154 """If the argument is true then another axis on the opposite side of
3155 this axis will be displayed. The normal axis is on left side for
3156 vertical axes and bottom for horzontal axes.
3157 """
3158 self._opposite = opposite
3159
3160
3163
3164
3166 """Sets type of this axis. Used by subclasses
3167
3168 @see: L{NumberXAxis}
3169 @see: L{NumberYAxis}
3170 @see: L{DateTimeAxis}
3171 """
3172 self._type = typ
3173
3174
3177
3178
3180 """Sets title for the axis
3181
3182 @see: L{AxisTitle}
3183 """
3184 self._title = title
3185
3186
3189
3190
3193
3194
3196 return self._alternateGridColor
3197
3198
3200 """Sets a color to be used for alternate grids of the chart"""
3201 self._alternateGridColor = alternateGridColor
3202
3203
3205 return self._endOnTick
3206
3207
3209 """If the argument is true then this axis will end on a tick."""
3210 self._endOnTick = endOnTick
3211
3212
3215
3216
3218 """Sets grid for this axis
3219
3220 @see: L{Grid}
3221 """
3222 self._grid = grid
3223
3224
3226 return self._lineColor
3227
3228
3230 """Sets a color for line of this axis. This line indicate this axis"""
3231 self._lineColor = lineColor
3232
3233
3235 return self._lineWidth
3236
3237
3239 """Sets width of this axis line"""
3240 self._lineWidth = lineWidth
3241
3242
3244 return self._linkedTo
3245
3246
3248 """Sets another axis which is linked with this axis. The following
3249 description is copied from Highcharts API documentation
3250 U{http://www.highcharts.com/ref/#xAxis}.
3251
3252 When an axis is linked to a master axis, it will take the same
3253 extremes as the master, but as assigned by min or max or by
3254 setExtremes. It can be used to show additional info, or to ease
3255 reading the chart by duplicating the scales. Defaults to null.
3256 """
3257 if linkedTo is not self:
3258 self._linkedTo = linkedTo
3259
3260
3262 return self._maxPadding
3263
3264
3266 self._maxPadding = maxPadding
3267
3268
3270 return self._minPadding
3271
3272
3274 self._minPadding = minPadding
3275
3276
3278 return self._minorGrid
3279
3280
3282 self._minorGrid = minorGrid
3283
3284
3286 return self._minorTick
3287
3288
3290 self._minorTick = minorTick
3291
3292
3295
3296
3298 """Sets distance of this axis from the plot area"""
3299 self._offset = offset
3300
3301
3303 return self._showFirstLabel
3304
3305
3307 """If the argument is true then the label of this axis' first tick
3308 will be displayed. Defaults to true.
3309 """
3310 self._showFirstLabel = showFirstLabel
3311
3312
3314 return self._showLastLabel
3315
3316
3318 """If the argument is true then the label of this axis' last tick
3319 will be displayed. Defaults to false
3320 """
3321 self._showLastLabel = showLastLabel
3322
3323
3325 return self._startOfWeek
3326
3327
3329 """Sets a day to be considered as start of the week. For datetime axis,
3330 this decides where to put tick. e.g. if startOfWeek = THURSDAY then
3331 tick will be placed on every thursday.
3332 """
3333 self._startOfWeek = startOfWeek
3334
3335
3337 return self._startOnTick
3338
3339
3341 """If the argument is true then this axis must start on a tick.
3342 Defaults to false.
3343 """
3344 self._startOnTick = startOnTick
3345
3348 """Defines attributes of a minor tick. The minor ticks do not have a
3349 label. By default, minor ticks are not shown. To display minor ticks,
3350 set interval property.
3351
3352 @author: Invient
3353 @author: Richard Lincoln
3354
3355 @see: L{Tick}
3356 """
3357
3359 self._color = None
3360 self._interval = None
3361 self._length = None
3362 self._position = None
3363 self._width = None
3364
3365
3368
3369
3372
3373
3375 return self._interval
3376
3377
3379 """Sets interval for the minor tick. The interval must be specified
3380 in the axis unit. e.g. If an axis has tick interval of 50 units
3381 then setting minortick interval to 10 will show 5 minor ticks.
3382 """
3383 self._interval = interval
3384
3385
3388
3389
3391 """Sets length of the minorticks in pixel
3392 """
3393 self._length = length
3394
3395
3397 return self._position
3398
3399
3402
3403
3406
3407
3409 """Sets width of the minorticks in pixel
3410 """
3411 self._width = width
3412
3413
3415 return ('MinorTick [color=' + str(self._color)
3416 + ', length=' + str(self._length)
3417 + ', position=' + str(self._position)
3418 + ', width=' + str(self._width)
3419 + ']')
3420
3421
3422 -class Tick(MinorTick):
3423 """Defines attributes of a tick marks. The interval of the tick marks
3424 must be specified in axis unit. For datetime axis, the interval must
3425 be in millisecond.
3426
3427 The default tick interval is 1.
3428
3429 @author: Invient
3430 @author: Richard Lincoln
3431
3432 @see: L{MinorTick}
3433 @see: L{TickmarkPlacement}
3434 """
3435
3437 super(Tick, self).__init__()
3438 self._placement = None
3439 self._pixelInterval = None
3440
3441
3443 return self._placement
3444
3445
3447 """Sets placement of the tick marks.
3448 """
3449 self._placement = placement
3450
3451
3453 return self._pixelInterval
3454
3455
3457 """Sets pixel interval of the tick marks
3458 """
3459 self._pixelInterval = pixelInterval
3460
3461
3463 return ('Tick [placement=' + str(self._placement)
3464 + ', pixelInterval=' + str(self._pixelInterval)
3465 + ', getColor()=' + str(self.getColor())
3466 + ', getLength()=' + str(self.getLength())
3467 + ', getPosition()=' + str(self.getPosition())
3468 + ', getWidth()=' + str(self.getWidth())
3469 + ']')
3470
3473 """Defines attributes of minor grid lines of the chart. In order to show
3474 minor grid lines, you must specify set MinorTick for the axis also.
3475
3476 @author: Invient
3477 @author: Richard Lincoln
3478
3479 @see: L{MinorTick}
3480 @see: L{Grid}
3481 """
3482
3484 self._lineColor = None
3485 self._lineDashStyle = None
3486 self._lineWidth = None
3487
3488
3490 return self._lineColor
3491
3492
3494 """Sets color of the minor grid lines
3495 """
3496 self._lineColor = lineColor
3497
3498
3500 """@return"""
3501 return self._lineDashStyle
3502
3503
3505 """Sets dash or dot style of the minor grid lines. Defaults to
3506 DashStyle.SOLID
3507
3508 @see: L{DashStyle}
3509 """
3510 self._lineDashStyle = lineDashStyle
3511
3512
3514 """@return"""
3515 return self._lineWidth
3516
3517
3519 """Sets width (in pixel) of the minor grid lines. Defaults to 1
3520 """
3521 self._lineWidth = lineWidth
3522
3523
3525 return ('MinorGrid [lineColor=' + str(self._lineColor)
3526 + ', lineDashStyle=' + str(self._lineDashStyle)
3527 + ', lineWidth=' + str(self._lineWidth)
3528 + ']')
3529
3530
3531 -class Grid(MinorGrid):
3532 """Defines attributes of grid lines of the chart. By default, the grid
3533 lines are shown. To hide them set property lineWidth to 0.
3534
3535 @author: Invient
3536 @author: Richard Lincoln
3537 """
3538 pass
3539
3556
3559 """Defines position of the tick marks with respect to the axis
3560 categories. It is applicable only for categorized axes.
3561
3562 TickmarkPlacement.ON - tick mark is placed in the center of the
3563 category
3564
3565 TickmarkPlacement.BETWEEN - tick mark is placed between categories
3566
3567 @author: Invient
3568 @author: Richard Lincoln
3569 """
3570
3571 ON = None
3572 BETWEEN = None
3573
3576
3579
3580 @classmethod
3583
3584 TickmarkPlacement.ON = TickmarkPlacement('on')
3585 TickmarkPlacement.BETWEEN = TickmarkPlacement('between')
3589 """Defines position of the axis ticks with respect to the axis line
3590
3591 @author: Invient
3592 @author: Richard Lincoln
3593 """
3594
3595 OUTSIDE = None
3596 INSIDE = None
3597
3600
3603
3604 @classmethod
3607
3608 TickPosition.OUTSIDE = TickPosition('outside')
3609 TickPosition.INSIDE = TickPosition('inside')
3613 """Defines axis types.
3614
3615 AxisType.LINEAR -
3616
3617 AxisType.DATETIME - For datetime axis, the values are given in date
3618 except for L{BaseLineConfig.pointStart} and L{BaseLineConfig.pointInterval}
3619 properties, which are specified in milliseconds.
3620
3621 @author: Invient
3622 @author: Richard Lincoln
3623
3624 @see: L{NumberXAxis}
3625 @see: L{NumberYAxis}
3626 @see: L{DateTimeAxis}
3627 """
3628
3629 LINEAR = None
3630 DATETIME = None
3631
3634
3637
3638 @classmethod
3641
3642 AxisType.LINEAR = AxisType('linear')
3643 AxisType.DATETIME = AxisType('datetime')
3647
3648 LOW = ['low']
3649 MIDDLE = ['middle']
3650 HIGH = ['high']
3651
3654
3657
3658 @classmethod
3661
3662 AxisTitleAlign.LOW = AxisTitleAlign('low')
3663 AxisTitleAlign.MIDDLE = AxisTitleAlign('middle')
3664 AxisTitleAlign.HIGH = AxisTitleAlign('high')
3668
3670 self._text = text
3671 self._align = None
3672 self._style = None
3673 self._rotation = None
3674 self._margin = None
3675
3676 - def getText(self):
3678
3679 - def setText(self, text):
3681
3684
3687
3690
3693
3695 return self._rotation
3696
3698 self._rotation = rotation
3699
3702
3704 self._margin = margin
3705
3708
3710 super(PlotLabel, self).__init__()
3711 self._text = text
3712 self._align = None
3713 self._vertAlign = None
3714 self._rotation = None
3715 self._style = None
3716 self._textAlign = None
3717 self._x = None
3718 self._y = None
3719
3720 - def getText(self):
3722
3723 - def setText(self, text):
3725
3728
3731
3733 return self._vertAlign
3734
3736 self._vertAlign = vertAlign
3737
3739 return self._rotation
3740
3742 self._rotation = rotation
3743
3746
3749
3750 - def getTextAlign(self):
3751 return self._textAlign
3752
3753 - def setTextAlign(self, textAlign):
3754 self._textAlign = textAlign
3755
3758
3759 - def setX(self, x):
3761
3764
3765 - def setY(self, y):
3767
3770
3772 self._id = Id
3773 self._color = None
3774 self._range = None
3775 self._zIndex = None
3776 self._label = None
3777
3780
3783
3786
3789
3792
3795
3798
3801
3804
3806 prime = 31
3807 result = 1
3808 result = (prime * result) + (0 if self._id is None else self._id.__hash__())
3809 return result
3810
3812 if self is obj:
3813 return True
3814 if obj is None:
3815 return False
3816 if self.getClass() != obj.getClass():
3817 return False
3818 other = obj
3819 if self._id is None:
3820 if other.id is not None:
3821 return False
3822 elif not (self._id == other.id):
3823 return False
3824 return True
3825
3826
3827 -class Range(object):
3829
3841
3861
3873
3893
3896
3898 self._id = Id
3899 self._color = None
3900 self._dashStyle = None
3901 self._value = None
3902 self._width = 1
3903 self._zIndex = None
3904 self._label = None
3905
3908
3911
3913 return self._dashStyle
3914
3916 self._dashStyle = dashStyle
3917
3920
3923
3926
3929
3932
3935
3938
3941
3944
3947
3948
3949 -class Value(object):
3951
3963
3976
3988
4001
4004
4011
4013 return self._allowDecimals
4014
4016 self._allowDecimals = allowDecimals
4017
4020
4023
4026
4029
4032
4035
4038
4041
4044
4047
4050
4053
4062
4071
4074
4081
4084
4087
4090
4093
4096
4099
4102
4105
4108
4111
4114
4117
4120
4123
4185
4188
4192
4194 return self._categories
4195
4197 if categories is not None:
4198 self._categories = categories
4199
4202
4205
4208
4211
4214
4217
4220
4223
4226
4229
4232
4234 self._backgroundColor = None
4235 self._borderColor = None
4236 self._borderRadius = None
4237 self._borderWidth = None
4238 self._enabled = enabled
4239 self._floating = None
4240 self._itemHiddenStyle = None
4241 self._itemHoverStyle = None
4242 self._itemStyle = None
4243 self._itemWidth = None
4244 self._layout = None
4245 self._labelFormatterJsFunc = None
4246 self._margin = None
4247 self._reversed = None
4248 self._shadow = None
4249 self._symbolPadding = None
4250 self._symbolWidth = None
4251 self._width = None
4252 self._position = None
4253
4255 return self._backgroundColor
4256
4258 self._backgroundColor = backgroundColor
4259
4261 return self._borderColor
4262
4264 self._borderColor = borderColor
4265
4267 return self._borderRadius
4268
4270 self._borderRadius = borderRadius
4271
4273 return self._borderWidth
4274
4276 self._borderWidth = borderWidth
4277
4279 return self._enabled
4280
4282 self._enabled = enabled
4283
4285 return self._floating
4286
4288 self._floating = floating
4289
4291 return self._itemHiddenStyle
4292
4294 self._itemHiddenStyle = itemHiddenStyle
4295
4297 return self._itemHoverStyle
4298
4300 self._itemHoverStyle = itemHoverStyle
4301
4303 return self._itemStyle
4304
4306 self._itemStyle = itemStyle
4307
4309 return self._itemWidth
4310
4312 self._itemWidth = itemWidth
4313
4316
4319
4322
4325
4328
4330 self._margin = margin
4331
4333 return self._reversed
4334
4337
4340
4342 self._shadow = shadow
4343
4345 return self._symbolPadding
4346
4348 self._symbolPadding = symbolPadding
4349
4351 return self._symbolWidth
4352
4354 self._symbolWidth = symbolWidth
4355
4358
4361
4363 return self._position
4364
4367
4369 return ('Legend [backgroundColor=' + str(self._backgroundColor)
4370 + ', borderColor=' + str(self._borderColor)
4371 + ', borderRadius=' + str(self._borderRadius)
4372 + ', borderWidth=' + str(self._borderWidth)
4373 + ', enabled=' + str(self._enabled)
4374 + ', floating=' + str(self._floating)
4375 + ', itemHiddenStyle=' + str(self._itemHiddenStyle)
4376 + ', itemHoverStyle=' + str(self._itemHoverStyle)
4377 + ', itemStyle=' + str(self._itemStyle)
4378 + ', itemWidth=' + str(self._itemWidth)
4379 + ', layout=' + str(self._layout)
4380 + ', labelFormatter=' + str(self._labelFormatterJsFunc)
4381 + ', margin=' + str(self._margin)
4382 + ', reversed=' + str(self._reversed)
4383 + ', shadow=' + str(self._shadow)
4384 + ', symbolPadding=' + str(self._symbolPadding)
4385 + ', symbolWidth=' + str(self._symbolWidth)
4386 + ', width=' + str(self._width)
4387 + ', position=' + str(self._position)
4388 + ']')
4389
4405
4406 Layout.HORIZONTAL = Layout('horizontal')
4407 Layout.VERTICAL = Layout('vertical')
4408
4409
4410 -class Credit(object):
4411
4413 self._enabled = None
4414 self._link = None
4415 self._style = None
4416 self._text = None
4417 self._position = None
4418
4420 return self._enabled
4421
4423 self._enabled = enabled
4424
4427
4430
4433
4436
4437 - def getText(self):
4439
4440 - def setText(self, text):
4442
4444 return self._position
4445
4448
4450 return ('Credit [enabled=' + str(self._enabled)
4451 + ', link=' + str(self._link)
4452 + ', style=' + str(self._style)
4453 + ', text=' + str(self._text)
4454 + ', position=' + str(self._position)
4455 + ']')
4456
4459
4461 self._align = None
4462 self._vertAlign = None
4463 self._x = None
4464 self._y = None
4465
4468
4471
4473 return self._vertAlign
4474
4476 self._vertAlign = vertAlign
4477
4480
4481 - def setX(self, x):
4483
4486
4487 - def setY(self, y):
4489
4491 return ('Position [align=' + str(self._align)
4492 + ', vertAlign=' + str(self._vertAlign)
4493 + ', x=' + str(self._x)
4494 + ', y=' + str(self._y) + ']')
4495
4593