Great idea for labels
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Great idea for labels Expand / Collapse
Author
Message
Posted 1/10/2008 7:31:10 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/13/2008 4:10:40 PM
Posts: 1, Visits: 4
Hi, I use FusionCharts v3 and it's great! Keep up the good work!

One thing I ran into today was the labels. I wanted to display both % value and value, so something like this:

Available (23K), 23%
Unavailable (76K), 76%

Currently, i just have the label be "Available ($number)" and it prints out that automatically. It would be great if you had a system like...

%p = percent value
%n = numeric value

so I can make the label... "Available (%n), %p"
or even something like... "%n Available, that's %p!!"

And you can add more %[x] things if you can think of it. %c for color, i guess. it would show a cube with the color in it or something.
Post #3814
Posted 1/23/2008 12:20:25 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/23/2008 12:10:30 PM
Posts: 4, Visits: 6
Hi Bubbler,

It's an interesting concept, but I think it's more of a shortcut for something you could do already quite easily by hand. I don't think there should be too much of this kind of logic in FusionCharts itself - that's what you're using PHP/.Net/etc for.

With the tooltips you can pass in whatever you like as a string, so you could just prepare the string beforehand in your serverside code and get what you're after. I've done the following myself in the past:


output.AppendFormat("", HttpContext.Current.Server.HtmlEncode(row["title"].ToString()), percent.ToString(), double.Parse(row["absolute"].ToString()));


This is leveraging the StringBuilder in .Net, of which "output" is an instance, but that's not important here. Note instead how the "toolText" attribute value is built out of both a percentage value (token 1), and the absolute value (token 2), separated with a hyphen.

This kind of thing will always be much more flexible in your application code, not the FusionCharts built-in logic.
Post #4036
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 6:24am


Execution: 0.078.