Closed xwydq closed 5 years ago
Can you show an example of how this should work in HTML without the R package? If I can see a proper working example in html+javascript I can try to see if it can be converted to work in timevis.
Here's a starter for you, a minimal html file that creates a timevis with no options. Please fill in the timeline.setOptions()
call. (you'll need to change the paths of vis.min.js and vis.min.css to make sure the html page can access those)
<!DOCTYPE HTML>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="visualization"></div>
<script type="text/javascript">
var container = document.getElementById('visualization');
var items = [
{id: 1, content: 'item 1', start: '2013-04-19'}
]
var timeline = new vis.Timeline(container, items, {});
timeline.setOptions({format:{majorLabels:{month:'YY'}}})
</script>
</body>
</html>
I want modify month format to Number(1-12)
month:"MMM"
tomonth:"M"
in js filevis.min.js
in R package timevis (failed)