SVGraph

 view release on metacpan or  search on metacpan

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

	$self->{SVG}->text
	(
		'x' => 1,
		'y' => $self->{'ENV'}{'y'}-2,
		'style' => {
			#'text-anchor' => "end",
			'font-family' => "Verdana",
			'font-size' => '9px',
			'fill' => "gray",
		},
	)->cdata("[Generated by SVGraph on ".$dt->year()."-".sprintf("%02d",$dt->month())."-".sprintf("%02d",$dt->day())." ".sprintf("%02d",$dt->hour()).":".sprintf("%02d",$dt->min())." GMT]");
	
	return 1;
	
}


sub prepare_axis
{
	my $self=shift; 
	my $block=$self->{SVG}->polyline(

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

		$self->{SVG}->text
		(
			x	=>	int($self->{block_left}-5),
			y	=>	$y-2,
			style => {
				'text-anchor'	=> 'end',
				'font-family'	=> 'Verdana',
				'font-size'	=> $font_size.'px',
				'fill'		=> "black",
			},	
		)->cdata((($_*$self->{grid_y_main_spacing})+$self->{grid_y_scale_minimum}).$self->{grid_y_suffix});
		
	}
 
	return 1;
} 





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

					{
						'font-family'	=> 'Verdana',
						'font-size'	=> $textsize.'px',
						'fill'		=> "black",
	#					'writing-mode'	=>	"tb",
					}
				);
				my $txt=$g->text(
					transform=>"translate(".int($x1).",".($self->{block_down}+8).") rotate(70)",
	#				cursor=>"move",
				)->cdata($null);
				
=head1
				$g->animate
				(
					'attributeName'=>"font-weight",
					'begin'=>"mouseover",
					'end'=>"mouseout",
	#				'from'=>"900",
	#				'to'=>"900",
					'values'=>"900",

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

					'fill'		=> "black",
#					'stroke-width'=>"0.5px",
#					'stroke'=>"black",
#					'font-weight' => "bold"
#					'writing-mode'	=>	"tb",
				}
			);
			my $txt=$g->text(
				transform=>"translate(".int($x1).",".($self->{block_down}-6).") rotate(-90)",
#				cursor=>"move",
			)->cdata($null);
			
=head1
			$g->animate
			(
				'attributeName'=>"font-weight",
				'begin'=>"mouseover",
				'end'=>"mouseout",
#				'from'=>"900",
#				'to'=>"900",
				'values'=>"900",

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

				$null=$_ unless $null;   
				$self->{SVG}->text(
					x=>int($self->{block_left}+($_*$self->{block_width_scale}))+5,
					y=>$self->{block_up}-7,
					style => {
						'font-family'	=> 'Verdana',
						'font-size'		=> '8'.'px',
						'fill'			=> "black",
		
        				}
				)->cdata($null);
			}
		}  
	}

 	return 1;
} 




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

			{
				$self->{SVG}->text(
					x=>5,
					y=>$self->{block_down}-$height-5,
					style => {
				#		'text-anchor'	=> 'end',
						'font-family'	=> 'Verdana',
						'font-size'		=> '8'.'px',
						'fill'			=> "black",
					}
				)->cdata($null);  
			}
    			else
    			{
     				$self->{SVG}->text(
					x=>$self->{block_right}+8,
					y=>$self->{block_down}-$height-4,
					style => {
				#		'text-anchor'	=> 'end',
						'font-family'	=> 'Verdana',
						'font-size'		=> '8'.'px',
						'fill'			=> "black",
					}
      				)->cdata($null);  
    			}
  		}
  
  
 	}
 

 	return 1;
} 

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

						'font-family'	=> 'Verdana',
						'font-size'		=> '8pt',
						'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($data_w.$self->{'ENV'}{'data_suffix'});
			}
	
			if ($self->{columns}{$column}->{ENV}{show_data_summary})
			{
				$self->{SVG}->text
				(
					'x'	=>	($self->{block_left}+$x+$d_x),
					'y'	=>	($self->{block_down}-$height-3+$d_y),
					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($self->GetRowSum($row));
			}

   
#   $width=int($width*100)/100;
   
   			$rows++;
  		}

 	}
 

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

									'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 =>

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

								'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'})

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

			x=>int($x+($width*1.5)),
			y=>int($self->{block_up}+($_*($height*1.7)-$height)+($textsize/2)+($height/4)),
			style =>
			{
				'text-anchor'	=>	'start',
				'font-family'	=> 'Verdana',
				'font-size'	=> int($textsize).'px',
				'font-weight'	=> "600",
				'fill'		=> "black",
			},
		)->cdata($text);
	}
 
	return 1;
}

1;

lib/SVGraph/Core.pm  view on Meta::CPAN

		y=>int(($self->{block_up}*0.33)+($font_size/2)),
        	style => {
			'font-family'	=> 'Verdana',
			'font-size'	=> $font_size.'px',
			'font-weight'=> "900",
			'fill'		=> $self->{'ENV'}{'title.color'} || "black",
#			'fill-opacity'=>(0.5+0.5*rand()),
#			'fill'=>"$colour_map[$index]",
#			'stroke'=>"#808080"
		},	
	)->cdata($self->{ENV}{title}) if $self->{ENV}{title};

	return 1;
}





sub prepare_legend
{

lib/SVGraph/Core.pm  view on Meta::CPAN

			x=>int($x+($width*1.5)),
			y=>int($self->{block_up}+($count*($height*1.7)-$height)+($font_size/2)+($height/4)),
			style =>
			{
				'text-anchor'	=>	'start',
				'font-family'	=> 'Verdana',
				'font-size'	=> $font_size.'px',
				'font-weight'	=> "600",
				'fill'		=> "black",
			},
		)->cdata($_);
	
	}
 
 
	if ($self->{ENV}{show_legend_reverse})
	{
		@{$self->{columnsA}} = reverse @{$self->{columnsA}};
	}
 
	return 1;



( run in 0.634 second using v1.01-cache-2.11-cpan-454fe037f31 )