SVGraph

 view release on metacpan or  search on metacpan

lib/SVGraph/2D/lines.pm  view on Meta::CPAN

						'restart'=>"whenNotActive"
					);
					
				}
=cut
				
			}
			
			$self->{SVG}->circle(
				cx=>(($points_x[$_]+$points_x[$_-1])/2),
				cy=>(($points_y[$_]+$points_y[$_-1])/2),r=>2,
				'fill'		=>	"rgb(".$colors{B1}.")",
				'stroke'		=>	"rgb(".$colors{L0}.")",
				'stroke-width'	=>	"1pt",
			) if $self->{ENV}{show_points_middle};
			
			
			if ($points_data[$_])
			{
				
				if (
						$self->{ENV}{show_data_background} ||
						$self->{columns}{$column}->{ENV}{show_data_background}
					)
				{
					my $width=length($points_data[$_])*5;
					
					my $rect=$self->{SVG}->rect(
						'x' => ($points_x[$_]+2),
						'y' => ($points_y[$_]-11),
						'width' => $width+3,
						'height' => 10,
						'fill'	=>"rgb(255,255,255)",
						'fill-opacity'	=>"1",
						'stroke'		=>"rgb(125,125,125)",
						'stroke-width'	=>"1pt",
						'stroke-linecap'	=>"round",
						'stroke-linejoin'	=>"round",
						'rx' => "2pt",
						'ry' => "2pt",
					);
=head1
					if ($self->{ENV}{show_data} || $self->{columns}{$column}->{ENV}{show_data})
					{
						$rect->text
						(
							x	=>	10,
							y	=>	10,
							style =>
								{
									'font-family'	=> 'Verdana',
									'font-size'		=> 8,
									'font-weight'	=> 400,
							#		'fill'		=>	"rgb(".$colors{B3}.")",
									'fill'	=>	"rgb(0,0,0)",
							#		'stroke'		=>	"rgb(0,0,0)",
							#		'stroke-width'	=>	"1pt",
									'stroke-linecap'	=>"round",
									'stroke-linejoin'	=>"round",
								},
						)->cdata($points_data[$_]);
					}
=cut
				}
				if ($self->{ENV}{show_data} || $self->{columns}{$column}->{ENV}{show_data})
				{
					$self->{SVG}->text
					(
						x	=>	$points_x[$_]+3,
						y	=>	$points_y[$_]-3,
						style =>
							{
								'font-family'	=> 'Verdana',
								'font-size'		=> '8px',
								'font-weight'	=> 400,
						#		'fill'		=>	"rgb(".$colors{B3}.")",
								'fill'	=>	"rgb(0,0,0)",
						#		'stroke'		=>	"rgb(0,0,0)",
						#		'stroke-width'	=>	"1pt",
								'stroke-linecap'	=>"round",
								'stroke-linejoin'	=>"round",
							},
					)->cdata($points_data[$_]);
				}
				
			}
			
			
#=head1
			# animated
			if
			(
				($self->{'ENV'}{'show_data_SMIL'} || $self->{columns}{$column}->{'ENV'}{'show_data_SMIL'})
				&&($points_data[$_])
			)
			{
			
				my $width=length($points_data[$_])*5;
				
				my $box=$self->{SVG}->polyline(
					'points'	=>
								($points_x[$_]-3).",".($points_y[$_]-5)." ".
								($points_x[$_]+$width).",".($points_y[$_]-5)." ".
								($points_x[$_]+$width).",".($points_y[$_]+5)." ".
								($points_x[$_]-3).",".($points_y[$_]+5)." ".
								($points_x[$_]-3).",".($points_y[$_]-5)." ",
					'fill'			=>"rgb(255,255,255)",
					'fill-opacity'	=>"0.7",
					'stroke'		=>"rgb(0,0,0)",
					'stroke-width'	=>"1",
					'stroke-opacity' => "0",
					'fill-opacity' => "0",
					'stroke-linecap'	=>"round",
					'stroke-linejoin'	=>"round",
				);
				
				$box->animate
				(
					'attributeName'=>"fill-opacity",
					'begin'=>"mouseover",
					'end'=>"mouseout",
#					'from'=>"0",
					'values'=>"1",
#					'dur'=>"0.5s",
#					'repeatDur'=>"freeze"
					'restart'=>"whenNotActive"
				);
			}
#=cut
			
		}

=head1
  	$self->{SVG}->polyline(
		points	=>	$points
	#		.$self->{block_right}.",".$self->{block_down}." "
	#		.$self->{block_left}.",".$self->{block_down}
		,
			'stroke-width'	=>"1pt" ,
			'stroke'		=>"black",
		style	=>
		{
	  		'fill'			=>"white",



( run in 0.490 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )