kendoui仪表盘和柱状图 示例

一说到kendeodui我相信大家一定不陌生,这套js在画图方面效果也不错。

现在来看一看 仪表盘和柱状图的效果吧:

html和js代码如下:

复制代码
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>kendoui DEmo</title>
    <link type="text/css" rel="stylesheet" href="kendoui/styles/kendo.common.min.css" />
    <link type="text/css" rel="stylesheet" href="kendoui/styles/kendo.dataviz.metro.min.css" />

    <script type="text/javascript" src="kendoui/js/jquery.min.js"></script>
    <script type="text/javascript" src="kendoui/js/kendo.all.min.js"></script>

</head>
<body>
    <div>

        <div class="js-gauge" style=" width:250px; height:200px"></div>
        <div class="js-chart" style=" width:750px; height:600px"></div>
    </div>
    <script type="text/javascript">
        var ranges = [{
            from: 0,
            to: 30,
            color: "#F97172"
        }, {
            from: 30,
            to: 60,
            color: "#FADE71"
        }, {
            from: 60,
            to: 100,
            color: "#67DF65"
        }];



        $(".js-gauge").kendoRadialGauge({
            theme: 'metro',
            pointer: {
                value: 50,
                cap: {
                    size: 0.1,
                    color: "black"
                }
            },
            scale: {
                minorUnit: 20,
                majorTicks: {
                    size: 3
                },
                startAngle: -10,
                endAngle: 190,
                max: 100,
                labels: {
                    visible: true,
                    position: "inside",
                },
                rangeSize: 10,
                ranges: ranges
            }
        });

        $(".js-chart").kendoChart({
            theme: 'metro',
            legend: {
                position: "top"
            },
            seriesDefaults: {
                type: "column"
            },
            series: [{
                name: "Accomplishment",
                color: "#67DF65",
                axis: "number",
                data: [3.907, 7.943, 7.848, 9.284, 9.263, 9.801, 3.890, 8.238, 9.552, 6.855],
                tooltip: {
                    visible: true,
                    format: "{0:p1}",
                    template: "#= series.name #: #= kendo.toString(value,'n2') #"
                }
            }, {
                type: "line",
                color: "#B565DF",
                axis: "percent",
                name: "Validated Pipeline Coverage Ratio",
                data: [0.988, 0.733, 0.994, 0.464, 0.52, 0.939, 0.333, 0.245, 0.339, 0.727],
                tooltip: {
                    visible: true,
                    format: "{0:p1}",
                    template: "#= series.name #: #= kendo.toString(value,'p2') #"
                }
            }],
            valueAxis: [{
                name: 'number',
                labels: {
                    format: "{0:n1}"
                },
                line: {
                    visible: false
                }
            }, {
                name: 'percent',
                labels: {
                    format: "{0:p1}"
                },
                line: {
                    visible: false
                }
            }],
            categoryAxis: {
                categories: ['Papua New Guinea Rep Office', 'Papua New Guinea Rep Office', 'Papua New Guinea Rep Office', 'Papua New Guinea Rep Office', 'Validated Pipeline Coverage Ratio', 'Validated Pipeline Coverage Ratio', 'Validated Pipeline Coverage Ratio', 'Validated Pipeline Coverage Ratio', 'Validated Pipeline Coverage Ratio', 'Validated Pipeline Coverage Ratio'],
                line: {
                    visible: true
                },
                labels: {
                    rotation: -75
                },
                axisCrossingValues: [0, 10]
            },
            tooltip: {
            }
        });
    </script>
</body>
</html>
View Code
复制代码

相关代码下载http://download.csdn.net/detail/dz45693/7647501

posted on   dz45693  阅读(2552)  评论(0编辑  收藏  举报

编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示