From: Evertjan. on
lunaclaire wrote on 24 jun 2010 in comp.lang.javascript:

> I'm working on a proj where we need to plot a series of time durations
> as a bar chart.
>
> Currently, we've been using JSChart for various charts, but I now need
> to plot a data series that displays the bars labeled with the time
> durations in "mm:ss" format and it seems like JSChart can only take a
> series of decimal numbers for its plotting and then uses those values
> for the labels. It also seems that the y-axis can only be labeled with
> the same decimal valued scale (vs one with diff time intervals).
>
> And in searching thru other packages, I cant find anything that does
> things differently.
>
> One thing that might work is if a package would take a data array that
> would have separate values for what's used for the plotting of each
> data pt and what's used to label it. But I havent found anything that
> does it that way either.
>
> Does anyone know of a JS library that can handle time values

You don't need a library for that,
just do:

var secs = 60 * min + sec;

[This is primary school stuf]

> and display bar values

Why go for libraries, Javascript clientside plotting is fast and logical.

> with a formatted string?

Could there be unformatted strings?

The "bar values" could be in floating divs.

===========================

This is from 2003 [the view-source is outdated]:
<http://devrijehuisarts.org/test/jsgraph.asp>

Or you can use floating color filled divs of any size.

Or you can let do it serverside on their server.
<http://code.google.com/intl/nl/apis/charttools/>



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
From: Evertjan. on
lunaclaire wrote on 25 jun 2010 in comp.lang.javascript:

>> Is your Q that we write such function for you, without you trying
>> first?
>>
>
> No, no, no.
>
> I'm never sure, in forums where people request help and others gladly
> give it, why people like you respond with such an arrogant, lecturing,
> and dismissive tone. Please save yourself and others time by not
> bothering to reply in such a non-useful manner.

This is not a helpdesk forum, but usenet.
Here the asking party does not define the constraints of a response.
You do not determine what another should think useful.

I think my admonitions are very useful for you, as you are using a wrong
concept. position:absolute; positioning is the way to go here.

> As stated twice, it's not a problem either having the values in
> decimal or time format (we're already generating those)... my problem
> is in getting the time format's displayed on the bars of the chart.

You are forgetting I showed you a nice way to do this with serverside
Javascript and CSS. Please look back and tell us what is wrong about
that idea.

Are you advising your client to do this without serverside scripting?

> I and my client are not interested in me writing a charting package.

Wel if you are a professional you are the doctor. You should have the
lead in how the result should be generated. If you do not do that you
are mistreating your client, even though he wants you to.

If you are the taxidriver your client says where he wants to go, but you
decide about the adhering to the trafficrules, because you must assume
he realy wants to get there safely.

> We're simply looking to replace what they have in place (which is
> being used to display various pie, bar/column, and line charts with a
> bunch of features) with something that has the missing capability
> needed.

So you are not asking for a Javascript solution at all?
If so you chose the wrong NG.

> Anyone else have any recommendations?

Not if you do not ask for Javascript scripting solutions, methinks.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)