簡體   English   中英

使用KendoUI折線圖,如何使數據標記(點)成為純色?

[英]Using KendoUI Line Chart, How to make the data markers (Dots) a solid color?

我正在使用Kendo UI來替換現有的圖表。 我需要盡量減少圖表之間的變化。 有誰知道如何使折線圖上的點固體? 是否可以使線條更薄?

這是我的圖表圖片:

這是我的jsFiddle項目,如果你想玩它: http//jsfiddle.net/rodneyhickman/uMTnh/2/

我的HTML看起來像:

<div id='chart'  ></div>

我的jQuery腳本看起來像:

    jQuery('#chart').kendoChart({
    title: {
        text: "Overall Score out of 100",
        align: "left",
        font: "18px Arial, Verdana, sans-serif",
        color: "#444"
    },
    seriesDefaults: {
        type: "line",
        missingValues: "interpolate",

    },
    legend: {
        position: "bottom"
    },
    tooltip: {
        visible: true,
        format: "{0}%"
    },
    valueAxis: {
        min: 70,
        max: 85,
        plotBands: [{
            from: 70,
            to: 75,
            color: "#EDF5FF"},
        {
            from: 80,
            to: 85,
            color: "#EDF5FF"}]
    },
    series: [{
        name: "Some Product",
        color: "004990",
        tooltip: {
            visible: true,
            template: "<b>Some Product</b><br/>Current Score: #= value #<br/>#= category # "
        },
        data: [81.82, 81.82, 81.82, null, null, null, null, null, null, null, null, 70.42, 72.37]},
    {
        name: "Some Market Segmemt",
        color: "da7633",
        tooltip: {
            visible: true,
            template: "<b>Some Market Segmemt</b><br/>Current Score: #= value #<br/>#= category # "
        },
        data: [73.81, 73.52, 73.59, 73.49, 73.41, 73.51, 73.72, 73.27, 74.23, 73.99, 73.97, 73.83, 73.79]}],
    categoryAxis: {
        labels: {
            rotation: -45,
            step: 1,
            skip: 0
        },
        categories: ["Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan - 2012", "Feb", "Mar"]
    }
});

任何幫助,將不勝感激。

在系列對象使用標記中:{background:“#004990”}, //使用您的背景顏色。

要設置條形的witd,也請使用width:1屬性。

以下是您可以使用的jsfiddle解決方案: http//jsfiddle.net/rodneyhickman/uMTnh/3/

這是結果圖像:

新的jQuery腳本如下所示:

jQuery('#chart').kendoChart({
    title: {
        text: "Overall Score out of 100",
        align: "left",
        font: "18px Arial, Verdana, sans-serif",
        color: "#444"
    },
    seriesDefaults: {
        type: "line",
        missingValues: "interpolate"

    },
    legend: {
        position: "bottom"
    },
    tooltip: {
        visible: true,
        format: "{0}%"
    },
    valueAxis: {
        min: 70,
        max: 85,
        plotBands: [{
            from: 70,
            to: 75,
            color: "#EDF5FF"},
        {
            from: 80,
            to: 85,
            color: "#EDF5FF"}]
    },
    series: [{
        name: "Some Product",
        color: "004990",
        width: 1,
        markers: { background: "#004990"  },
        size: 2,
        tooltip: {
            visible: true,
            template: "<b>Some Product</b><br/>Current Score: #= value #<br/>#= category # "
        },
        data: [81.82, 81.82, 81.82, null, null, null, null, null, null, null, null, 70.42, 72.37]},
    {
        name: "Some Market Segmemt",
        color: "da7633",
        width: 1,
        markers: { background: "#da7633"  },
        tooltip: {
            visible: true,
            template: "<b>Some Market Segmemt</b><br/>Current Score: #= value #<br/>#= category # "
        },
        data: [73.81, 73.52, 73.59, 73.49, 73.41, 73.51, 73.72, 73.27, 74.23, 73.99, 73.97, 73.83, 73.79]}],
    categoryAxis: {
        labels: {
            rotation: -45,
            step: 1,
            skip: 0
        },
        categories: ["Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan - 2012", "Feb", "Mar"]
    }
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM