[aida] WebCharts with arbitrary axes was: WebCharts over dates

Herbert König herbertkoenig at gmx.net
Fri Jun 12 20:05:15 CEST 2009


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:herbertkoenig at gmx.net
-------------- nächster Teil --------------
Ein Dateianhang mit Bin?rdaten wurde abgetrennt...
Dateiname   : chart.PNG
Dateityp    : image/png
Dateigr??e  : 98150 bytes
Beschreibung: nicht verf?gbar
URL         : http://lists.aidaweb.si/pipermail/aida/attachments/20090612/14998943/attachment-0001.png 


More information about the Aida mailing list