JSFiddle - React, Tailwind, and code Playground
by joplomacedo
HTML
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/stock/modules/exporting.js"></script>
<div id="container" style="height: 400px; min-width: 310px"></div>
JavaScript
$(function () {
$('#container').highcharts('StockChart', {
series: [{
name: '2',
xpointInterval: 36e5 * 24,
data: [11,2,3,2,2,11,2,3,2,2,11,2,3,2,2,11,2,3,2,2,11,2,3,2,2,11,2,3,2,2,11,2,3,2,2,11,2,3,2,2,11,2,3,2,2,11,2,3,2,2,11,2,3,2,2,11,2,3,2,2,11,2,3,2,2]
}],
xAxis: {
plotLines: [{
color: 'red', // Color value
dashStyle: 'longdashdot', // Style of the plot line. Default to solid
value: 5, // Value of where the line will appear
width: 2 // Width of the line
}]
}
});
});
function foldersAndFileName( str ) {
const parts = str.split('/');
const folders = parts.slice(0, parts.length-1).join('/');
const fileName = parts[parts.length-1];
return [folders, fileName]
}
console.log(
[
'filename.js',
'test1/filename.js',
'test/sub/filename.js'
].map( str => foldersAndFileName(str))
)