line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tk::ForDummies::Graph;
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
#==================================================================
|
4
|
|
|
|
|
|
|
# Author : Djibril Ousmanou
|
5
|
|
|
|
|
|
|
# Copyright : 2010
|
6
|
|
|
|
|
|
|
# Update : 20/09/2010 20:45:57
|
7
|
|
|
|
|
|
|
# AIM : Private functions for Dummies Graph modules
|
8
|
|
|
|
|
|
|
#==================================================================
|
9
|
1
|
|
|
1
|
|
24609
|
use strict;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
10
|
1
|
|
|
1
|
|
6
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
11
|
1
|
|
|
1
|
|
5
|
use Carp;
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
96
|
|
12
|
1
|
|
|
1
|
|
988
|
use Tk::ForDummies::Graph::Utils qw (:DUMMIES);
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
302
|
|
13
|
1
|
|
|
1
|
|
12
|
use vars qw($VERSION);
|
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
54
|
|
14
|
|
|
|
|
|
|
$VERSION = '1.14';
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
5
|
use Exporter;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6876
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my @ModuleToExport = qw (
|
19
|
|
|
|
|
|
|
_TreatParameters _InitConfig _error
|
20
|
|
|
|
|
|
|
_CheckSizeLengendAndData _ZoomCalcul _DestroyBalloonAndBind
|
21
|
|
|
|
|
|
|
_CreateType _GetMarkerType _display_line
|
22
|
|
|
|
|
|
|
_box _title _XLabelPosition
|
23
|
|
|
|
|
|
|
_YLabelPosition _ytick _GraphForDummiesConstruction
|
24
|
|
|
|
|
|
|
);
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our @ISA = qw(Exporter);
|
27
|
|
|
|
|
|
|
our @EXPORT_OK = @ModuleToExport;
|
28
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( DUMMIES => \@ModuleToExport );
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _InitConfig {
|
31
|
0
|
|
|
0
|
|
|
my $CompositeWidget = shift;
|
32
|
0
|
|
|
|
|
|
my %Configuration = (
|
33
|
|
|
|
|
|
|
'Axis' => {
|
34
|
|
|
|
|
|
|
Cx0 => undef,
|
35
|
|
|
|
|
|
|
Cx0 => undef,
|
36
|
|
|
|
|
|
|
CxMin => undef,
|
37
|
|
|
|
|
|
|
CxMax => undef,
|
38
|
|
|
|
|
|
|
CyMin => undef,
|
39
|
|
|
|
|
|
|
CyMax => undef,
|
40
|
|
|
|
|
|
|
Xaxis => {
|
41
|
|
|
|
|
|
|
Width => undef,
|
42
|
|
|
|
|
|
|
Height => undef,
|
43
|
|
|
|
|
|
|
xlabelHeight => 30,
|
44
|
|
|
|
|
|
|
ScaleValuesHeight => 30,
|
45
|
|
|
|
|
|
|
TickHeight => 5,
|
46
|
|
|
|
|
|
|
CxlabelX => undef,
|
47
|
|
|
|
|
|
|
CxlabelY => undef,
|
48
|
|
|
|
|
|
|
Idxlabel => undef,
|
49
|
|
|
|
|
|
|
IdxTick => undef,
|
50
|
|
|
|
|
|
|
TagAxis0 => 'Axe00',
|
51
|
|
|
|
|
|
|
},
|
52
|
|
|
|
|
|
|
Yaxis => {
|
53
|
|
|
|
|
|
|
ylabelWidth => 5,
|
54
|
|
|
|
|
|
|
ScaleValuesWidth => 60,
|
55
|
|
|
|
|
|
|
TickWidth => 5,
|
56
|
|
|
|
|
|
|
TickNumber => 4,
|
57
|
|
|
|
|
|
|
Width => undef,
|
58
|
|
|
|
|
|
|
Height => undef,
|
59
|
|
|
|
|
|
|
CylabelX => undef,
|
60
|
|
|
|
|
|
|
CylabelY => undef,
|
61
|
|
|
|
|
|
|
Idylabel => undef,
|
62
|
|
|
|
|
|
|
},
|
63
|
|
|
|
|
|
|
},
|
64
|
|
|
|
|
|
|
'Balloon' => {
|
65
|
|
|
|
|
|
|
Obj => undef,
|
66
|
|
|
|
|
|
|
Message => {},
|
67
|
|
|
|
|
|
|
State => 0,
|
68
|
|
|
|
|
|
|
ColorData => [ '#000000', '#CB89D3' ],
|
69
|
|
|
|
|
|
|
MorePixelSelected => 2,
|
70
|
|
|
|
|
|
|
Background => 'snow',
|
71
|
|
|
|
|
|
|
BalloonMsg => undef,
|
72
|
|
|
|
|
|
|
IdLegData => undef,
|
73
|
|
|
|
|
|
|
},
|
74
|
|
|
|
|
|
|
'Canvas' => {
|
75
|
|
|
|
|
|
|
Height => 400,
|
76
|
|
|
|
|
|
|
Width => 400,
|
77
|
|
|
|
|
|
|
HeightEmptySpace => 20,
|
78
|
|
|
|
|
|
|
WidthEmptySpace => 20,
|
79
|
|
|
|
|
|
|
YTickWidth => 2,
|
80
|
|
|
|
|
|
|
},
|
81
|
|
|
|
|
|
|
'Data' => {
|
82
|
|
|
|
|
|
|
RefXLegend => undef,
|
83
|
|
|
|
|
|
|
RefAllData => undef,
|
84
|
|
|
|
|
|
|
PlotDefined => undef,
|
85
|
|
|
|
|
|
|
MaxYValue => undef,
|
86
|
|
|
|
|
|
|
MinYValue => undef,
|
87
|
|
|
|
|
|
|
GetIdData => {},
|
88
|
|
|
|
|
|
|
SubstitutionValue => 0,
|
89
|
|
|
|
|
|
|
NumberRealData => undef,
|
90
|
|
|
|
|
|
|
RefDataToDisplay => undef,
|
91
|
|
|
|
|
|
|
RefOptionDataToDisplay => undef,
|
92
|
|
|
|
|
|
|
},
|
93
|
|
|
|
|
|
|
'Font' => {
|
94
|
|
|
|
|
|
|
Default => '{Times} 10 {normal}',
|
95
|
|
|
|
|
|
|
DefaultTitle => '{Times} 12 {bold}',
|
96
|
|
|
|
|
|
|
DefaultLabel => '{Times} 10 {bold}',
|
97
|
|
|
|
|
|
|
DefaultLegend => '{Times} 8 {normal}',
|
98
|
|
|
|
|
|
|
DefaultLegendTitle => '{Times} 8 {bold}',
|
99
|
|
|
|
|
|
|
DefaultBarValues => '{Times} 8 {normal}',
|
100
|
|
|
|
|
|
|
},
|
101
|
|
|
|
|
|
|
'Legend' => {
|
102
|
|
|
|
|
|
|
HeightTitle => 30,
|
103
|
|
|
|
|
|
|
HLine => 20,
|
104
|
|
|
|
|
|
|
WCube => 10,
|
105
|
|
|
|
|
|
|
HCube => 10,
|
106
|
|
|
|
|
|
|
SpaceBeforeCube => 5,
|
107
|
|
|
|
|
|
|
SpaceAfterCube => 5,
|
108
|
|
|
|
|
|
|
WidthText => 250,
|
109
|
|
|
|
|
|
|
NbrLegPerLine => undef,
|
110
|
|
|
|
|
|
|
'-width' => undef,
|
111
|
|
|
|
|
|
|
Height => 0,
|
112
|
|
|
|
|
|
|
Width => undef,
|
113
|
|
|
|
|
|
|
LengthOneLegend => undef,
|
114
|
|
|
|
|
|
|
DataLegend => undef,
|
115
|
|
|
|
|
|
|
LengthTextMax => undef,
|
116
|
|
|
|
|
|
|
GetIdLeg => {},
|
117
|
|
|
|
|
|
|
title => undef,
|
118
|
|
|
|
|
|
|
titlefont => '{Times} 12 {bold}',
|
119
|
|
|
|
|
|
|
titlecolors => 'black',
|
120
|
|
|
|
|
|
|
Colors => [
|
121
|
|
|
|
|
|
|
'red', 'green', 'blue', 'yellow', 'purple', 'cyan', '#996600', '#99A6CC',
|
122
|
|
|
|
|
|
|
'#669933', '#929292', '#006600', '#FFE100', '#00A6FF', '#009060', '#B000E0', '#A08000',
|
123
|
|
|
|
|
|
|
'orange', 'brown', 'black', '#FFCCFF', '#99CCFF', '#FF00CC', '#FF8000', '#006090',
|
124
|
|
|
|
|
|
|
],
|
125
|
|
|
|
|
|
|
NbrLegend => 0,
|
126
|
|
|
|
|
|
|
box => 0,
|
127
|
|
|
|
|
|
|
},
|
128
|
|
|
|
|
|
|
'TAGS' => {
|
129
|
|
|
|
|
|
|
AllTagsDummiesGraph => '_AllTagsDummiesGraph',
|
130
|
|
|
|
|
|
|
AllAXIS => '_AllAXISTag',
|
131
|
|
|
|
|
|
|
yAxis => '_yAxisTag',
|
132
|
|
|
|
|
|
|
xAxis => '_xAxisTag',
|
133
|
|
|
|
|
|
|
'xAxis0' => '_0AxisTag',
|
134
|
|
|
|
|
|
|
BoxAxis => '_BoxAxisTag',
|
135
|
|
|
|
|
|
|
xTick => '_xTickTag',
|
136
|
|
|
|
|
|
|
yTick => '_yTickTag',
|
137
|
|
|
|
|
|
|
AllTick => '_AllTickTag',
|
138
|
|
|
|
|
|
|
'xValue0' => '_xValue0Tag',
|
139
|
|
|
|
|
|
|
xValues => '_xValuesTag',
|
140
|
|
|
|
|
|
|
yValues => '_yValuesTag',
|
141
|
|
|
|
|
|
|
AllValues => '_AllValuesTag',
|
142
|
|
|
|
|
|
|
TitleLegend => '_TitleLegendTag',
|
143
|
|
|
|
|
|
|
BoxLegend => '_BoxLegendTag',
|
144
|
|
|
|
|
|
|
AllData => '_AllDataTag',
|
145
|
|
|
|
|
|
|
AllPie => '_AllPieTag',
|
146
|
|
|
|
|
|
|
Area => '_AreaTag',
|
147
|
|
|
|
|
|
|
Pie => '_PieTag',
|
148
|
|
|
|
|
|
|
PointLine => '_PointLineTag',
|
149
|
|
|
|
|
|
|
Line => '_LineTag',
|
150
|
|
|
|
|
|
|
Point => '_PointTag',
|
151
|
|
|
|
|
|
|
Bar => '_BarTag',
|
152
|
|
|
|
|
|
|
Mixed => '_MixedTag',
|
153
|
|
|
|
|
|
|
Legend => '_LegendTag',
|
154
|
|
|
|
|
|
|
DashLines => '_DashLineTag',
|
155
|
|
|
|
|
|
|
BarValues => '_BarValuesTag',
|
156
|
|
|
|
|
|
|
Boxplot => '_BoxplotTag',
|
157
|
|
|
|
|
|
|
},
|
158
|
|
|
|
|
|
|
'Title' => {
|
159
|
|
|
|
|
|
|
Ctitrex => undef,
|
160
|
|
|
|
|
|
|
Ctitrey => undef,
|
161
|
|
|
|
|
|
|
IdTitre => undef,
|
162
|
|
|
|
|
|
|
'-width' => undef,
|
163
|
|
|
|
|
|
|
Width => undef,
|
164
|
|
|
|
|
|
|
Height => 40,
|
165
|
|
|
|
|
|
|
},
|
166
|
|
|
|
|
|
|
'Zoom' => {
|
167
|
|
|
|
|
|
|
CurrentX => 100,
|
168
|
|
|
|
|
|
|
CurrentY => 100,
|
169
|
|
|
|
|
|
|
},
|
170
|
|
|
|
|
|
|
);
|
171
|
|
|
|
|
|
|
|
172
|
0
|
|
|
|
|
|
return \%Configuration;
|
173
|
|
|
|
|
|
|
}
|
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
sub _TreatParameters {
|
176
|
0
|
|
|
0
|
|
|
my ($CompositeWidget) = @_;
|
177
|
|
|
|
|
|
|
|
178
|
0
|
|
|
|
|
|
my @IntegerOption = qw /
|
179
|
|
|
|
|
|
|
-xlabelheight -xlabelskip -xvaluespace -ylabelwidth
|
180
|
|
|
|
|
|
|
-boxaxis -noaxis -zeroaxisonly -xtickheight
|
181
|
|
|
|
|
|
|
-xtickview -yticknumber -ytickwidth -linewidth
|
182
|
|
|
|
|
|
|
-alltickview -xvaluevertical -titleheight -gridview
|
183
|
|
|
|
|
|
|
-ytickview -overwrite -cumulate -spacingbar
|
184
|
|
|
|
|
|
|
-showvalues -startangle -viewsection -zeroaxis
|
185
|
|
|
|
|
|
|
-longticks -markersize -pointline
|
186
|
|
|
|
|
|
|
-smoothline -spline -bezier
|
187
|
|
|
|
|
|
|
/;
|
188
|
|
|
|
|
|
|
|
189
|
0
|
|
|
|
|
|
foreach my $OptionName (@IntegerOption) {
|
190
|
0
|
|
|
|
|
|
my $data = $CompositeWidget->cget($OptionName);
|
191
|
0
|
0
|
0
|
|
|
|
if ( defined $data and $data !~ m{^\d+$} ) {
|
192
|
0
|
|
|
|
|
|
$CompositeWidget->_error( "'Can't set $OptionName to `$data', $data' isn't numeric", 1 );
|
193
|
0
|
|
|
|
|
|
return;
|
194
|
|
|
|
|
|
|
}
|
195
|
|
|
|
|
|
|
}
|
196
|
|
|
|
|
|
|
|
197
|
0
|
|
|
|
|
|
my $xvaluesregex = $CompositeWidget->cget( -xvaluesregex );
|
198
|
0
|
0
|
0
|
|
|
|
if ( defined $xvaluesregex and ref($xvaluesregex) !~ m{^Regexp$}i ) {
|
199
|
0
|
|
|
|
|
|
$CompositeWidget->_error(
|
200
|
|
|
|
|
|
|
"'Can't set -xvaluesregex to `$xvaluesregex', "
|
201
|
|
|
|
|
|
|
. "$xvaluesregex' is not a regex expression\nEx : "
|
202
|
|
|
|
|
|
|
. "-xvaluesregex => qr/My regex/;",
|
203
|
|
|
|
|
|
|
1
|
204
|
|
|
|
|
|
|
);
|
205
|
0
|
|
|
|
|
|
return;
|
206
|
|
|
|
|
|
|
}
|
207
|
|
|
|
|
|
|
|
208
|
0
|
|
|
|
|
|
my $gradient = $CompositeWidget->cget( -gradient );
|
209
|
0
|
0
|
0
|
|
|
|
if ( defined $gradient and ref($gradient) !~ m{^hash$}i ) {
|
210
|
0
|
|
|
|
|
|
$CompositeWidget->_error(
|
211
|
|
|
|
|
|
|
"'Can't set -gradient to `$gradient', " . "$gradient' is not a hash reference expression\n", 1 );
|
212
|
0
|
|
|
|
|
|
return;
|
213
|
|
|
|
|
|
|
}
|
214
|
|
|
|
|
|
|
|
215
|
0
|
|
|
|
|
|
my $Colors = $CompositeWidget->cget( -colordata );
|
216
|
0
|
0
|
0
|
|
|
|
if ( defined $Colors and ref($Colors) ne 'ARRAY' ) {
|
217
|
0
|
|
|
|
|
|
$CompositeWidget->_error(
|
218
|
|
|
|
|
|
|
"'Can't set -colordata to `$Colors', "
|
219
|
|
|
|
|
|
|
. "$Colors' is not an array reference\nEx : "
|
220
|
|
|
|
|
|
|
. "-colordata => [\"blue\",\"#2400FF\",...]",
|
221
|
|
|
|
|
|
|
1
|
222
|
|
|
|
|
|
|
);
|
223
|
0
|
|
|
|
|
|
return;
|
224
|
|
|
|
|
|
|
}
|
225
|
0
|
|
|
|
|
|
my $Markers = $CompositeWidget->cget( -markers );
|
226
|
0
|
0
|
0
|
|
|
|
if ( defined $Markers and ref($Markers) ne 'ARRAY' ) {
|
227
|
0
|
|
|
|
|
|
$CompositeWidget->_error(
|
228
|
|
|
|
|
|
|
"'Can't set -markers to `$Markers', "
|
229
|
|
|
|
|
|
|
. "$Markers' is not an array reference\nEx : "
|
230
|
|
|
|
|
|
|
. "-markers => [5,8,2]",
|
231
|
|
|
|
|
|
|
1
|
232
|
|
|
|
|
|
|
);
|
233
|
|
|
|
|
|
|
|
234
|
0
|
|
|
|
|
|
return;
|
235
|
|
|
|
|
|
|
}
|
236
|
0
|
|
|
|
|
|
my $Typemixed = $CompositeWidget->cget( -typemixed );
|
237
|
0
|
0
|
0
|
|
|
|
if ( defined $Typemixed and ref($Typemixed) ne 'ARRAY' ) {
|
238
|
0
|
|
|
|
|
|
$CompositeWidget->_error(
|
239
|
|
|
|
|
|
|
"'Can't set -typemixed to `$Typemixed', "
|
240
|
|
|
|
|
|
|
. "$Typemixed' is not an array reference\nEx : "
|
241
|
|
|
|
|
|
|
. "-typemixed => ['bars','lines',...]",
|
242
|
|
|
|
|
|
|
1
|
243
|
|
|
|
|
|
|
);
|
244
|
|
|
|
|
|
|
|
245
|
0
|
|
|
|
|
|
return;
|
246
|
|
|
|
|
|
|
}
|
247
|
|
|
|
|
|
|
|
248
|
0
|
0
|
|
|
|
|
if ( my $xtickheight = $CompositeWidget->cget( -xtickheight ) ) {
|
249
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{TickHeight} = $xtickheight;
|
250
|
|
|
|
|
|
|
}
|
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
# -smoothline deprecated, use -bezier
|
253
|
0
|
0
|
|
|
|
|
if ( my $smoothline = $CompositeWidget->cget( -smoothline ) ) {
|
254
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -bezier => $smoothline );
|
255
|
|
|
|
|
|
|
}
|
256
|
|
|
|
|
|
|
|
257
|
0
|
0
|
|
|
|
|
if ( my $xvaluespace = $CompositeWidget->cget( -xvaluespace ) ) {
|
258
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{ScaleValuesHeight} = $xvaluespace;
|
259
|
|
|
|
|
|
|
}
|
260
|
|
|
|
|
|
|
|
261
|
0
|
0
|
0
|
|
|
|
if ( my $noaxis = $CompositeWidget->cget( -noaxis ) and $CompositeWidget->cget( -noaxis ) == 1 ) {
|
262
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{ScaleValuesHeight} = 0;
|
263
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{ScaleValuesWidth} = 0;
|
264
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickWidth} = 0;
|
265
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{TickHeight} = 0;
|
266
|
|
|
|
|
|
|
}
|
267
|
|
|
|
|
|
|
|
268
|
0
|
0
|
|
|
|
|
if ( my $title = $CompositeWidget->cget( -title ) ) {
|
269
|
0
|
0
|
|
|
|
|
if ( my $titleheight = $CompositeWidget->cget( -titleheight ) ) {
|
270
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Height} = $titleheight;
|
271
|
|
|
|
|
|
|
}
|
272
|
|
|
|
|
|
|
}
|
273
|
|
|
|
|
|
|
else {
|
274
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Height} = 0;
|
275
|
|
|
|
|
|
|
}
|
276
|
|
|
|
|
|
|
|
277
|
0
|
0
|
|
|
|
|
if ( my $xlabel = $CompositeWidget->cget( -xlabel ) ) {
|
278
|
0
|
0
|
|
|
|
|
if ( my $xlabelheight = $CompositeWidget->cget( -xlabelheight ) ) {
|
279
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{xlabelHeight} = $xlabelheight;
|
280
|
|
|
|
|
|
|
}
|
281
|
|
|
|
|
|
|
}
|
282
|
|
|
|
|
|
|
else {
|
283
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{xlabelHeight} = 0;
|
284
|
|
|
|
|
|
|
}
|
285
|
|
|
|
|
|
|
|
286
|
0
|
0
|
|
|
|
|
if ( my $ylabel = $CompositeWidget->cget( -ylabel ) ) {
|
287
|
0
|
0
|
|
|
|
|
if ( my $ylabelWidth = $CompositeWidget->cget( -ylabelWidth ) ) {
|
288
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{ylabelWidth} = $ylabelWidth;
|
289
|
|
|
|
|
|
|
}
|
290
|
|
|
|
|
|
|
}
|
291
|
|
|
|
|
|
|
else {
|
292
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{ylabelWidth} = 0;
|
293
|
|
|
|
|
|
|
}
|
294
|
|
|
|
|
|
|
|
295
|
0
|
0
|
|
|
|
|
if ( my $ytickwidth = $CompositeWidget->cget( -ytickwidth ) ) {
|
296
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickWidth} = $ytickwidth;
|
297
|
|
|
|
|
|
|
}
|
298
|
|
|
|
|
|
|
|
299
|
0
|
0
|
|
|
|
|
if ( my $valuescolor = $CompositeWidget->cget( -valuescolor ) ) {
|
300
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -xvaluecolor => $valuescolor );
|
301
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -yvaluecolor => $valuescolor );
|
302
|
|
|
|
|
|
|
}
|
303
|
|
|
|
|
|
|
|
304
|
0
|
0
|
|
|
|
|
if ( my $textcolor = $CompositeWidget->cget( -textcolor ) ) {
|
|
|
0
|
|
|
|
|
|
305
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -titlecolor => $textcolor );
|
306
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -xlabelcolor => $textcolor );
|
307
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -ylabelcolor => $textcolor );
|
308
|
|
|
|
|
|
|
}
|
309
|
|
|
|
|
|
|
elsif ( my $labelscolor = $CompositeWidget->cget( -labelscolor ) ) {
|
310
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -xlabelcolor => $labelscolor );
|
311
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -ylabelcolor => $labelscolor );
|
312
|
|
|
|
|
|
|
}
|
313
|
|
|
|
|
|
|
|
314
|
0
|
0
|
|
|
|
|
if ( my $textfont = $CompositeWidget->cget( -textfont ) ) {
|
315
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -titlefont => $textfont );
|
316
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -xlabelfont => $textfont );
|
317
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -ylabelfont => $textfont );
|
318
|
|
|
|
|
|
|
}
|
319
|
0
|
0
|
|
|
|
|
if ( my $startangle = $CompositeWidget->cget( -startangle ) ) {
|
320
|
0
|
0
|
0
|
|
|
|
if ( $startangle < 0 or $startangle > 360 ) {
|
321
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -startangle => 0 );
|
322
|
|
|
|
|
|
|
}
|
323
|
|
|
|
|
|
|
}
|
324
|
0
|
0
|
|
|
|
|
if ( my $longticks = $CompositeWidget->cget( -longticks ) ) {
|
325
|
0
|
0
|
|
|
|
|
if ( $longticks == 1 ) {
|
326
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -boxaxis => 1 );
|
327
|
|
|
|
|
|
|
}
|
328
|
|
|
|
|
|
|
}
|
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
=for borderwidth:
|
331
|
|
|
|
|
|
|
If user call -borderwidth option, the graph will be trunc.
|
332
|
|
|
|
|
|
|
Then we will add HeightEmptySpace and WidthEmptySpace.
|
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=cut
|
335
|
|
|
|
|
|
|
|
336
|
0
|
0
|
|
|
|
|
if ( my $borderwidth = $CompositeWidget->cget( -borderwidth ) ) {
|
337
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Canvas}{HeightEmptySpace} = $borderwidth + 15;
|
338
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Canvas}{WidthEmptySpace} = $borderwidth + 15;
|
339
|
|
|
|
|
|
|
}
|
340
|
|
|
|
|
|
|
|
341
|
0
|
|
|
|
|
|
return 1;
|
342
|
|
|
|
|
|
|
}
|
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
sub _CheckSizeLengendAndData {
|
345
|
0
|
|
|
0
|
|
|
my ( $CompositeWidget, $RefData, $RefLegend ) = @_;
|
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
# Check legend size
|
348
|
0
|
0
|
|
|
|
|
unless ( defined $RefLegend ) {
|
349
|
0
|
|
|
|
|
|
$CompositeWidget->_error('legend not defined');
|
350
|
0
|
|
|
|
|
|
return;
|
351
|
|
|
|
|
|
|
}
|
352
|
0
|
|
|
|
|
|
my $SizeLegend = scalar @{$RefLegend};
|
|
0
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
# Check size between legend and data
|
355
|
0
|
|
|
|
|
|
my $SizeData = scalar @{$RefData} - 1;
|
|
0
|
|
|
|
|
|
|
356
|
0
|
0
|
|
|
|
|
unless ( $SizeLegend == $SizeData ) {
|
357
|
0
|
|
|
|
|
|
$CompositeWidget->_error('Legend and array size data are different');
|
358
|
0
|
|
|
|
|
|
return;
|
359
|
|
|
|
|
|
|
}
|
360
|
|
|
|
|
|
|
|
361
|
0
|
|
|
|
|
|
return 1;
|
362
|
|
|
|
|
|
|
}
|
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
sub _ZoomCalcul {
|
365
|
0
|
|
|
0
|
|
|
my ( $CompositeWidget, $ZoomX, $ZoomY ) = @_;
|
366
|
|
|
|
|
|
|
|
367
|
0
|
0
|
0
|
|
|
|
if ( ( defined $ZoomX and !( _isANumber($ZoomX) or $ZoomX > 0 ) )
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
368
|
|
|
|
|
|
|
or ( defined $ZoomY and !( _isANumber($ZoomY) or $ZoomY > 0 ) )
|
369
|
|
|
|
|
|
|
or ( not defined $ZoomX and not defined $ZoomY ) )
|
370
|
|
|
|
|
|
|
{
|
371
|
0
|
|
|
|
|
|
$CompositeWidget->_error( 'zoom value must be defined, numeric and great than 0', 1 );
|
372
|
0
|
|
|
|
|
|
return;
|
373
|
|
|
|
|
|
|
}
|
374
|
|
|
|
|
|
|
|
375
|
0
|
|
|
|
|
|
my $CurrentWidth = $CompositeWidget->{RefInfoDummies}->{Canvas}{Width};
|
376
|
0
|
|
|
|
|
|
my $CurrentHeight = $CompositeWidget->{RefInfoDummies}->{Canvas}{Height};
|
377
|
|
|
|
|
|
|
|
378
|
0
|
|
|
|
|
|
my $CentPercentWidth = ( 100 / $CompositeWidget->{RefInfoDummies}->{Zoom}{CurrentX} ) * $CurrentWidth;
|
379
|
0
|
|
|
|
|
|
my $CentPercentHeight = ( 100 / $CompositeWidget->{RefInfoDummies}->{Zoom}{CurrentY} ) * $CurrentHeight;
|
380
|
0
|
0
|
|
|
|
|
my $NewWidth = ( $ZoomX / 100 ) * $CentPercentWidth
|
381
|
|
|
|
|
|
|
if ( defined $ZoomX );
|
382
|
0
|
0
|
|
|
|
|
my $NewHeight = ( $ZoomY / 100 ) * $CentPercentHeight
|
383
|
|
|
|
|
|
|
if ( defined $ZoomY );
|
384
|
|
|
|
|
|
|
|
385
|
0
|
0
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Zoom}{CurrentX} = $ZoomX
|
386
|
|
|
|
|
|
|
if ( defined $ZoomX );
|
387
|
0
|
0
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Zoom}{CurrentY} = $ZoomY
|
388
|
|
|
|
|
|
|
if ( defined $ZoomY );
|
389
|
|
|
|
|
|
|
|
390
|
0
|
|
|
|
|
|
return ( $NewWidth, $NewHeight );
|
391
|
|
|
|
|
|
|
}
|
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
sub _DestroyBalloonAndBind {
|
394
|
0
|
|
|
0
|
|
|
my ($CompositeWidget) = @_;
|
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
# balloon defined and user want to stop it
|
397
|
0
|
0
|
0
|
|
|
|
if ( $CompositeWidget->{RefInfoDummies}->{Balloon}{Obj}
|
398
|
|
|
|
|
|
|
and Tk::Exists $CompositeWidget->{RefInfoDummies}->{Balloon}{Obj} )
|
399
|
|
|
|
|
|
|
{
|
400
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Balloon}{Obj}->configure( -state => 'none' );
|
401
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Balloon}{Obj}->detach($CompositeWidget);
|
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
#$CompositeWidget->{RefInfoDummies}->{Balloon}{Obj}->destroy;
|
404
|
|
|
|
|
|
|
|
405
|
0
|
|
|
|
|
|
undef $CompositeWidget->{RefInfoDummies}->{Balloon}{Obj};
|
406
|
|
|
|
|
|
|
}
|
407
|
|
|
|
|
|
|
|
408
|
0
|
|
|
|
|
|
return;
|
409
|
|
|
|
|
|
|
}
|
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
sub _error {
|
412
|
0
|
|
|
0
|
|
|
my ( $CompositeWidget, $ErrorMessage, $Croak ) = @_;
|
413
|
|
|
|
|
|
|
|
414
|
0
|
0
|
0
|
|
|
|
if ( defined $Croak and $Croak == 1 ) {
|
415
|
0
|
|
|
|
|
|
croak "[BE CARREFUL] : $ErrorMessage\n";
|
416
|
|
|
|
|
|
|
}
|
417
|
|
|
|
|
|
|
else {
|
418
|
0
|
|
|
|
|
|
warn "[WARNING] : $ErrorMessage\n";
|
419
|
|
|
|
|
|
|
}
|
420
|
|
|
|
|
|
|
|
421
|
0
|
|
|
|
|
|
return;
|
422
|
|
|
|
|
|
|
}
|
423
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
sub _GetMarkerType {
|
425
|
0
|
|
|
0
|
|
|
my ( $CompositeWidget, $Number ) = @_;
|
426
|
0
|
|
|
|
|
|
my %MarkerType = (
|
427
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
# N° Type Filled
|
429
|
|
|
|
|
|
|
1 => [ 'square', 1 ],
|
430
|
|
|
|
|
|
|
2 => [ 'square', 0 ],
|
431
|
|
|
|
|
|
|
3 => [ 'horizontal cross', 1 ],
|
432
|
|
|
|
|
|
|
4 => [ 'diagonal cross', 1 ],
|
433
|
|
|
|
|
|
|
5 => [ 'diamond', 1 ],
|
434
|
|
|
|
|
|
|
6 => [ 'diamond', 0 ],
|
435
|
|
|
|
|
|
|
7 => [ 'circle', 1 ],
|
436
|
|
|
|
|
|
|
8 => [ 'circle', 0 ],
|
437
|
|
|
|
|
|
|
9 => [ 'horizontal line', 1 ],
|
438
|
|
|
|
|
|
|
10 => [ 'vertical line', 1 ],
|
439
|
|
|
|
|
|
|
);
|
440
|
|
|
|
|
|
|
|
441
|
0
|
0
|
|
|
|
|
return unless ( defined $MarkerType{$Number} );
|
442
|
|
|
|
|
|
|
|
443
|
0
|
|
|
|
|
|
return $MarkerType{$Number};
|
444
|
|
|
|
|
|
|
}
|
445
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
=for _CreateType
|
447
|
|
|
|
|
|
|
Calculate different points coord to create a rectangle, circle,
|
448
|
|
|
|
|
|
|
verticale or horizontal line, a cross, a plus and a diamond
|
449
|
|
|
|
|
|
|
from a point coord.
|
450
|
|
|
|
|
|
|
Arg : Reference of hash
|
451
|
|
|
|
|
|
|
{
|
452
|
|
|
|
|
|
|
x => value,
|
453
|
|
|
|
|
|
|
y => value,
|
454
|
|
|
|
|
|
|
pixel => value,
|
455
|
|
|
|
|
|
|
type => string, (circle, cross, plus, diamond, rectangle, Vline, Hline )
|
456
|
|
|
|
|
|
|
option => Hash reference ( {-fill => xxx, -outline => yy, ...} )
|
457
|
|
|
|
|
|
|
}
|
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
=cut
|
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
sub _CreateType {
|
462
|
0
|
|
|
0
|
|
|
my ( $CompositeWidget, %Refcoord ) = @_;
|
463
|
|
|
|
|
|
|
|
464
|
0
|
0
|
0
|
|
|
|
if ( $Refcoord{type} eq 'circle' or $Refcoord{type} eq 'square' ) {
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
465
|
0
|
|
|
|
|
|
my $x1 = $Refcoord{x} - ( $Refcoord{pixel} / 2 );
|
466
|
0
|
|
|
|
|
|
my $y1 = $Refcoord{y} + ( $Refcoord{pixel} / 2 );
|
467
|
0
|
|
|
|
|
|
my $x2 = $Refcoord{x} + ( $Refcoord{pixel} / 2 );
|
468
|
0
|
|
|
|
|
|
my $y2 = $Refcoord{y} - ( $Refcoord{pixel} / 2 );
|
469
|
|
|
|
|
|
|
|
470
|
0
|
0
|
|
|
|
|
if ( $Refcoord{type} eq 'circle' ) {
|
471
|
0
|
|
|
|
|
|
$CompositeWidget->createOval( $x1, $y1, $x2, $y2, %{ $Refcoord{option} } );
|
|
0
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
}
|
473
|
|
|
|
|
|
|
else {
|
474
|
0
|
|
|
|
|
|
$CompositeWidget->createRectangle( $x1, $y1, $x2, $y2, %{ $Refcoord{option} } );
|
|
0
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
}
|
476
|
|
|
|
|
|
|
}
|
477
|
|
|
|
|
|
|
elsif ( $Refcoord{type} eq 'horizontal cross' ) {
|
478
|
0
|
|
|
|
|
|
my $x1 = $Refcoord{x};
|
479
|
0
|
|
|
|
|
|
my $y1 = $Refcoord{y} - ( $Refcoord{pixel} / 2 );
|
480
|
0
|
|
|
|
|
|
my $x2 = $x1;
|
481
|
0
|
|
|
|
|
|
my $y2 = $Refcoord{y} + ( $Refcoord{pixel} / 2 );
|
482
|
0
|
|
|
|
|
|
my $x3 = $Refcoord{x} - ( $Refcoord{pixel} / 2 );
|
483
|
0
|
|
|
|
|
|
my $y3 = $Refcoord{y};
|
484
|
0
|
|
|
|
|
|
my $x4 = $Refcoord{x} + ( $Refcoord{pixel} / 2 );
|
485
|
0
|
|
|
|
|
|
my $y4 = $y3;
|
486
|
0
|
|
|
|
|
|
$CompositeWidget->createLine( $x1, $y1, $x2, $y2, %{ $Refcoord{option} } );
|
|
0
|
|
|
|
|
|
|
487
|
0
|
|
|
|
|
|
$CompositeWidget->createLine( $x3, $y3, $x4, $y4, %{ $Refcoord{option} } );
|
|
0
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
}
|
489
|
|
|
|
|
|
|
elsif ( $Refcoord{type} eq 'diagonal cross' ) {
|
490
|
0
|
|
|
|
|
|
my $x1 = $Refcoord{x} - ( $Refcoord{pixel} / 2 );
|
491
|
0
|
|
|
|
|
|
my $y1 = $Refcoord{y} + ( $Refcoord{pixel} / 2 );
|
492
|
0
|
|
|
|
|
|
my $x2 = $Refcoord{x} + ( $Refcoord{pixel} / 2 );
|
493
|
0
|
|
|
|
|
|
my $y2 = $Refcoord{y} - ( $Refcoord{pixel} / 2 );
|
494
|
0
|
|
|
|
|
|
my $x3 = $x1;
|
495
|
0
|
|
|
|
|
|
my $y3 = $y2;
|
496
|
0
|
|
|
|
|
|
my $x4 = $x2;
|
497
|
0
|
|
|
|
|
|
my $y4 = $y1;
|
498
|
0
|
|
|
|
|
|
$CompositeWidget->createLine( $x1, $y1, $x2, $y2, %{ $Refcoord{option} } );
|
|
0
|
|
|
|
|
|
|
499
|
0
|
|
|
|
|
|
$CompositeWidget->createLine( $x3, $y3, $x4, $y4, %{ $Refcoord{option} } );
|
|
0
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
}
|
501
|
|
|
|
|
|
|
elsif ( $Refcoord{type} eq 'diamond' ) {
|
502
|
0
|
|
|
|
|
|
my $x1 = $Refcoord{x} - ( $Refcoord{pixel} / 2 );
|
503
|
0
|
|
|
|
|
|
my $y1 = $Refcoord{y};
|
504
|
0
|
|
|
|
|
|
my $x2 = $Refcoord{x};
|
505
|
0
|
|
|
|
|
|
my $y2 = $Refcoord{y} + ( $Refcoord{pixel} / 2 );
|
506
|
0
|
|
|
|
|
|
my $x3 = $Refcoord{x} + ( $Refcoord{pixel} / 2 );
|
507
|
0
|
|
|
|
|
|
my $y3 = $Refcoord{y};
|
508
|
0
|
|
|
|
|
|
my $x4 = $Refcoord{x};
|
509
|
0
|
|
|
|
|
|
my $y4 = $Refcoord{y} - ( $Refcoord{pixel} / 2 );
|
510
|
0
|
|
|
|
|
|
$CompositeWidget->createPolygon( $x1, $y1, $x2, $y2, $x3, $y3, $x4, $y4, %{ $Refcoord{option} } );
|
|
0
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
}
|
512
|
|
|
|
|
|
|
elsif ( $Refcoord{type} eq 'vertical line' ) {
|
513
|
0
|
|
|
|
|
|
my $x1 = $Refcoord{x};
|
514
|
0
|
|
|
|
|
|
my $y1 = $Refcoord{y} - ( $Refcoord{pixel} / 2 );
|
515
|
0
|
|
|
|
|
|
my $x2 = $Refcoord{x};
|
516
|
0
|
|
|
|
|
|
my $y2 = $Refcoord{y} + ( $Refcoord{pixel} / 2 );
|
517
|
0
|
|
|
|
|
|
$CompositeWidget->createLine( $x1, $y1, $x2, $y2, %{ $Refcoord{option} } );
|
|
0
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
}
|
519
|
|
|
|
|
|
|
elsif ( $Refcoord{type} eq 'horizontal line' ) {
|
520
|
0
|
|
|
|
|
|
my $x1 = $Refcoord{x} - ( $Refcoord{pixel} / 2 );
|
521
|
0
|
|
|
|
|
|
my $y1 = $Refcoord{y};
|
522
|
0
|
|
|
|
|
|
my $x2 = $Refcoord{x} + ( $Refcoord{pixel} / 2 );
|
523
|
0
|
|
|
|
|
|
my $y2 = $Refcoord{y};
|
524
|
0
|
|
|
|
|
|
$CompositeWidget->createLine( $x1, $y1, $x2, $y2, %{ $Refcoord{option} } );
|
|
0
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
}
|
526
|
|
|
|
|
|
|
else {
|
527
|
0
|
|
|
|
|
|
return;
|
528
|
|
|
|
|
|
|
}
|
529
|
|
|
|
|
|
|
|
530
|
0
|
|
|
|
|
|
return 1;
|
531
|
|
|
|
|
|
|
}
|
532
|
|
|
|
|
|
|
|
533
|
|
|
|
|
|
|
=for _display_line
|
534
|
|
|
|
|
|
|
Dispay point
|
535
|
|
|
|
|
|
|
Arg : Reference of hash
|
536
|
|
|
|
|
|
|
{
|
537
|
|
|
|
|
|
|
x => value,
|
538
|
|
|
|
|
|
|
y => value,
|
539
|
|
|
|
|
|
|
pixel => value,
|
540
|
|
|
|
|
|
|
type => string, (circle, cross, plus, diamond, rectangle, Vline, Hline )
|
541
|
|
|
|
|
|
|
option => Hash reference ( {-fill => xxx, -outline => yy, ...} )
|
542
|
|
|
|
|
|
|
}
|
543
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
=cut
|
545
|
|
|
|
|
|
|
|
546
|
|
|
|
|
|
|
# $CompositeWidget->_display_line($RefPoints, $LineNumber);
|
547
|
|
|
|
|
|
|
sub _display_line {
|
548
|
0
|
|
|
0
|
|
|
my ( $CompositeWidget, $RefPoints, $LineNumber ) = @_;
|
549
|
|
|
|
|
|
|
|
550
|
0
|
|
|
|
|
|
my $RefDataToDisplay = $CompositeWidget->{RefInfoDummies}->{Data}{RefDataToDisplay};
|
551
|
0
|
0
|
0
|
|
|
|
return unless ( defined $RefDataToDisplay and defined $RefDataToDisplay->[$LineNumber] );
|
552
|
|
|
|
|
|
|
|
553
|
0
|
|
|
|
|
|
my %options;
|
554
|
0
|
|
|
|
|
|
my $font = $CompositeWidget->{RefInfoDummies}->{Data}{RefOptionDataToDisplay}{'-font'};
|
555
|
0
|
|
|
|
|
|
my $color = $CompositeWidget->{RefInfoDummies}->{Data}{RefOptionDataToDisplay}{'-foreground'};
|
556
|
0
|
0
|
|
|
|
|
$options{'-font'} = $font if ( defined $font );
|
557
|
0
|
0
|
|
|
|
|
$options{'-fill'} = $color if ( defined $color );
|
558
|
|
|
|
|
|
|
|
559
|
0
|
|
|
|
|
|
my $indice_point = 0;
|
560
|
|
|
|
|
|
|
|
561
|
0
|
|
|
|
|
|
DISPLAY:
|
562
|
0
|
|
|
|
|
|
foreach my $value ( @{ $RefDataToDisplay->[$LineNumber] } ) {
|
563
|
0
|
0
|
|
|
|
|
if ( defined $value ) {
|
564
|
0
|
|
|
|
|
|
my $x = $RefPoints->[$indice_point];
|
565
|
0
|
|
|
|
|
|
$indice_point++;
|
566
|
0
|
|
|
|
|
|
my $y = $RefPoints->[$indice_point] - 10;
|
567
|
0
|
|
|
|
|
|
$CompositeWidget->createText(
|
568
|
|
|
|
|
|
|
$x, $y,
|
569
|
|
|
|
|
|
|
-text => $value,
|
570
|
|
|
|
|
|
|
%options,
|
571
|
|
|
|
|
|
|
);
|
572
|
0
|
|
|
|
|
|
$indice_point++;
|
573
|
0
|
0
|
|
|
|
|
last DISPLAY unless defined $RefPoints->[$indice_point];
|
574
|
0
|
|
|
|
|
|
next DISPLAY;
|
575
|
|
|
|
|
|
|
}
|
576
|
0
|
|
|
|
|
|
$indice_point += 2;
|
577
|
|
|
|
|
|
|
}
|
578
|
|
|
|
|
|
|
|
579
|
0
|
|
|
|
|
|
return;
|
580
|
|
|
|
|
|
|
}
|
581
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
sub _box {
|
583
|
0
|
|
|
0
|
|
|
my ($CompositeWidget) = @_;
|
584
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
# close axis
|
586
|
|
|
|
|
|
|
# X axis 2
|
587
|
0
|
|
|
|
|
|
$CompositeWidget->createLine(
|
588
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CxMin},
|
589
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CyMax},
|
590
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CxMax},
|
591
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CyMax},
|
592
|
|
|
|
|
|
|
-tags => [
|
593
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{BoxAxis},
|
594
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllAXIS},
|
595
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph},
|
596
|
|
|
|
|
|
|
],
|
597
|
|
|
|
|
|
|
);
|
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
# Y axis 2
|
600
|
0
|
|
|
|
|
|
$CompositeWidget->createLine(
|
601
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CxMax},
|
602
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CyMin},
|
603
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CxMax},
|
604
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CyMax},
|
605
|
|
|
|
|
|
|
-tags => [
|
606
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{BoxAxis},
|
607
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllAXIS},
|
608
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph},
|
609
|
|
|
|
|
|
|
],
|
610
|
|
|
|
|
|
|
);
|
611
|
|
|
|
|
|
|
|
612
|
0
|
|
|
|
|
|
return;
|
613
|
|
|
|
|
|
|
}
|
614
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
sub _ytick {
|
616
|
0
|
|
|
0
|
|
|
my ($CompositeWidget) = @_;
|
617
|
|
|
|
|
|
|
|
618
|
0
|
|
|
|
|
|
my $longticks = $CompositeWidget->cget( -longticks );
|
619
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickNumber} = $CompositeWidget->cget( -yticknumber );
|
620
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
# space between y ticks
|
622
|
0
|
|
|
|
|
|
my $Space = $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{Height}
|
623
|
|
|
|
|
|
|
/ $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickNumber};
|
624
|
0
|
|
|
|
|
|
my $UnitValue
|
625
|
|
|
|
|
|
|
= ( $CompositeWidget->{RefInfoDummies}->{Data}{MaxYValue}
|
626
|
|
|
|
|
|
|
- $CompositeWidget->{RefInfoDummies}->{Data}{MinYValue} )
|
627
|
|
|
|
|
|
|
/ $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickNumber};
|
628
|
|
|
|
|
|
|
|
629
|
0
|
|
|
|
|
|
for my $TickNumber ( 1 .. $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickNumber} ) {
|
630
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
# Display y ticks
|
632
|
0
|
|
|
|
|
|
my $Ytickx1 = $CompositeWidget->{RefInfoDummies}->{Axis}{Cx0};
|
633
|
0
|
|
|
|
|
|
my $Yticky1 = $CompositeWidget->{RefInfoDummies}->{Axis}{CyMin} - ( $TickNumber * $Space );
|
634
|
0
|
|
|
|
|
|
my $Ytickx2 = $CompositeWidget->{RefInfoDummies}->{Axis}{Cx0}
|
635
|
|
|
|
|
|
|
- $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickWidth};
|
636
|
0
|
|
|
|
|
|
my $Yticky2 = $CompositeWidget->{RefInfoDummies}->{Axis}{CyMin} - ( $TickNumber * $Space );
|
637
|
|
|
|
|
|
|
|
638
|
0
|
|
|
|
|
|
my $YValuex
|
639
|
|
|
|
|
|
|
= $CompositeWidget->{RefInfoDummies}->{Axis}{Cx0}
|
640
|
|
|
|
|
|
|
- ( $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickWidth}
|
641
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{ScaleValuesWidth} / 2 );
|
642
|
0
|
|
|
|
|
|
my $YValuey = $Yticky1;
|
643
|
0
|
|
|
|
|
|
my $Value = $UnitValue * $TickNumber + $CompositeWidget->{RefInfoDummies}->{Data}{MinYValue};
|
644
|
0
|
0
|
|
|
|
|
next if ( $Value == 0 );
|
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
# Long tick
|
647
|
0
|
0
|
0
|
|
|
|
if ( defined $longticks and $longticks == 1 ) {
|
648
|
0
|
|
|
|
|
|
$Ytickx1 = $CompositeWidget->{RefInfoDummies}->{Axis}{CxMin};
|
649
|
0
|
|
|
|
|
|
$Ytickx2 = $CompositeWidget->{RefInfoDummies}->{Axis}{CxMax};
|
650
|
|
|
|
|
|
|
}
|
651
|
|
|
|
|
|
|
|
652
|
|
|
|
|
|
|
# round value if to long
|
653
|
0
|
0
|
0
|
|
|
|
if ( $Value > 1000000 or length $Value > 7 ) {
|
654
|
0
|
|
|
|
|
|
$Value = _roundValue($Value);
|
655
|
|
|
|
|
|
|
}
|
656
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
$CompositeWidget->createLine(
|
658
|
0
|
|
|
|
|
|
$Ytickx1, $Yticky1, $Ytickx2, $Yticky2,
|
659
|
|
|
|
|
|
|
-tags => [
|
660
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{yTick},
|
661
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllTick},
|
662
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph},
|
663
|
|
|
|
|
|
|
],
|
664
|
|
|
|
|
|
|
);
|
665
|
0
|
|
|
|
|
|
$CompositeWidget->createText(
|
666
|
|
|
|
|
|
|
$YValuex, $YValuey,
|
667
|
|
|
|
|
|
|
-text => $Value,
|
668
|
|
|
|
|
|
|
-fill => $CompositeWidget->cget( -yvaluecolor ),
|
669
|
|
|
|
|
|
|
-tags => [
|
670
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{yValues},
|
671
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllValues},
|
672
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph},
|
673
|
|
|
|
|
|
|
],
|
674
|
|
|
|
|
|
|
);
|
675
|
|
|
|
|
|
|
}
|
676
|
|
|
|
|
|
|
|
677
|
|
|
|
|
|
|
# Display 0 value
|
678
|
0
|
0
|
|
|
|
|
unless ( $CompositeWidget->{RefInfoDummies}->{Data}{MinYValue} == 0 ) {
|
679
|
0
|
|
|
|
|
|
$CompositeWidget->createText(
|
680
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Cx0}
|
681
|
|
|
|
|
|
|
- ( $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickWidth} ),
|
682
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Cy0},
|
683
|
|
|
|
|
|
|
-text => 0,
|
684
|
|
|
|
|
|
|
-tags => [
|
685
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{xValue0},
|
686
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllValues},
|
687
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph},
|
688
|
|
|
|
|
|
|
],
|
689
|
|
|
|
|
|
|
);
|
690
|
|
|
|
|
|
|
}
|
691
|
|
|
|
|
|
|
|
692
|
|
|
|
|
|
|
# Display the minimale value
|
693
|
|
|
|
|
|
|
$CompositeWidget->createText(
|
694
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CxMin} - (
|
695
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickWidth}
|
696
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{ScaleValuesWidth} / 2
|
697
|
|
|
|
|
|
|
),
|
698
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CyMin},
|
699
|
|
|
|
|
|
|
-text => _roundValue( $CompositeWidget->{RefInfoDummies}->{Data}{MinYValue} ),
|
700
|
|
|
|
|
|
|
-fill => $CompositeWidget->cget( -yvaluecolor ),
|
701
|
|
|
|
|
|
|
-tags => [
|
702
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{yValues},
|
703
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllValues},
|
704
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph},
|
705
|
|
|
|
|
|
|
],
|
706
|
|
|
|
|
|
|
);
|
707
|
|
|
|
|
|
|
|
708
|
|
|
|
|
|
|
# Long tick
|
709
|
0
|
0
|
0
|
|
|
|
unless ( defined $longticks and $longticks == 1 ) {
|
710
|
0
|
|
|
|
|
|
$CompositeWidget->createLine(
|
711
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Cx0},
|
712
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CyMin} - $Space,
|
713
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Cx0}
|
714
|
|
|
|
|
|
|
- $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickWidth},
|
715
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{CyMin} - $Space,
|
716
|
|
|
|
|
|
|
-tags => [
|
717
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{yTick},
|
718
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllTick},
|
719
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph},
|
720
|
|
|
|
|
|
|
],
|
721
|
|
|
|
|
|
|
);
|
722
|
|
|
|
|
|
|
}
|
723
|
|
|
|
|
|
|
|
724
|
0
|
|
|
|
|
|
return;
|
725
|
|
|
|
|
|
|
}
|
726
|
|
|
|
|
|
|
|
727
|
|
|
|
|
|
|
sub _title {
|
728
|
0
|
|
|
0
|
|
|
my ($CompositeWidget) = @_;
|
729
|
|
|
|
|
|
|
|
730
|
0
|
|
|
|
|
|
my $Title = $CompositeWidget->cget( -title );
|
731
|
0
|
|
|
|
|
|
my $TitleColor = $CompositeWidget->cget( -titlecolor );
|
732
|
0
|
|
|
|
|
|
my $TitleFont = $CompositeWidget->cget( -titlefont );
|
733
|
0
|
|
|
|
|
|
my $titleposition = $CompositeWidget->cget( -titleposition );
|
734
|
|
|
|
|
|
|
|
735
|
|
|
|
|
|
|
# Title verification
|
736
|
0
|
0
|
|
|
|
|
unless ($Title) {
|
737
|
0
|
|
|
|
|
|
return;
|
738
|
|
|
|
|
|
|
}
|
739
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
# Space before the title
|
741
|
0
|
|
|
|
|
|
my $WidthEmptyBeforeTitle
|
742
|
|
|
|
|
|
|
= $CompositeWidget->{RefInfoDummies}->{Canvas}{WidthEmptySpace}
|
743
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{ylabelWidth}
|
744
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{ScaleValuesWidth}
|
745
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickWidth};
|
746
|
|
|
|
|
|
|
|
747
|
|
|
|
|
|
|
# Coordinates title
|
748
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Ctitrex}
|
749
|
|
|
|
|
|
|
= ( $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{Width} / 2 ) + $WidthEmptyBeforeTitle;
|
750
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Ctitrey}
|
751
|
|
|
|
|
|
|
= $CompositeWidget->{RefInfoDummies}->{Canvas}{HeightEmptySpace}
|
752
|
|
|
|
|
|
|
+ ( $CompositeWidget->{RefInfoDummies}->{Title}{Height} / 2 );
|
753
|
|
|
|
|
|
|
|
754
|
|
|
|
|
|
|
# -width to createText
|
755
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{'-width'}
|
756
|
|
|
|
|
|
|
= $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{Width};
|
757
|
|
|
|
|
|
|
|
758
|
|
|
|
|
|
|
# display title
|
759
|
0
|
|
|
|
|
|
my $anchor;
|
760
|
0
|
0
|
|
|
|
|
if ( $titleposition eq 'left' ) {
|
|
|
0
|
|
|
|
|
|
761
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Ctitrex} = $WidthEmptyBeforeTitle;
|
762
|
0
|
|
|
|
|
|
$anchor = 'nw';
|
763
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{'-width'} = 0;
|
764
|
|
|
|
|
|
|
}
|
765
|
|
|
|
|
|
|
elsif ( $titleposition eq 'right' ) {
|
766
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Ctitrex}
|
767
|
|
|
|
|
|
|
= $WidthEmptyBeforeTitle + $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{Width};
|
768
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{'-width'} = 0;
|
769
|
0
|
|
|
|
|
|
$anchor = 'ne';
|
770
|
|
|
|
|
|
|
}
|
771
|
|
|
|
|
|
|
else {
|
772
|
0
|
|
|
|
|
|
$anchor = 'center';
|
773
|
|
|
|
|
|
|
}
|
774
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{IdTitre} = $CompositeWidget->createText(
|
775
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Ctitrex},
|
776
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Ctitrey},
|
777
|
|
|
|
|
|
|
-text => $Title,
|
778
|
|
|
|
|
|
|
-width => $CompositeWidget->{RefInfoDummies}->{Title}{'-width'},
|
779
|
|
|
|
|
|
|
-anchor => $anchor,
|
780
|
|
|
|
|
|
|
-tags => [ $CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph}, ],
|
781
|
|
|
|
|
|
|
);
|
782
|
0
|
0
|
|
|
|
|
return if ( $anchor =~ m{^left|right$} );
|
783
|
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
# get title information
|
785
|
0
|
|
|
|
|
|
my ($Height);
|
786
|
0
|
|
|
|
|
|
( $CompositeWidget->{RefInfoDummies}->{Title}{Ctitrex},
|
787
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Ctitrey},
|
788
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Width}, $Height
|
789
|
|
|
|
|
|
|
) = $CompositeWidget->bbox( $CompositeWidget->{RefInfoDummies}->{Title}{IdTitre} );
|
790
|
|
|
|
|
|
|
|
791
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->{RefInfoDummies}->{Title}{Ctitrey}
|
792
|
|
|
|
|
|
|
< $CompositeWidget->{RefInfoDummies}->{Canvas}{HeightEmptySpace} )
|
793
|
|
|
|
|
|
|
{
|
794
|
|
|
|
|
|
|
|
795
|
|
|
|
|
|
|
# cut title
|
796
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{Title}{IdTitre} );
|
797
|
|
|
|
|
|
|
|
798
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Ctitrex} = $WidthEmptyBeforeTitle;
|
799
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Ctitrey}
|
800
|
|
|
|
|
|
|
= $CompositeWidget->{RefInfoDummies}->{Canvas}{HeightEmptySpace}
|
801
|
|
|
|
|
|
|
+ ( $CompositeWidget->{RefInfoDummies}->{Title}{Height} / 2 );
|
802
|
|
|
|
|
|
|
|
803
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{'-width'} = 0;
|
804
|
|
|
|
|
|
|
|
805
|
|
|
|
|
|
|
# display title
|
806
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{IdTitre} = $CompositeWidget->createText(
|
807
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Ctitrex},
|
808
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{Ctitrey},
|
809
|
|
|
|
|
|
|
-text => $Title,
|
810
|
|
|
|
|
|
|
-width => $CompositeWidget->{RefInfoDummies}->{Title}{'-width'},
|
811
|
|
|
|
|
|
|
-anchor => 'nw',
|
812
|
|
|
|
|
|
|
-tags => [ $CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph}, ],
|
813
|
|
|
|
|
|
|
);
|
814
|
|
|
|
|
|
|
}
|
815
|
|
|
|
|
|
|
|
816
|
|
|
|
|
|
|
$CompositeWidget->itemconfigure(
|
817
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Title}{IdTitre},
|
818
|
|
|
|
|
|
|
-font => $TitleFont,
|
819
|
|
|
|
|
|
|
-fill => $TitleColor,
|
820
|
|
|
|
|
|
|
);
|
821
|
0
|
|
|
|
|
|
return;
|
822
|
|
|
|
|
|
|
}
|
823
|
|
|
|
|
|
|
|
824
|
|
|
|
|
|
|
sub _XLabelPosition {
|
825
|
0
|
|
|
0
|
|
|
my ($CompositeWidget) = @_;
|
826
|
|
|
|
|
|
|
|
827
|
0
|
|
|
|
|
|
my $xlabel = $CompositeWidget->cget( -xlabel );
|
828
|
|
|
|
|
|
|
|
829
|
|
|
|
|
|
|
# no x_label
|
830
|
0
|
0
|
|
|
|
|
unless ( defined $xlabel ) {
|
831
|
0
|
|
|
|
|
|
return;
|
832
|
|
|
|
|
|
|
}
|
833
|
|
|
|
|
|
|
|
834
|
|
|
|
|
|
|
# coordinate (CxlabelX, CxlabelY)
|
835
|
0
|
|
|
|
|
|
my $BeforexlabelX
|
836
|
|
|
|
|
|
|
= $CompositeWidget->{RefInfoDummies}->{Canvas}{WidthEmptySpace}
|
837
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{ylabelWidth}
|
838
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{ScaleValuesWidth}
|
839
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{TickWidth};
|
840
|
0
|
|
|
|
|
|
my $BeforexlabelY
|
841
|
|
|
|
|
|
|
= $CompositeWidget->{RefInfoDummies}->{Canvas}{HeightEmptySpace}
|
842
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Title}{Height}
|
843
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{Height}
|
844
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{TickHeight}
|
845
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{ScaleValuesHeight};
|
846
|
|
|
|
|
|
|
|
847
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{CxlabelX}
|
848
|
|
|
|
|
|
|
= $BeforexlabelX + ( $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{Width} / 2 );
|
849
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{CxlabelY}
|
850
|
|
|
|
|
|
|
= $BeforexlabelY + ( $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{xlabelHeight} / 2 );
|
851
|
|
|
|
|
|
|
|
852
|
|
|
|
|
|
|
# display xlabel
|
853
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{Idxlabel} = $CompositeWidget->createText(
|
854
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{CxlabelX},
|
855
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{CxlabelY},
|
856
|
|
|
|
|
|
|
-text => $xlabel,
|
857
|
|
|
|
|
|
|
-width => $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{Width},
|
858
|
|
|
|
|
|
|
-tags => [ $CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph}, ],
|
859
|
|
|
|
|
|
|
);
|
860
|
|
|
|
|
|
|
|
861
|
|
|
|
|
|
|
# get info ylabel xlabel
|
862
|
0
|
|
|
|
|
|
my ( $width, $Height );
|
863
|
0
|
|
|
|
|
|
( $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{CxlabelX},
|
864
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{CxlabelY},
|
865
|
|
|
|
|
|
|
$width, $Height
|
866
|
|
|
|
|
|
|
) = $CompositeWidget->bbox( $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{Idxlabel} );
|
867
|
|
|
|
|
|
|
|
868
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{CxlabelY} < $BeforexlabelY ) {
|
869
|
|
|
|
|
|
|
|
870
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{Idxlabel} );
|
871
|
|
|
|
|
|
|
|
872
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{CxlabelX} = $BeforexlabelX;
|
873
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{CxlabelY}
|
874
|
|
|
|
|
|
|
= $BeforexlabelY + ( $CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{xlabelHeight} / 2 );
|
875
|
|
|
|
|
|
|
|
876
|
|
|
|
|
|
|
# display xlabel
|
877
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{Idxlabel} = $CompositeWidget->createText(
|
878
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{CxlabelX},
|
879
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{CxlabelY},
|
880
|
|
|
|
|
|
|
-text => $xlabel,
|
881
|
|
|
|
|
|
|
-width => 0,
|
882
|
|
|
|
|
|
|
-anchor => 'nw',
|
883
|
|
|
|
|
|
|
-tags => [ $CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph}, ],
|
884
|
|
|
|
|
|
|
);
|
885
|
|
|
|
|
|
|
}
|
886
|
|
|
|
|
|
|
|
887
|
|
|
|
|
|
|
$CompositeWidget->itemconfigure(
|
888
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Xaxis}{Idxlabel},
|
889
|
|
|
|
|
|
|
-font => $CompositeWidget->cget( -xlabelfont ),
|
890
|
|
|
|
|
|
|
-fill => $CompositeWidget->cget( -xlabelcolor ),
|
891
|
|
|
|
|
|
|
);
|
892
|
|
|
|
|
|
|
|
893
|
0
|
|
|
|
|
|
return;
|
894
|
|
|
|
|
|
|
}
|
895
|
|
|
|
|
|
|
|
896
|
|
|
|
|
|
|
sub _YLabelPosition {
|
897
|
0
|
|
|
0
|
|
|
my ($CompositeWidget) = @_;
|
898
|
|
|
|
|
|
|
|
899
|
0
|
|
|
|
|
|
my $ylabel = $CompositeWidget->cget( -ylabel );
|
900
|
|
|
|
|
|
|
|
901
|
|
|
|
|
|
|
# no y_label
|
902
|
0
|
0
|
|
|
|
|
unless ( defined $ylabel ) {
|
903
|
0
|
|
|
|
|
|
return;
|
904
|
|
|
|
|
|
|
}
|
905
|
|
|
|
|
|
|
|
906
|
|
|
|
|
|
|
# coordinate (CylabelX, CylabelY)
|
907
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{CylabelX}
|
908
|
|
|
|
|
|
|
= $CompositeWidget->{RefInfoDummies}->{Canvas}{WidthEmptySpace}
|
909
|
|
|
|
|
|
|
+ ( $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{ylabelWidth} / 2 );
|
910
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{CylabelY}
|
911
|
|
|
|
|
|
|
= $CompositeWidget->{RefInfoDummies}->{Canvas}{HeightEmptySpace}
|
912
|
|
|
|
|
|
|
+ $CompositeWidget->{RefInfoDummies}->{Title}{Height}
|
913
|
|
|
|
|
|
|
+ ( $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{Height} / 2 );
|
914
|
|
|
|
|
|
|
|
915
|
|
|
|
|
|
|
# display ylabel
|
916
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{Idylabel} = $CompositeWidget->createText(
|
917
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{CylabelX},
|
918
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{CylabelY},
|
919
|
|
|
|
|
|
|
-text => $ylabel,
|
920
|
|
|
|
|
|
|
-font => $CompositeWidget->cget( -ylabelfont ),
|
921
|
|
|
|
|
|
|
-width => $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{ylabelWidth},
|
922
|
|
|
|
|
|
|
-fill => $CompositeWidget->cget( -ylabelcolor ),
|
923
|
|
|
|
|
|
|
-tags => [ $CompositeWidget->{RefInfoDummies}->{TAGS}{AllTagsDummiesGraph}, ],
|
924
|
|
|
|
|
|
|
);
|
925
|
|
|
|
|
|
|
|
926
|
|
|
|
|
|
|
# get info ylabel
|
927
|
0
|
|
|
|
|
|
my ( $Width, $Height );
|
928
|
0
|
|
|
|
|
|
( $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{CylabelX},
|
929
|
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{CylabelY},
|
930
|
|
|
|
|
|
|
$Width, $Height
|
931
|
|
|
|
|
|
|
) = $CompositeWidget->bbox( $CompositeWidget->{RefInfoDummies}->{Axis}{Yaxis}{Idylabel} );
|
932
|
|
|
|
|
|
|
|
933
|
0
|
|
|
|
|
|
return;
|
934
|
|
|
|
|
|
|
}
|
935
|
|
|
|
|
|
|
|
936
|
|
|
|
|
|
|
sub _GraphForDummiesConstruction {
|
937
|
0
|
|
|
0
|
|
|
my ($CompositeWidget) = @_;
|
938
|
|
|
|
|
|
|
|
939
|
0
|
0
|
|
|
|
|
unless ( defined $CompositeWidget->{RefInfoDummies}->{Data}{PlotDefined} ) {
|
940
|
0
|
|
|
|
|
|
return;
|
941
|
|
|
|
|
|
|
}
|
942
|
|
|
|
|
|
|
|
943
|
0
|
|
|
|
|
|
$CompositeWidget->clearchart();
|
944
|
0
|
|
|
|
|
|
$CompositeWidget->_TreatParameters();
|
945
|
|
|
|
|
|
|
|
946
|
|
|
|
|
|
|
# For background gradient color
|
947
|
0
|
|
|
|
|
|
$CompositeWidget->set_gradientcolor;
|
948
|
|
|
|
|
|
|
|
949
|
|
|
|
|
|
|
# Pie graph
|
950
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->class eq 'Pie' ) {
|
951
|
|
|
|
|
|
|
|
952
|
|
|
|
|
|
|
# Width Pie
|
953
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Pie}{Width} = $CompositeWidget->{RefInfoDummies}->{Canvas}{Width}
|
954
|
|
|
|
|
|
|
- ( 2 * $CompositeWidget->{RefInfoDummies}->{Canvas}{WidthEmptySpace} );
|
955
|
|
|
|
|
|
|
|
956
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->{RefInfoDummies}->{Data}{RefAllData} ) {
|
957
|
0
|
|
|
|
|
|
$CompositeWidget->_titlepie;
|
958
|
0
|
|
|
|
|
|
$CompositeWidget->_ViewData;
|
959
|
0
|
|
|
|
|
|
$CompositeWidget->_ViewLegend();
|
960
|
|
|
|
|
|
|
}
|
961
|
0
|
|
|
|
|
|
return;
|
962
|
|
|
|
|
|
|
}
|
963
|
|
|
|
|
|
|
|
964
|
|
|
|
|
|
|
# Height and Width canvas
|
965
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Canvas}{Width} = $CompositeWidget->width;
|
966
|
0
|
|
|
|
|
|
$CompositeWidget->{RefInfoDummies}->{Canvas}{Height} = $CompositeWidget->height;
|
967
|
|
|
|
|
|
|
|
968
|
0
|
|
|
|
|
|
$CompositeWidget->_axis();
|
969
|
0
|
|
|
|
|
|
$CompositeWidget->_box();
|
970
|
0
|
|
|
|
|
|
$CompositeWidget->_YLabelPosition();
|
971
|
0
|
|
|
|
|
|
$CompositeWidget->_XLabelPosition();
|
972
|
0
|
|
|
|
|
|
$CompositeWidget->_title();
|
973
|
|
|
|
|
|
|
|
974
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->class eq 'Lines' ) {
|
975
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->cget( -pointline ) == 1 ) {
|
976
|
0
|
|
|
|
|
|
$CompositeWidget->_ViewDataPoints();
|
977
|
|
|
|
|
|
|
}
|
978
|
|
|
|
|
|
|
else {
|
979
|
0
|
|
|
|
|
|
$CompositeWidget->_ViewDataLines();
|
980
|
|
|
|
|
|
|
}
|
981
|
|
|
|
|
|
|
}
|
982
|
|
|
|
|
|
|
else {
|
983
|
0
|
|
|
|
|
|
$CompositeWidget->_ViewData();
|
984
|
|
|
|
|
|
|
}
|
985
|
|
|
|
|
|
|
|
986
|
|
|
|
|
|
|
#
|
987
|
0
|
0
|
|
|
|
|
unless ( $CompositeWidget->cget( -noaxis ) == 1 ) {
|
988
|
0
|
|
|
|
|
|
$CompositeWidget->_xtick();
|
989
|
0
|
|
|
|
|
|
$CompositeWidget->_ytick();
|
990
|
|
|
|
|
|
|
}
|
991
|
|
|
|
|
|
|
|
992
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->{RefInfoDummies}->{Legend}{NbrLegend} > 0 ) {
|
993
|
0
|
|
|
|
|
|
$CompositeWidget->_ViewLegend();
|
994
|
0
|
|
|
|
|
|
$CompositeWidget->_Balloon();
|
995
|
|
|
|
|
|
|
}
|
996
|
|
|
|
|
|
|
|
997
|
|
|
|
|
|
|
# If Y value < 0, don't display O x axis
|
998
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->{RefInfoDummies}->{Data}{MaxYValue} < 0 ) {
|
999
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{xAxis0} );
|
1000
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{xValue0} );
|
1001
|
|
|
|
|
|
|
}
|
1002
|
|
|
|
|
|
|
|
1003
|
|
|
|
|
|
|
# Axis
|
1004
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->cget( -boxaxis ) == 0 ) {
|
1005
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{BoxAxis} );
|
1006
|
|
|
|
|
|
|
}
|
1007
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->cget( -noaxis ) == 1 ) {
|
1008
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{AllAXIS} );
|
1009
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{AllTick} );
|
1010
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{AllValues} );
|
1011
|
|
|
|
|
|
|
}
|
1012
|
0
|
0
|
0
|
|
|
|
if ( $CompositeWidget->cget( -zeroaxisonly ) == 1
|
|
|
|
0
|
|
|
|
|
1013
|
|
|
|
|
|
|
and $CompositeWidget->{RefInfoDummies}->{Data}{MaxYValue} > 0
|
1014
|
|
|
|
|
|
|
and $CompositeWidget->{RefInfoDummies}->{Data}{MinYValue} < 0 )
|
1015
|
|
|
|
|
|
|
{
|
1016
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{xAxis} );
|
1017
|
|
|
|
|
|
|
}
|
1018
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->cget( -zeroaxis ) == 1 ) {
|
1019
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{xAxis0} );
|
1020
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{xTick} );
|
1021
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{xValues} );
|
1022
|
|
|
|
|
|
|
}
|
1023
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->cget( -xvalueview ) == 0 ) {
|
1024
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{xValues} );
|
1025
|
|
|
|
|
|
|
}
|
1026
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->cget( -yvalueview ) == 0 ) {
|
1027
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{yValues} );
|
1028
|
|
|
|
|
|
|
}
|
1029
|
|
|
|
|
|
|
|
1030
|
|
|
|
|
|
|
# ticks
|
1031
|
0
|
|
|
|
|
|
my $alltickview = $CompositeWidget->cget( -alltickview );
|
1032
|
0
|
0
|
|
|
|
|
if ( defined $alltickview ) {
|
1033
|
0
|
0
|
|
|
|
|
if ( $alltickview == 0 ) {
|
1034
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{AllTick} );
|
1035
|
|
|
|
|
|
|
}
|
1036
|
|
|
|
|
|
|
else {
|
1037
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -ytickview => 1 );
|
1038
|
0
|
|
|
|
|
|
$CompositeWidget->configure( -xtickview => 1 );
|
1039
|
|
|
|
|
|
|
}
|
1040
|
|
|
|
|
|
|
}
|
1041
|
|
|
|
|
|
|
else {
|
1042
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->cget( -xtickview ) == 0 ) {
|
1043
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{xTick} );
|
1044
|
|
|
|
|
|
|
}
|
1045
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->cget( -ytickview ) == 0 ) {
|
1046
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{yTick} );
|
1047
|
|
|
|
|
|
|
}
|
1048
|
|
|
|
|
|
|
}
|
1049
|
|
|
|
|
|
|
|
1050
|
|
|
|
|
|
|
# Legend
|
1051
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->{RefInfoDummies}->{Legend}{box} == 0 ) {
|
1052
|
0
|
|
|
|
|
|
$CompositeWidget->delete( $CompositeWidget->{RefInfoDummies}->{TAGS}{BoxLegend} );
|
1053
|
|
|
|
|
|
|
}
|
1054
|
|
|
|
|
|
|
|
1055
|
0
|
0
|
|
|
|
|
if ( $CompositeWidget->class eq 'Mixed' ) {
|
1056
|
|
|
|
|
|
|
|
1057
|
|
|
|
|
|
|
# Order displaying data
|
1058
|
0
|
|
|
|
|
|
$CompositeWidget->display_order;
|
1059
|
|
|
|
|
|
|
}
|
1060
|
0
|
|
|
|
|
|
return 1;
|
1061
|
|
|
|
|
|
|
}
|
1062
|
|
|
|
|
|
|
|
1063
|
|
|
|
|
|
|
1;
|
1064
|
|
|
|
|
|
|
|
1065
|
|
|
|
|
|
|
__END__
|