SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Google Vizualization API - chart title font

    I'm new to javascript and I'm working with the Google Visualization API. I have a simple chart in the code below. But for some reason the title of the chart is coming up in some fancy ugly script font. Can anyone tell me how to change it or where to look?

    I'm not sure if this should be a property I have to set in the google library (which I've searched and can't find anything related to styles) or if this is something google expects me to change outside of the api.

    Here's the simple code.

    Code:
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>   
     <script type="text/javascript">      
     google.load("visualization", "1", {packages:["areachart"]});      
     google.setOnLoadCallback(drawChart);      
     function drawChart() {        var data = new google.visualization.DataTable();        
     data.addColumn('string', 'Month');        
     data.addColumn('number', 'My Sales');        
     data.addColumn('number', 'Plan');        
     data.addRows(4);        
     data.setValue(0, 0, 'March');        
     data.setValue(0, 1, 13209);        
     data.setValue(0, 2, 10481);        
     data.setValue(1, 0, 'April');        
     data.setValue(1, 1, 9830);        
     data.setValue(1, 2, 8647);        
     data.setValue(2, 0, 'May');       
     data.setValue(2, 1, 11293);        
     data.setValue(2, 2, 14728);        
     data.setValue(3, 0, 'June');        
     data.setValue(3, 1, 13290);       
     data.setValue(3, 2, 13040);        
     var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));       
     chart.draw(data, {width: 400, height: 240, legend: 'bottom', title: 'My Performance'});      }    
     </script>

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is fine in Firefox, but in IE its all screwed up, as you originally said.

    Looking at the code, this is what is being added. I'm not sure whether you can change it though. I assume there is nothing in the API Documentation?

    Code xml:
    <text text-anchor="middle" x="200" y="16" font-family="Arial" font-size="11" font-weight="bold" fill="black">My Performance</text>


  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea, unfortunately, I couldn't find anything that referenced title, font, style, etc..


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •