473,385 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Scalable Vector Graphics (SVG) - compute text size

I am currently working on a .Net assembly (C#) to dynamically generate
an SVG in the form of a bar chart. I am having a problem drawing the
legend based upon dynamic data being passed to my class. When I am
drawing the legend, I need to determine which item is the longest and
make the legend at least that wide. What I would like to do is
determine the height and width of a piece of text based upon a
selected font and size. Does anyone have any code to do this or know
of where I can go for more information.
Jul 20 '05 #1
1 2506
James-Hughes wrote:
I am currently working on a .Net assembly (C#) to dynamically generate
an SVG in the form of a bar chart. I am having a problem drawing the
legend based upon dynamic data being passed to my class. When I am
drawing the legend, I need to determine which item is the longest and
make the legend at least that wide.


Use the method getComputedTextLength(), see for example:
<http://www.datenverdrahten.de/svglbc/?code=textinformationen>
<http://www.datenverdrahten.de/svglbc/?code=tooltip>

cu, Thomas
--
SVG - Learning By Coding
<http://www.datenverdrahten.de/svglbc/>
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Brian K | last post by:
I am new to Apache Batik and I am now doing a SVG Editor for my project. I use Java as programming language. I use Batik to generate the SVG from Java Graphics2D, as I would like to transform...
1
by: Richard | last post by:
I have a SVG document with links out to html pages which works when you run the SVG file i have tried to intergrate it into a coldfusion page and the links no longer work. The SVG file is : ...
0
by: Ron | last post by:
As of Build 1.0.1435.13178 MOBIFORM SVGViewPus can now be used in Internet Explorer Screen Shot: http://www.mobiform.com/svg/v1/SVGViewPlusinIE.jpg MOBIFORM has set up a demo of...
3
by: Ska | last post by:
I've just finished to write the 0.1b release of amanith ( www.amanith.org) a library to handle vector graphics fully written in ANSI C++ with STL, it's crossplatform (win, linux, bsd, mac, irix for...
2
by: Toble Rone | last post by:
Im really stuck with this. I have a propietary GIS system, with a georaphical database (like Oracle Spatial)... with a lot of gis info and maps. The point is ... i actually have a very big and...
2
by: dwyer.bill | last post by:
Hi, I am trying to create a control that will display a vector image. The main purpose is to allow for the resizing of an image without pixelation. All of our image files are in AI(Adobe...
1
by: Jay | last post by:
I'd like to experiment a little bit with vector graphics in python. When I say 'vector graphics' I don't mean regular old svg-style. I mean vector game style as in simulation of vector beam drawn...
4
by: clintonG | last post by:
Boy that's a helluva subject heh? But that's what I'm looking for. A navigation control that has a series of rectangles (each representing a star in the pattern) where each rectangle is connected...
2
by: cleary1981 | last post by:
Hi, I have created a script in PHP thats generates an SVG image. Want I want to do is have PHP save this as example.svg. Can this be done? Heres my code <?php require "config.php"; $proj_id =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.