vis.js - axis tick labels for graph3d

753 views
Skip to first unread message

Fabrizio Fortino

unread,
Sep 18, 2014, 9:48:10 AM9/18/14
to chap-link...@googlegroups.com
Hi there!

I am using the vis.js library: thank you for the cool project!

I am trying to use the Graph3D to create a surface chart. So far so good.

Would it be possible to specify the axis ticks labels (especially for the X and Y axis)?
For example I would like to change the labels with string representations like 40%, 50% or dates.
I tried to use date but the chart does not show up.

Any idea?

Thanks,
Fabrizio 

Jos de Jong

unread,
Sep 18, 2014, 10:19:15 AM9/18/14
to chap-link...@googlegroups.com
The Graph3D doesn't offer this customization. But feel free to add this feature, it's an open source project after all :)

Fabrizio Fortino

unread,
Sep 18, 2014, 12:44:14 PM9/18/14
to chap-link...@googlegroups.com
Good idea.

I took a quick look at the code. What do you think if I create two additional options?

xCategories
yCategories

These options are js objects containing the mapping between the tick value and the label.
At this point I can modify the Step getCurrent() function to return the category label when available.
If this is OK I can create a PR in short time.

WDYT? Any better solution?

Cheers,
Fabrizio

Jos de Jong

unread,
Sep 22, 2014, 4:08:07 AM9/22/14
to chap-link...@googlegroups.com
How about calling these two options xLabel and yLabel, and having them be a callback function instead of a map? This callback function accepts as input the label value at hand, and outputs the (formatted) label to be displayed in the Graph3d? 

Fabrizio Fortino

unread,
Sep 22, 2014, 9:02:07 AM9/22/14
to chap-link...@googlegroups.com
OK for the callbacks instead of the map.

About the option names: xLabel and yLabel are already used (http://visjs.org/docs/graph3d.html#Configuration_Options). How about xLabels and yLabels?

Jos de Jong

unread,
Sep 22, 2014, 9:16:40 AM9/22/14
to chap-link...@googlegroups.com
Ah of course, my bad. Maybe xLabels and yLabels will be confusing as they are too similar to xLabel and yLabel? Maybe any of xScaleLabel, xValueLabel, xValueTitle, xGridTitle, xGridLabel, xValueLayout, xLayout, ...

Fabrizio Fortino

unread,
Sep 22, 2014, 9:27:09 AM9/22/14
to chap-link...@googlegroups.com
Right. I'll go with xValueLabel / yValueLabel. 

Jos de Jong

unread,
Sep 22, 2014, 9:31:37 AM9/22/14
to chap-link...@googlegroups.com
super. 

any chance of implementing this for Graph3d of vis.js (successor) instead of CHAP Links Library?

Fabrizio Fortino

unread,
Sep 22, 2014, 10:06:24 AM9/22/14
to chap-link...@googlegroups.com
Of course. I am working on vis.js already. I used this group because I couldn't find the vis.js google group.

Jos de Jong

unread,
Sep 22, 2014, 10:09:11 AM9/22/14
to chap-link...@googlegroups.com
Great! thanks beforehand.

There is indeed no google groups for vis.js, we use the github issues section of the project for everything (questions, bug reports, feature requests, pull requests, discussions, etc).

Nithin

unread,
Jun 11, 2015, 8:10:21 AM6/11/15
to chap-link...@googlegroups.com

could you please post the customized code..
Message has been deleted

Jos de Jong

unread,
Jun 11, 2015, 8:40:57 AM6/11/15
to chap-link...@googlegroups.com, nithi...@gmail.com
This has been implemented in Graph3d in the vis.js library (the successor).

See the docs: http://visjs.org/docs/graph3d/ -> Configuration Options -> xValueLabel, yValueLabel, zValueLabel

Nithin

unread,
Jun 12, 2015, 1:31:44 AM6/12/15
to chap-link...@googlegroups.com, nithi...@gmail.com
thanks, is there any way to change the color of the bars according to our needs?

Jos de Jong

unread,
Jun 12, 2015, 2:49:27 AM6/12/15
to chap-link...@googlegroups.com, nithi...@gmail.com
That's not (yet) supported. You could post a feature request for that in the issues section of the project: https://github.com/almende/vis/issues/
Reply all
Reply to author
Forward
0 new messages