MCPcopy Create free account
hub / github.com/CoderOpen/waimai / Charts

Function Charts

front/components/u-charts/u-charts.js:4524–4631  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

4522};
4523
4524var Charts = function Charts(opts) {
4525 opts.pixelRatio = opts.pixelRatio ? opts.pixelRatio : 1;
4526 opts.fontSize = opts.fontSize ? opts.fontSize * opts.pixelRatio : 13 * opts.pixelRatio;
4527 opts.title = assign({}, opts.title);
4528 opts.subtitle = assign({}, opts.subtitle);
4529 opts.duration = opts.duration ? opts.duration : 1000;
4530 opts.yAxis = assign({}, {
4531 gridType: 'solid',
4532 dashLength: 4 * opts.pixelRatio
4533 }, opts.yAxis);
4534 opts.xAxis = assign({}, {
4535 rotateLabel: false,
4536 type: 'calibration',
4537 gridType: 'solid',
4538 dashLength: 4 * opts.pixelRatio,
4539 scrollAlign: 'left',
4540 boundaryGap:'center'
4541 }, opts.xAxis);
4542 opts.legend = assign({}, {
4543 show: true,
4544 position: 'bottom',
4545 float: 'center',
4546 backgroundColor: 'rgba(0,0,0,0)',
4547 borderColor: 'rgba(0,0,0,0)',
4548 borderWidth: 0,
4549 padding: 5,
4550 margin: 5,
4551 itemGap: 10,
4552 fontSize: opts.fontSize,
4553 lineHeight: opts.fontSize,
4554 fontColor: '#333333',
4555 format: {},
4556 hiddenColor: '#CECECE'
4557 }, opts.legend);
4558 opts.legend.borderWidth = opts.legend.borderWidth * opts.pixelRatio;
4559 opts.legend.itemGap = opts.legend.itemGap * opts.pixelRatio;
4560 opts.legend.padding = opts.legend.padding * opts.pixelRatio;
4561 opts.legend.margin = opts.legend.margin * opts.pixelRatio;
4562 opts.extra = assign({}, opts.extra);
4563 opts.rotate = opts.rotate ? true : false;
4564 opts.animation = opts.animation ? true : false;
4565
4566 let config$$1 = JSON.parse(JSON.stringify(config));
4567 config$$1.colors = opts.colors ? opts.colors : config$$1.colors;
4568 config$$1.yAxisTitleWidth = opts.yAxis.disabled !== true && opts.yAxis.title ? config$$1.yAxisTitleWidth : 0;
4569 if (opts.type == 'pie' || opts.type == 'ring') {
4570 config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.pie.labelWidth * opts.pixelRatio || config$$1.pieChartLinePadding * opts.pixelRatio;
4571 }
4572 if (opts.type == 'rose') {
4573 config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.rose.labelWidth * opts.pixelRatio || config$$1.pieChartLinePadding * opts.pixelRatio;
4574 }
4575 config$$1.pieChartTextPadding = opts.dataLabel === false ? 0 : config$$1.pieChartTextPadding * opts.pixelRatio;
4576 config$$1.yAxisSplit = opts.yAxis.splitNumber ? opts.yAxis.splitNumber : config.yAxisSplit;
4577
4578 //屏幕旋转
4579 config$$1.rotate = opts.rotate;
4580 if (opts.rotate) {
4581 let tempWidth = opts.width;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected