pricecharts

track prices of consumer electronics
Log | Files | Refs | README

commit 0847defadc6cc3ad2794969910dbf7114f3d099f
parent 383cfca2ef3ebebb3f17195fde67f80b8131cdb4
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Sat,  4 Apr 2015 19:13:03 -0600

gen_svg: define circle closer to use

Diffstat:
Mgen_svg | 15++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/gen_svg b/gen_svg @@ -129,11 +129,6 @@ while (my ($manufacturer, $part_num) = $parts_sth->fetchrow_array()) { # xlink:href's don't like raw ampersands $url =~ s/&/&amp;/g; - # define a retailers data point, this can be referenced later - $defs->circle(id => "data_point_$retailer", cx => 0, cy => 0, - r => 2, style => "stroke: #$color; fill: white; stroke-width: 2", - ); - # get all prices that we've scraped per product per retailer $point_sth->execute($part_num, $retailer); while (my ($date, $price) = $point_sth->fetchrow_array) { @@ -152,12 +147,14 @@ while (my ($manufacturer, $part_num) = $parts_sth->fetchrow_array()) { target => "new_window"); # draw path first - $anchor->use( - -href => "#path_$retailer_id", class => "chart_series", - style => { stroke => "#$color" } + $anchor->use(-href => "#path_$retailer_id", + class => "chart_series", style => "stroke: #$color" ); - # then draw individual data points + # now draw individual data points + $defs->circle(id => "data_point_$retailer", cx => 0, cy => 0, + r => 2, style => "stroke: #$color; fill: white; stroke-width: 2", + ); while (my $i = each @xs) { $anchor->use(-href => "#data_point_$retailer", x => $xs[$i], y => $ys[$i]