Hi,
The doc here [1] says: "Data points may be stacked, meaning that the index of the point in the collection is its X value." When I use the same example as in the doc but with labels and ticks: b := RTGrapher new. ds := RTStackedDataSet new. ds dotShape color: Color red. ds points: #(5 1 20 5). ds y: #yourself. b add: ds. b axisX noDecimal. b axisY noDecimal. b build. b view inspect it seems that y values are not aligned on x ones (i.e. I would expect the first red point to be 1@5). Is it a bug or did I misunderstood something? Thanks, #Luc |
Hi Luc!
This is something that is not really intuitive in Roassal. I am not sure whether this is a bug, but until now, we usually disable the labels on the X-axis. So, your script should be -=-=-=-=-=-=-=-=-=-=-=-= b := RTGrapher new. ds := RTStackedDataSet new. ds dotShape color: Color red. ds points: #(5 1 20 5). ds y: #yourself. b add: ds. b axisX noLabel; noTick. b axisY noDecimal. b -=-=-=-=-=-=-=-=-=-=-=-= If you need ticks and labels, you can simply do: -=-=-=-=-=-=-=-=-=-= b := RTGrapher new. ds := RTStackedDataSet new. ds barShape width: 10. ds barChartWithBarCenteredTitle: #yourself. ds points: #(5 1 20 5). ds y: #yourself. b add: ds. b axisX noLabel; noTick. b axisY noDecimal. b -=-=-=-=-=-=-=-=-=-= I hope this solves your problem. Cheers, Alexandre On Jun 15, 2015, at 6:20 PM, Luc Fabresse <[hidden email]> wrote: -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
Hi Alex,
Thanks for your answer. I misunderstood RTStackedDataSet. To me, it does not do what the doc says ;-) I want to do exactly that: c := RTGrapher new. ds := RTDataSet new. ds dotShape color: Color red. ds points: {5@1 . 1@2 . 20@3 . 5@4 }. ds x: [ :e | e y ]. ds y: [ :e | e x ]. c add: ds. c axisX noDecimal. c axisY noDecimal. c build. c view inspect. But I would like to not write by hand (or compute) the X values in the data set which are the indexes of the element. Thanks, #Luc 2015-06-16 22:39 GMT+02:00 Alexandre Bergel <[hidden email]>:
|
Hi!
Well… Building the list of coordinate is not a big deal :-) { 5 . 1 . 2 . 5 } withIndexCollect: [ :v :index | v @ index ] Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
|
I just wanted to avoid creating new big collections #Luc 2015-06-17 21:12 GMT+02:00 Alexandre Bergel <[hidden email]>:
|
You pointed out indeed a default in Grapher. We will fix this in the future…
Cheers, Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
|
Free forum by Nabble | Edit this page |