Histograms

150 views
Skip to first unread message

epm...@gmail.com

unread,
May 10, 2015, 3:29:42 PM5/10/15
to jsxg...@googlegroups.com
How do I get a Histogram - i.e. vertical bar-chart, with x-axis values as, say, 50,100,150,etc., and y-axis values as 1000, 2000, 3000, etc.? (i.e. x and y intervals are different, and they ought to be displayed on the respective axis). These intervals are dynamic, and come from calculated variables (hence, cannot hardcode the bounding box also)

Thanks in advance

Murray

unread,
May 10, 2015, 9:13:41 PM5/10/15
to jsxg...@googlegroups.com, epm...@gmail.com
Hello

This example will help:


To change bounding box after you know the min and max, use e.g.:

var xDataMin = -2, xDataMax = 5, yDataMin = 0, yDataMax = 3000;
board
.setBoundingBox([xDataMin, xDataMax, yDataMin, yDataMax]);

Regards
Murray

epm...@gmail.com

unread,
May 11, 2015, 1:58:34 AM5/11/15
to jsxg...@googlegroups.com, epm...@gmail.com

Thanks Murray, but this is what I have in mind (Refer image).

The x-axis could, maybe, even start with 100--110--120--130-- etc.

Murray

unread,
May 17, 2015, 3:27:59 AM5/17/15
to jsxg...@googlegroups.com, epm...@gmail.com
Hello again

You could create your own axes to achieve this. See this page for some ways to go about doing it:


Regards
Murray

epm...@gmail.com

unread,
May 18, 2015, 7:46:05 AM5/18/15
to jsxg...@googlegroups.com, epm...@gmail.com
Thanks Murray, I guess that shows me the way. Shall try it out.
Reply all
Reply to author
Forward
0 new messages