@meta2d/le5le-charts
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "@meta2d/le5le-charts", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "The le5le-charts library based on le5le meta2d.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,2 +8,5 @@ import { scaleCompute } from './normalizedAxis'; | ||
var h = pen.calculative.worldRect.height; | ||
// 缩放比例 | ||
var r = w / 2; | ||
var scale = pen.calculative.canvas.store.data.scale; | ||
var series = []; | ||
@@ -33,8 +36,8 @@ if (pen.echarts) { | ||
ctx.strokeStyle = '#BFBFBF'; | ||
ctx.lineWidth = 6; | ||
ctx.lineWidth = 6 * scale; | ||
ctx.lineCap = 'butt'; | ||
var dash = (w - 1 * (num + 1)) / num; | ||
ctx.setLineDash([1, dash]); | ||
ctx.moveTo(x, y + h + 3); | ||
ctx.lineTo(x + w, y + h + 3); | ||
ctx.moveTo(x, y + h + 3 * scale); | ||
ctx.lineTo(x + w, y + h + 3 * scale); | ||
ctx.stroke(); | ||
@@ -44,3 +47,3 @@ ctx.closePath(); | ||
ctx.beginPath(); | ||
ctx.lineWidth = 1; | ||
ctx.lineWidth = 1 * scale; | ||
ctx.setLineDash([]); | ||
@@ -60,3 +63,4 @@ ctx.moveTo(x, y + h); | ||
ctx.textBaseline = 'middle'; | ||
ctx.fillText(normalizedOption.max - i * normalizedOption.interval + '', x - 10, y + temH); | ||
ctx.font = r / 10 + 'px AlibabaPuHuiTi-Regular, Alibaba PuHuiTi'; | ||
ctx.fillText(normalizedOption.max - i * normalizedOption.interval + '', x - 10 * scale, y + temH); | ||
ctx.fill(); | ||
@@ -79,3 +83,4 @@ if (i < normalizedOption.splitNumber) { | ||
ctx.textBaseline = 'top'; | ||
ctx.fillText(xData[i], xdataX, y + h + 10); | ||
ctx.font = r / 10 + 'px AlibabaPuHuiTi-Regular, Alibaba PuHuiTi'; | ||
ctx.fillText(xData[i], xdataX, (y + h + 10 * scale)); | ||
ctx.fill(); | ||
@@ -82,0 +87,0 @@ } |
@@ -28,2 +28,3 @@ var __assign = (this && this.__assign) || function () { | ||
var h = pen.calculative.worldRect.height; | ||
var scale = pen.calculative.canvas.store.data.scale; | ||
var basicConfigure = { | ||
@@ -86,3 +87,3 @@ startAngle: 225, | ||
//主刻度线 | ||
var dashWidth = 2; | ||
var dashWidth = 2 * scale; | ||
var mainR = r - bgLineWidth; | ||
@@ -103,3 +104,3 @@ if (mainR < 0) { | ||
//从刻度线 | ||
var fromDashWidth = 1; | ||
var fromDashWidth = 1 * scale; | ||
var fromR = r - bgLineWidth; | ||
@@ -106,0 +107,0 @@ if (fromR < 0) { |
@@ -8,2 +8,3 @@ import { coordinateAxis } from './coordinateAxis'; | ||
} | ||
var scale = pen.calculative.canvas.store.data.scale; | ||
var x = pen.calculative.worldRect.x; | ||
@@ -45,2 +46,3 @@ var y = pen.calculative.worldRect.y; | ||
ctx.strokeStyle = '#ffffff'; | ||
ctx.lineWidth = 1 * scale; | ||
var currentX = 0; | ||
@@ -47,0 +49,0 @@ var currentY = 0; |
@@ -37,2 +37,3 @@ var __read = (this && this.__read) || function (o, n) { | ||
var h = pen.calculative.worldRect.height; | ||
var scale = pen.calculative.canvas.store.data.scale; | ||
var series = []; | ||
@@ -176,4 +177,4 @@ if (pen.echarts && !pen.echarts.option.color) { | ||
ctx.strokeStyle = '#fff'; | ||
ctx.lineWidth = 2; | ||
ctx.arc(item.x, item.y, 4, 0, Math.PI * 2); | ||
ctx.lineWidth = 2 * scale; | ||
ctx.arc(item.x, item.y, 4 * scale, 0, Math.PI * 2); | ||
ctx.stroke(); | ||
@@ -180,0 +181,0 @@ ctx.fill(); |
@@ -33,2 +33,4 @@ var __read = (this && this.__read) || function (o, n) { | ||
} | ||
// 缩放模式 | ||
var scale = pen.calculative.canvas.store.data.scale; | ||
var x = pen.calculative.worldRect.x; | ||
@@ -122,3 +124,3 @@ var y = pen.calculative.worldRect.y; | ||
: '#fff'; | ||
ctx.lineWidth = isEcharts ? ((_b = series.itemStyle) === null || _b === void 0 ? void 0 : _b.borderWidth) || 2 : 2; | ||
ctx.lineWidth = (isEcharts ? ((_b = series.itemStyle) === null || _b === void 0 ? void 0 : _b.borderWidth) || 2 : 2) * scale; | ||
var data = isEcharts ? series.data : series; | ||
@@ -146,4 +148,4 @@ data.forEach(function (item, index) { | ||
var centerAngle = (beforeAngle + afterAngle) / 2; | ||
var temX = centerX + (toR + 5) * Math.sin(centerAngle); | ||
var temY = centerY - (toR + 5) * Math.cos(centerAngle); | ||
var temX = centerX + (toR + 10 * scale) * Math.sin(centerAngle); | ||
var temY = centerY - (toR + 10 * scale) * Math.cos(centerAngle); | ||
var temFillStyle = ctx.fillStyle; | ||
@@ -174,2 +176,3 @@ if (!series.label) { | ||
ctx.textAlign = 'center'; | ||
// 写入文字 | ||
if (centerAngle > Math.PI) { | ||
@@ -180,6 +183,6 @@ if ((isEcharts && series.label.position === 'outside') || !isEcharts) { | ||
if ((isEcharts && series.labelLine.show !== false) || !isEcharts) { | ||
ctx.lineTo(temX - 5, temY); | ||
ctx.lineTo(temX - 5 * scale, temY); | ||
} | ||
if ((isEcharts && series.label.show !== false) || !isEcharts) { | ||
ctx.fillText(item.name, temX - 5, temY); | ||
ctx.fillText(item.name, temX - 5 * scale, temY); | ||
} | ||
@@ -192,6 +195,6 @@ } | ||
if ((isEcharts && series.labelLine.show !== false) || !isEcharts) { | ||
ctx.lineTo(temX + 5, temY); | ||
ctx.lineTo(temX + 5 * scale, temY); | ||
} | ||
if ((isEcharts && series.label.show !== false) || !isEcharts) { | ||
ctx.fillText(item.name, temX + 5, temY); | ||
ctx.fillText(item.name, temX + 5 * scale, temY); | ||
} | ||
@@ -198,0 +201,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
88177
1246