Scripts/OtherJs/eCharts/zrender-master/test/smoothline.html

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Smoothline</title>
    <script type="text/javascript" src="../doc/asset/js/esl/esl.js"></script>
</head>
<body>
    <div id="Main" style="width:1000px;height:900px;"></div>
    <script type="text/javascript">
    require.config({
        packages: [
            {
                name: 'zrender',
                location: '../src',
                main: 'zrender'
            }
        ]
    });

    require(
        [
            "zrender",
            "zrender/animation/animation",
            "zrender/shape/Polyline",
            "zrender/shape/Polygon"
        ], 
        function(zrender, Animation, PolylineShape, PolygonShape){

            // 初始化zrender
            var zr = zrender.init( document.getElementById("Main") );

            var pointList = [];
            for (var i = 0; i < 10; i++) {
                pointList.push([Math.random() * 300 + 100, Math.random() * 300 + 100]);
            }

            var smoothLine = new PolylineShape({
                style : {
                    pointList : pointList,
                    smooth : 'spline',
                    brushType : 'stroke',
                    color : 'rgba(220, 20, 60, 0.8)',
                    strokeColor : "rgba(220, 20, 60, 0.8)",
                    lineWidth : 2
                    // lineType : 'dotted'
                }
            });

            var smoothPolygon = new PolygonShape({
                style : {
                    pointList : [[50, 50], [200, 10], [100, 200], [50, 150], [50, 50]],
                    smooth : 0.5,
                    smoothConstraint: [[-Infinity, -Infinity], [200, Infinity]],
                    brushType : 'both',
                    color : 'rgba(220, 20, 60, 0.4)',
                    strokeColor : "rgba(220, 20, 60, 1)",
                    lineWidth : 2
                    // lineType : 'dotted'
                }
后面还有 9 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。