Object/Series.pm untested

filter: Statementstmt 0.0% 0 / 117 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 26 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 158 CC 6 SCAR 14.3
CC
6
Cov
0%
from_hash
12.0
_deserialize
12.0
TO_JSON
6.0
CRAP 4.2
1 =begin comment
2
3 Copyright (c) 2026 Aspose.Cells Cloud
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 SOFTWARE.
21
22 =end comment
23
24 =cut
25
26 package AsposeCellsCloud::Object::Series;
27
28 require 5.6.0;
29 use strict;
30 use warnings;
31 use utf8;
32 use JSON qw(decode_json);
33 use Data::Dumper;
34 use Module::Runtime qw(use_module);
35 use Log::Any qw($log);
36 use Date::Parse;
37 use DateTime;
38 use AsposeCellsCloud::Object::Area;
39 use AsposeCellsCloud::Object::DataLabels;
40 use AsposeCellsCloud::Object::DropBars;
41 use AsposeCellsCloud::Object::ErrorBar;
42 use AsposeCellsCloud::Object::LegendEntry;
43 use AsposeCellsCloud::Object::Line;
44 use AsposeCellsCloud::Object::Link;
45 use AsposeCellsCloud::Object::LinkElement;
46 use AsposeCellsCloud::Object::Marker;
47 use AsposeCellsCloud::Object::Trendlines;
48
49
50 use base ("Class::Accessor", "Class::Data::Inheritable");
51
52
53
54 __PACKAGE__->mk_classdata('attribute_map' => {});
55 __PACKAGE__->mk_classdata('swagger_types' => {});
56 __PACKAGE__->mk_classdata('method_documentation' => {});
57 __PACKAGE__->mk_classdata('class_documentation' => {});
58
59 # new object
60 sub new {
61 my ($class, %args) = @_;
62
63 my $self = bless {}, $class;
64
65 foreach my $attribute (keys %{$class->attribute_map}) {
66 my $args_key = $class->attribute_map->{$attribute};
67 $self->$attribute( $args{ $args_key } );
68 }
69
70 return $self;
71 }
72
73 # return perl hash
74 sub to_hash {
75 return decode_json(JSON->new->convert_blessed->encode( shift ));
76 }
77
78 # used by JSON for serialization
79 sub TO_JSON {
80 my $self = shift;
81 my $_data = {};
82 foreach my $_key (keys %{$self->attribute_map}) {
83 if (defined $self->{$_key}) {
84 $_data->{$self->attribute_map->{$_key}} = $self->{$_key};
85 }
86 }
87 return $_data;
88 }
89
90 # from Perl hashref
91 sub from_hash {
92 my ($self, $hash) = @_;
93
94 # loop through attributes and use swagger_types to deserialize the data
95 while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
96 my $_json_attribute = $self->attribute_map->{$_key};
97 if ($_type =~ /^array\[/i) { # array
98 my $_subclass = substr($_type, 6, -1);
99 my @_array = ();
100 foreach my $_element (@{$hash->{$_json_attribute}}) {
101 push @_array, $self->_deserialize($_subclass, $_element);
102 }
103 $self->{$_key} = \@_array;
104 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
105 $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
106 } else {
107 $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
108 }
109 }
110
111 return $self;
112 }
113
114 # deserialize non-array data
115 sub _deserialize {
116 my ($self, $type, $data) = @_;
117 $log->debugf("deserializing %s with %s",Dumper($data), $type);
118
119 if ($type eq 'DateTime') {
120 return DateTime->from_epoch(epoch => str2time($data));
121 } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
122 return $data;
123 } else { # hash(model)
124 my $_instance = eval "AsposeCellsCloud::Object::$type->new()";
125 return $_instance->from_hash($data);
126 }
127 }
128
129
130 __PACKAGE__->class_documentation({description => 'Encapsulates the object that represents a single data series in a chart.',
131 class => 'Series',
132 required => [], # TODO
133 } );
134
135
136 __PACKAGE__->method_documentation({
137 'area' => {
138 datatype => 'Area',
139 base_name => 'Area',
140 description => 'Represents the background area of Series object.',
141 format => '',
142 read_only => '',
143 },
144 'bar3_d_shape_type' => {
145 datatype => 'string',
146 base_name => 'Bar3DShapeType',
147 description => 'Gets or sets the 3D shape type used with the 3-D bar or column chart.',
148 format => '',
149 read_only => '',
150 },
151 'border' => {
152 datatype => 'Line',
153 base_name => 'Border',
154 description => 'Represents border of Series object.',
155 format => '',
156 read_only => '',
157 },
158 'bubble_scale' => {
159 datatype => 'int',
160 base_name => 'BubbleScale',
161 description => 'Gets or sets the scale factor for bubbles in the specified chart group. It can be an integer value from 0 (zero) to 300, corresponding to a percentage of the default size. Applies only to bubble charts.',
162 format => '',
163 read_only => '',
164 },
165 'bubble_sizes' => {
166 datatype => 'string',
167 base_name => 'BubbleSizes',
168 description => 'Gets or sets the bubble sizes values of the chart series.',
169 format => '',
170 read_only => '',
171 },
172 'count_of_data_values' => {
173 datatype => 'int',
174 base_name => 'CountOfDataValues',
175 description => 'Gets the number of the data values.',
176 format => '',
177 read_only => '',
178 },
179 'data_labels' => {
180 datatype => 'DataLabels',
181 base_name => 'DataLabels',
182 description => 'Represents the DataLabels object for the specified ASeries.',
183 format => '',
184 read_only => '',
185 },
186 'display_name' => {
187 datatype => 'string',
188 base_name => 'DisplayName',
189 description => 'Gets the series`s name that displays on the chart graph.',
190 format => '',
191 read_only => '',
192 },
193 'doughnut_hole_size' => {
194 datatype => 'int',
195 base_name => 'DoughnutHoleSize',
196 description => 'Returns or sets the size of the hole in a doughnut chart group. The hole size is expressed as a percentage of the chart size, between 10 and 90 percent.',
197 format => '',
198 read_only => '',
199 },
200 'down_bars' => {
201 datatype => 'DropBars',
202 base_name => 'DownBars',
203 description => 'Returns a object that represents the down bars on a line chart. Applies only to line charts.',
204 format => '',
205 read_only => '',
206 },
207 'drop_lines' => {
208 datatype => 'Line',
209 base_name => 'DropLines',
210 description => 'Returns a object that represents the drop lines for a series on the line chart or area chart. Applies only to line chart or area charts.',
211 format => '',
212 read_only => '',
213 },
214 'explosion' => {
215 datatype => 'int',
216 base_name => 'Explosion',
217 description => 'The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.',
218 format => '',
219 read_only => '',
220 },
221 'first_slice_angle' => {
222 datatype => 'int',
223 base_name => 'FirstSliceAngle',
224 description => 'Gets or sets the angle of the first pie-chart or doughnut-chart slice, in degrees (clockwise from vertical). Applies only to pie, 3-D pie, and doughnut charts, 0 to 360.',
225 format => '',
226 read_only => '',
227 },
228 'gap_width' => {
229 datatype => 'int',
230 base_name => 'GapWidth',
231 description => 'Returns or sets the space between bar or column clusters, as a percentage of the bar or column width. The value of this property must be between 0 and 500.',
232 format => '',
233 read_only => '',
234 },
235 'has3_d_effect' => {
236 datatype => 'boolean',
237 base_name => 'Has3DEffect',
238 description => 'True if the series has a three-dimensional appearance. Applies only to bubble charts.',
239 format => '',
240 read_only => '',
241 },
242 'has_drop_lines' => {
243 datatype => 'boolean',
244 base_name => 'HasDropLines',
245 description => 'True if the chart has drop lines. Applies only to line chart or area charts.',
246 format => '',
247 read_only => '',
248 },
249 'has_hi_lo_lines' => {
250 datatype => 'boolean',
251 base_name => 'HasHiLoLines',
252 description => 'True if the line chart has high-low lines. Applies only to line charts.',
253 format => '',
254 read_only => '',
255 },
256 'has_leader_lines' => {
257 datatype => 'boolean',
258 base_name => 'HasLeaderLines',
259 description => 'True if the series has leader lines.',
260 format => '',
261 read_only => '',
262 },
263 'has_radar_axis_labels' => {
264 datatype => 'boolean',
265 base_name => 'HasRadarAxisLabels',
266 description => 'True if a radar chart has category axis labels. Applies only to radar charts.',
267 format => '',
268 read_only => '',
269 },
270 'has_series_lines' => {
271 datatype => 'boolean',
272 base_name => 'HasSeriesLines',
273 description => 'True if a stacked column chart or bar chart has series lines or if a Pie of Pie chart or Bar of Pie chart has connector lines between the two sections. Applies only to stacked column charts, bar charts, Pie of Pie charts, or Bar of Pie charts.',
274 format => '',
275 read_only => '',
276 },
277 'has_up_down_bars' => {
278 datatype => 'boolean',
279 base_name => 'HasUpDownBars',
280 description => 'True if a line chart has up and down bars. Applies only to line charts.',
281 format => '',
282 read_only => '',
283 },
284 'hi_lo_lines' => {
285 datatype => 'Line',
286 base_name => 'HiLoLines',
287 description => 'Returns a HiLoLines object that represents the high-low lines for a series on a line chart. Applies only to line charts.',
288 format => '',
289 read_only => '',
290 },
291 'is_auto_split' => {
292 datatype => 'boolean',
293 base_name => 'IsAutoSplit',
294 description => 'Indicates whether the threshold value is automatic.',
295 format => '',
296 read_only => '',
297 },
298 'is_color_varied' => {
299 datatype => 'boolean',
300 base_name => 'IsColorVaried',
301 description => 'Represents if the color of points is varied. The chart must contain only one series.',
302 format => '',
303 read_only => '',
304 },
305 'leader_lines' => {
306 datatype => 'Line',
307 base_name => 'LeaderLines',
308 description => 'Represents leader lines on a chart. Leader lines connect data labels to data points. This object isn’t a collection; there’s no object that represents a single leader line.',
309 format => '',
310 read_only => '',
311 },
312 'legend_entry' => {
313 datatype => 'LegendEntry',
314 base_name => 'LegendEntry',
315 description => 'Gets the legend entry according to this series.',
316 format => '',
317 read_only => '',
318 },
319 'marker' => {
320 datatype => 'Marker',
321 base_name => 'Marker',
322 description => 'Gets the marker.',
323 format => '',
324 read_only => '',
325 },
326 'name' => {
327 datatype => 'string',
328 base_name => 'Name',
329 description => 'Gets or sets the name of the data series.',
330 format => '',
331 read_only => '',
332 },
333 'overlap' => {
334 datatype => 'int',
335 base_name => 'Overlap',
336 description => 'Specifies how bars and columns are positioned. Can be a value between – 100 and 100. Applies only to 2-D bar and 2-D column charts.',
337 format => '',
338 read_only => '',
339 },
340 'plot_on_second_axis' => {
341 datatype => 'boolean',
342 base_name => 'PlotOnSecondAxis',
343 description => 'Indicates if this series is plotted on second value axis.',
344 format => '',
345 read_only => '',
346 },
347 'points' => {
348 datatype => 'LinkElement',
349 base_name => 'Points',
350 description => 'Gets the collection of points in a series in a chart.',
351 format => '',
352 read_only => '',
353 },
354 'second_plot_size' => {
355 datatype => 'int',
356 base_name => 'SecondPlotSize',
357 description => 'Returns or sets the size of the secondary section of either a pie of pie chart or a bar of pie chart, as a percentage of the size of the primary pie. Can be a value from 5 to 200.',
358 format => '',
359 read_only => '',
360 },
361 'series_lines' => {
362 datatype => 'Line',
363 base_name => 'SeriesLines',
364 description => 'Returns a SeriesLines object that represents the series lines for a stacked bar chart or a stacked column chart. Applies only to stacked bar and stacked column charts.',
365 format => '',
366 read_only => '',
367 },
368 'shadow' => {
369 datatype => 'boolean',
370 base_name => 'Shadow',
371 description => 'True if the series has a shadow.',
372 format => '',
373 read_only => '',
374 },
375 'show_negative_bubbles' => {
376 datatype => 'boolean',
377 base_name => 'ShowNegativeBubbles',
378 description => 'True if negative bubbles are shown for the chart group. Valid only for bubble charts.',
379 format => '',
380 read_only => '',
381 },
382 'size_represents' => {
383 datatype => 'string',
384 base_name => 'SizeRepresents',
385 description => 'Gets or sets what the bubble size represents on a bubble chart.',
386 format => '',
387 read_only => '',
388 },
389 'smooth' => {
390 datatype => 'boolean',
391 base_name => 'Smooth',
392 description => 'Represents curve smoothing. True if curve smoothing is turned on for the line chart or scatter chart. Applies only to line and scatter connected by lines charts.',
393 format => '',
394 read_only => '',
395 },
396 'split_type' => {
397 datatype => 'string',
398 base_name => 'SplitType',
399 description => 'Returns or sets a value that how to determine which data points are in the second pie or bar on a pie of pie or bar of pie chart.',
400 format => '',
401 read_only => '',
402 },
403 'split_value' => {
404 datatype => 'double',
405 base_name => 'SplitValue',
406 description => 'Returns or sets a value that shall be used to determine which data points are in the second pie or bar on a pie of pie or bar of pie chart.',
407 format => '',
408 read_only => '',
409 },
410 'trend_lines' => {
411 datatype => 'Trendlines',
412 base_name => 'TrendLines',
413 description => 'Returns an object that represents a collection of all the trendlines for the series.',
414 format => '',
415 read_only => '',
416 },
417 'type' => {
418 datatype => 'string',
419 base_name => 'Type',
420 description => 'Gets or sets a data series` type.',
421 format => '',
422 read_only => '',
423 },
424 'up_bars' => {
425 datatype => 'DropBars',
426 base_name => 'UpBars',
427 description => 'Returns an DropBars object that represents the up bars on a line chart. Applies only to line charts.',
428 format => '',
429 read_only => '',
430 },
431 'values' => {
432 datatype => 'string',
433 base_name => 'Values',
434 description => 'Represents the data of the chart series.',
435 format => '',
436 read_only => '',
437 },
438 'x_error_bar' => {
439 datatype => 'ErrorBar',
440 base_name => 'XErrorBar',
441 description => 'Represents X direction error bar of the series.',
442 format => '',
443 read_only => '',
444 },
445 'x_values' => {
446 datatype => 'string',
447 base_name => 'XValues',
448 description => 'Represents the x values of the chart series.',
449 format => '',
450 read_only => '',
451 },
452 'y_error_bar' => {
453 datatype => 'ErrorBar',
454 base_name => 'YErrorBar',
455 description => 'Represents Y direction error bar of the series.',
456 format => '',
457 read_only => '',
458 },
459 'link' => {
460 datatype => 'Link',
461 base_name => 'link',
462 description => '',
463 format => '',
464 read_only => '',
465 },
466 });
467
468 __PACKAGE__->swagger_types( {
469 'area' => 'Area',
470 'bar3_d_shape_type' => 'string',
471 'border' => 'Line',
472 'bubble_scale' => 'int',
473 'bubble_sizes' => 'string',
474 'count_of_data_values' => 'int',
475 'data_labels' => 'DataLabels',
476 'display_name' => 'string',
477 'doughnut_hole_size' => 'int',
478 'down_bars' => 'DropBars',
479 'drop_lines' => 'Line',
480 'explosion' => 'int',
481 'first_slice_angle' => 'int',
482 'gap_width' => 'int',
483 'has3_d_effect' => 'boolean',
484 'has_drop_lines' => 'boolean',
485 'has_hi_lo_lines' => 'boolean',
486 'has_leader_lines' => 'boolean',
487 'has_radar_axis_labels' => 'boolean',
488 'has_series_lines' => 'boolean',
489 'has_up_down_bars' => 'boolean',
490 'hi_lo_lines' => 'Line',
491 'is_auto_split' => 'boolean',
492 'is_color_varied' => 'boolean',
493 'leader_lines' => 'Line',
494 'legend_entry' => 'LegendEntry',
495 'marker' => 'Marker',
496 'name' => 'string',
497 'overlap' => 'int',
498 'plot_on_second_axis' => 'boolean',
499 'points' => 'LinkElement',
500 'second_plot_size' => 'int',
501 'series_lines' => 'Line',
502 'shadow' => 'boolean',
503 'show_negative_bubbles' => 'boolean',
504 'size_represents' => 'string',
505 'smooth' => 'boolean',
506 'split_type' => 'string',
507 'split_value' => 'double',
508 'trend_lines' => 'Trendlines',
509 'type' => 'string',
510 'up_bars' => 'DropBars',
511 'values' => 'string',
512 'x_error_bar' => 'ErrorBar',
513 'x_values' => 'string',
514 'y_error_bar' => 'ErrorBar',
515 'link' => 'Link'
516 } );
517
518 __PACKAGE__->attribute_map( {
519 'area' => 'Area',
520 'bar3_d_shape_type' => 'Bar3DShapeType',
521 'border' => 'Border',
522 'bubble_scale' => 'BubbleScale',
523 'bubble_sizes' => 'BubbleSizes',
524 'count_of_data_values' => 'CountOfDataValues',
525 'data_labels' => 'DataLabels',
526 'display_name' => 'DisplayName',
527 'doughnut_hole_size' => 'DoughnutHoleSize',
528 'down_bars' => 'DownBars',
529 'drop_lines' => 'DropLines',
530 'explosion' => 'Explosion',
531 'first_slice_angle' => 'FirstSliceAngle',
532 'gap_width' => 'GapWidth',
533 'has3_d_effect' => 'Has3DEffect',
534 'has_drop_lines' => 'HasDropLines',
535 'has_hi_lo_lines' => 'HasHiLoLines',
536 'has_leader_lines' => 'HasLeaderLines',
537 'has_radar_axis_labels' => 'HasRadarAxisLabels',
538 'has_series_lines' => 'HasSeriesLines',
539 'has_up_down_bars' => 'HasUpDownBars',
540 'hi_lo_lines' => 'HiLoLines',
541 'is_auto_split' => 'IsAutoSplit',
542 'is_color_varied' => 'IsColorVaried',
543 'leader_lines' => 'LeaderLines',
544 'legend_entry' => 'LegendEntry',
545 'marker' => 'Marker',
546 'name' => 'Name',
547 'overlap' => 'Overlap',
548 'plot_on_second_axis' => 'PlotOnSecondAxis',
549 'points' => 'Points',
550 'second_plot_size' => 'SecondPlotSize',
551 'series_lines' => 'SeriesLines',
552 'shadow' => 'Shadow',
553 'show_negative_bubbles' => 'ShowNegativeBubbles',
554 'size_represents' => 'SizeRepresents',
555 'smooth' => 'Smooth',
556 'split_type' => 'SplitType',
557 'split_value' => 'SplitValue',
558 'trend_lines' => 'TrendLines',
559 'type' => 'Type',
560 'up_bars' => 'UpBars',
561 'values' => 'Values',
562 'x_error_bar' => 'XErrorBar',
563 'x_values' => 'XValues',
564 'y_error_bar' => 'YErrorBar',
565 'link' => 'link'
566 } );
567
568 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
569
570
571 1;