Skip Menu |

This queue is for tickets about the Google-Chart CPAN distribution.

Report information
The Basics
Id: 45504
Status: new
Priority: 0/
Queue: Google-Chart

People
Owner: Nobody in particular
Requestors: MSCHILLI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.05013
Fixed in: (no value)



Subject: Adding support for 'title' attribute in Google::Chart
Here's a patch to add the 'title' attribute to the Google::Chart constructor in order to use Google::Chart::Title.
Subject: 0001-added-title.patch
From e62eeeaed90d2a2e444cc268effd10f2e9d50576 Mon Sep 17 00:00:00 2001 From: mschilli <m@perlmeister.com> Date: Mon, 27 Apr 2009 23:19:45 -0700 Subject: [PATCH] added 'title' --- lib/Google/Chart.pm | 8 +++++++- lib/Google/Chart/Title.pm | 12 ++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/Google/Chart.pm b/lib/Google/Chart.pm index c8e0614..12607b6 100644 --- a/lib/Google/Chart.pm +++ b/lib/Google/Chart.pm @@ -11,6 +11,7 @@ use Google::Chart::Data; use Google::Chart::Size; use Google::Chart::Type; use Google::Chart::Types; +use Google::Chart::Title; use LWP::UserAgent; use URI; use overload @@ -72,7 +73,12 @@ my %COMPONENTS = ( is => 'rw', does => 'Google::Chart::Fill', coerce => 1 - } + }, + title => { + is => 'rw', + does => 'Google::Chart::Title', + coerce => 1 + }, ); my @COMPONENTS = keys %COMPONENTS; diff --git a/lib/Google/Chart/Title.pm b/lib/Google/Chart/Title.pm index 703676e..8aed390 100644 --- a/lib/Google/Chart/Title.pm +++ b/lib/Google/Chart/Title.pm @@ -3,6 +3,14 @@ package Google::Chart::Title; use Moose; use Google::Chart::Types; +use Moose::Util::TypeConstraints; + +coerce 'Google::Chart::Title' + => from 'HashRef' + => via { + Google::Chart::Title->new(%$_); + } +; with 'Google::Chart::QueryComponent'; @@ -29,7 +37,7 @@ no Moose; sub as_query { my $self = shift; - my $text = $self->title; + my $text = $self->text; $text =~ s/\r?\n/|/gsm; my %data = ( chtt => $text @@ -60,4 +68,4 @@ Google::Chart::Title - Apply Title =head2 as_query -=cut \ No newline at end of file +=cut -- 1.5.4.3