WebCharts over dates.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

WebCharts over dates.

Herbert König
Hi,

it was an afternoon to implement a WebApp on the quality report as
soon as I changed the time data to numeric data.

Now I want the x-axis labelled with dates, ideally printed vertically.
Anybody has experience with this?

I tried (c optionsAt: #xaxis) mode: 'time' and I found tickFormatter
in protochart.js documentation.

What is needed is to represent the dates as JS timestamps.

If nobody has done it yet (or if it's implemented but I didn't find)
I'll try it myself.




Cheers,

Herbert                          mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: WebCharts over dates.

Janko Mivšek
Hi Herbert,

Herbert König pravi:

> it was an afternoon to implement a WebApp on the quality report as
> soon as I changed the time data to numeric data.
>
> Now I want the x-axis labelled with dates, ideally printed vertically.
> Anybody has experience with this?
>
> I tried (c optionsAt: #xaxis) mode: 'time' and I found tickFormatter
> in protochart.js documentation.
>
> What is needed is to represent the dates as JS timestamps.
>
> If nobody has done it yet (or if it's implemented but I didn't find)
> I'll try it myself.

This would be nice and I need something similar too, just not for dates.
So a general solution for labels of any type in x axis (like month
names, for instance) would be very useful.

Best regards
Janko

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

WebCharts with arbitrary axes was: WebCharts over dates

Herbert König
Hi Janko,

JM> This would be nice and I need something similar too, just not for dates.
JM> So a general solution for labels of any type in x axis (like month
JM> names, for instance) would be very useful.

that was easier than I thought.

WebChartXaxisOption>>ticks:
ticks: aString
        self attributesAt: #ticks put: aString

Then in the component with the chart you do:
     "These create the necessary options"
     chart xaxis; yaxis; legend.
     "get the legend out of the diagram"
     "container is a WebElement placed where I want the legend"
     (chart optionsAt: #legend) container: container id.
     (chart options at: #yaxis) max: 700.
     (chart options at: #xaxis) ticks:
          '[[1, "a"] , [2, "b"], [4, "12. Woche"], 12]' .
     (chart options at: #yaxis) ticks:
          '[[400, "a few pieces"] , [500, "these are more"],
          [600, "5000 is what we want"], [700, "more than we can handle"]]' .

The parameters of ticks are:
'[[originalNumericValue, "anyOldReplacementString"], ....]'
The values must be between min: and max: or in the range of the
numeric values of the data.
'[firstValue, secondValue, ....]'
is an option to determine where you want numerical ticks.

If one (not me) can write up a JS function which computes the strings
from the function, tick: also accepts this.

Though it seemed more elegant to implement tickFormatter: i didn't
understand the comment in protochart.js.

Cheers,

Herbert                            mailto:[hidden email]
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

chart.PNG (131K) Download Attachment