juijs-chart
Advanced tools
Comparing version 2.5.16 to 2.5.17
import jui from '../src/main.js' | ||
import ClassicTheme from '../src/theme/classic.js' | ||
import DarkTheme from '../src/theme/dark.js' | ||
import LineBrush from '../src/brush/line.js' | ||
import ZoomSelectWidget from '../src/widget/zoomselect.js' | ||
import CrossWidget from '../src/widget/cross.js' | ||
import FullStackBarBrush from '../src/brush/fullstackbar.js' | ||
import LegendWidget from '../src/widget/legend.js' | ||
jui.use([ ClassicTheme, DarkTheme, LineBrush, ZoomSelectWidget, CrossWidget ]); | ||
jui.use([ ClassicTheme, DarkTheme, FullStackBarBrush, LegendWidget ]); | ||
const time = jui.include('util.time'); | ||
const builder = jui.include('chart.builder'); | ||
const data = [ | ||
{ date : new Date("2015/01/01 00:00:00"), sales : 50, profit : 35 }, | ||
{ date : new Date("2015/01/01 06:00:00"), sales : 20, profit : 30 }, | ||
{ date : new Date("2015/01/01 12:00:00"), sales : 10, profit : 5 }, | ||
{ date : new Date("2015/01/01 18:00:00"), sales : 30, profit : 25 }, | ||
{ date : new Date("2015/01/02 00:00:00"), sales : 25, profit : 20 } | ||
]; | ||
const builder = jui.include("chart.builder"); | ||
window.chart = builder('#chart', { | ||
height : 300, | ||
padding : { | ||
right : 120 | ||
window.chart = builder("#chart", { | ||
width: 400, | ||
height : 400, | ||
theme : "classic", | ||
axis : { | ||
data : [ | ||
{ name : 2, value : 15, test : 0 }, | ||
{ name : 15, value : 6, test : 0 }, | ||
{ name : 8, value : 0, test : 0 }, | ||
{ name : 0, value : 0, test : 0 } | ||
], | ||
y : { | ||
domain : [ "week1", "week2", "week3", "week4" ], | ||
line : true | ||
}, | ||
x : { | ||
type : 'range', | ||
domain : [0, 100], | ||
format : function(value) { return value + "%" ;}, | ||
line : true | ||
} | ||
}, | ||
axis : [ | ||
{ | ||
x : { | ||
type : "date", | ||
domain : [ new Date("2015/01/01"), new Date("2015/01/02") ], | ||
interval : 1000 * 60 * 60 * 6, // // 6hours | ||
format : "MM/dd HH:mm", | ||
key : "date", | ||
line : true | ||
}, | ||
y : { | ||
type : "range", | ||
domain : [ 0, 100 ], | ||
step : 5, | ||
line : true, | ||
orient : "right" | ||
}, | ||
data: data | ||
brush : { | ||
type : 'fullstackbar', | ||
target : ['name', 'value', 'test'], | ||
showText: true, | ||
activeEvent : "click", | ||
active : 1, | ||
size : 20 | ||
}, | ||
widget : { | ||
type : 'legend' | ||
}, | ||
event: { | ||
click: function(obj, e) { | ||
console.log(obj); | ||
} | ||
], | ||
brush : [ | ||
{ type : "line", target : "sales", colors : [ "#434348" ] , symbol : "curve" } | ||
], | ||
widget : [ | ||
{ type : "zoomselect" }, | ||
{ type : "cross", xFormat: function(d) { return time.format(d, "HH:mm:ss"); }} | ||
], | ||
event : { | ||
"zoomselect.end": function(stime, etime) { | ||
console.log(new Date(stime), new Date(etime)); | ||
} | ||
} | ||
}); |
{ | ||
"name": "juijs-chart", | ||
"version": "2.5.16", | ||
"version": "2.5.17", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "description": "SVG-based JUI chart that can be used in the browser and Node.js. Support many types of charts. (Dashboard, Map, Topology, Full 3D)", |
@@ -57,6 +57,8 @@ import jui from '../main.js'; | ||
for(var j = list.length - 1; j >= 0; j--) { | ||
for(var j = 0; j < list.length; j++) { | ||
var width = axis.x.rate(list[j], sum), | ||
r = this.getBarElement(i, j); | ||
if(isNaN(width)) continue; | ||
r.attr({ | ||
@@ -63,0 +65,0 @@ x : startX, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
3
2967914
119
34045