[Seaside] Re: [ANN] Rickshaw.js charting library for Seaside

Paul DeBruicker pdebruic at gmail.com
Thu Sep 18 04:34:28 UTC 2014


Hi Sabine,



This works:


	xAxis
		optionAt: 'tickFormat'
		put:
			('switch (x) {case 1: return ''Sun'';case 2: return ''Mon'';case 3:
return ''Tue'';case 4: return ''Wed'';case 5: return ''Thu'';case 6: return
''Fri'';case 7: return ''Sat'';}'
				asFunction: #('x')).




Hope you've already figured it out.


Paul







Sabine Knöfel wrote
> Hi Esteban,
> 
> I just tried your wrapper for rickshaw and it is great. I am excited about
> it and I will use it for creating a dashboard for my application. Thank
> you for implementing this!
> 
> There is one point, I did not succeed with:
> Putting labels/strings at the x axis instead of numbers.
> e.g. a bar graph with "Monday", "Tuesday" etc. in the x axis instead of
> 1,2,3
> 
> This post describes exactly my problem:
> http://stackoverflow.com/questions/13266941/display-custom-labels-on-x-axis-with-rickshaw-js-library/14652472#14652472
> 
> I extended one of your examples and tried to add the tickformat option.
> But this did not work. I have spent some time with other experiments to
> solve this but in the end I did not succeed.
> 
> So, I ask you for help ;-)
> 
> This ist my code which does not work, it displays the function code
> instead of "Mon", "Tue" etc..
> 
> renderExampleStackedBarGraph3On: html
> 	| graph theAxis|
> 	html div
> 		class: 'chart';
> 		id: html nextId.
> 	graph := Rickshaw graph element: html lastId.
> 	graph beBar.	 
> 	graph
> 		addSeries:
> 				(RickshawSeries
> 						color: 'steelblue'
> 						elements:
> 							{(1 @ 40).
> 							(2@ 49).
> 							(3@ 38).
> 							(4 @ 30).
> 							(5 @ 32)});
> 		addSeriesNamed: 'With name'
> 			color: 'lightblue'
> 			elements:
> 				{(1 @ 40).
> 							(2@ 49).
> 							(3@ 38).
> 							(4 @ 30).
> 							(5 @ 32)}.
> 	theAxis := graph  xAxis.
> 	theAxis optionAt: 'pixelsPerTick' put: '400'.
> 	theAxis optionAt: 'tickFormat' put: 'function(x) {switch (x) {case 1:
> return ''Mon'';case 2: return ''Tue'';case 3: return ''Wed'';case 4:
> return ''Thu'';case 5: return ''Fri'';case 6: return ''Sat'';case 7:
> return ''Sun'';}}'.
> 	html script: graph asJavascript , theAxis asJavascript	 
> #################
> the other example was 
>  e.g. http://code.shutterstock.com/rickshaw/examples/x_axis.html
> with:
> theTimeAxis optionAt: 'tickFormat' put: 'function(n) {var map = {0:
> ''zero'',1: ''first'',2: ''second'',3: ''third''};return map[n];}'.
> 
> but this does not work either.
> 
> regards
> Sabine





--
View this message in context: http://forum.world.st/ANN-Rickshaw-js-charting-library-for-Seaside-tp4749681p4778714.html
Sent from the Seaside General mailing list archive at Nabble.com.


More information about the seaside mailing list