> 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.
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.