Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7167629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:36:55+00:00 2026-05-28T14:36:55+00:00

I have a pretty nice graph going in canvas right now, but I’m hitting

  • 0

I have a pretty nice graph going in canvas right now, but I’m hitting a wall with labeling my axes.

I can’t find information on how to place/write text in my canvas. The graph is based on the size of all the content, so I can’t preset everything or just use a background image.

There are two different ways I need to place text:

  1. Right justified at a location (x,y) so that the labels on the left
    side line up with the graph border.
  2. Centered at a location (x,y) for the labels on the bottom of my
    graph as well as a few data points written on the graph.

So, how can I draw text in my canvas? Or am I going the wrong direction, and need put the text in seperate block elements and absolute position them in CSS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:36:56+00:00Added an answer on May 28, 2026 at 2:36 pm

    I ended up using the fillText() command.

    context.fillStyle = "#444444"; // set color
    context.font = "normal normal 14px Helvetica"; // set font weight, size, etc
    context.textBaseline = "middle"; // how to align the text vertically
    context.textAlign = "end"; // how to align the text horizontally
    context.fillText("test1", 50, 50); // text, x, y
    

    For text that is centered, just change the textAlign to “center”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context menus seem to have a default white background. This looks pretty nice, but
update: the answer from virtualeyes (below) looks pretty nice: but now a bit code-sanititzing
I have heard that MbUnit comes with pretty nice test decorators which allow writing
I have pretty much finished my first working Symbian application, but in my hastened
I have built a PHP calendar system and have pretty much everything done but
I have a pretty complicated Linq query that I can't seem to get into
I've used iPhone SDK and tools for several months. Xcode seems pretty nice, but
As you may know, Pagedown is a pretty nice and simple editor, but I
I build a (so far) pretty nice templating mechanism for a cms. Now I
I have a poker game where I designed a nice pretty GUI that displays

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.